forked from hak5/usbrubberducky-payloads
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove unreachable assignment that is not required for the context of the example
- Loading branch information
1 parent
452dcca
commit e6ce06a
Showing
1 changed file
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,33 @@ | ||
REM Example FUNCTION with RETURNATTACKMODE HIDDELAY 2000BUTTON_DEF STRING !END_BUTTONFUNCTION TEST_BUTTON() STRING Press the button within the next 5 seconds. VAR $TIMER = 5 WHILE ($TIMER > 0) STRING . DELAY 1000 $TIMER = ($TIMER - 1) END_WHILE ENTER IF ($_BUTTON_PUSH_RECEIVED == TRUE) THEN RETURN TRUE ELSE IF ($_BUTTON_PUSH_RECEIVED == FALSE) THEN RETURN FALSE END_IF $_BUTTON_PUSH_RECEIVED = FALSEEND_FUNCTIONIF (TEST_BUTTON() == TRUE) THEN STRINGLN The button was pressed!ELSE STRINGLN The button was not pressed!END_IF | ||
REM Example FUNCTION with RETURN | ||
ATTACKMODE HID | ||
DELAY 2000 | ||
|
||
BUTTON_DEF | ||
STRING ! | ||
END_BUTTON | ||
|
||
FUNCTION TEST_BUTTON() | ||
STRING Press the button within the next 5 seconds. | ||
VAR $TIMER = 5 | ||
WHILE ($TIMER > 0) | ||
STRING . | ||
DELAY 1000 | ||
$TIMER = ($TIMER - 1) | ||
END_WHILE | ||
ENTER | ||
IF ($_BUTTON_PUSH_RECEIVED == TRUE) THEN | ||
RETURN TRUE | ||
ELSE IF ($_BUTTON_PUSH_RECEIVED == FALSE) THEN | ||
RETURN FALSE | ||
END_IF | ||
END_FUNCTION | ||
|
||
IF (TEST_BUTTON() == TRUE) THEN | ||
STRINGLN The button was pressed! | ||
ELSE | ||
STRINGLN The button was not pressed! | ||
END_IF | ||
|
||
REM When the IF statement on line 26 checks the condition of the function TEST_BUTTON, the function is called and executed. | ||
REM Based on whether or not the button is pressed, the RETURN value (lines 19 and 21) will be set to TRUE or FALSE. | ||
REM The IF statement on line 26 evaluates the RETURN of the function TEST_BUTTON and types the result accordingly. | ||
REM The IF statement on line 26 evaluates the RETURN of the function TEST_BUTTON and types the result accordingly. |