Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/examples/Functions/Functions-example1.txt
2968 views
1
REM Example Function
2
VAR $TIMER = 3
3
FUNCTION COUNTDOWN()
4
WHILE ($TIMER > 0)
5
STRING .
6
$TIMER = ($TIMER - 1)
7
DELAY 500
8
END_WHILE
9
END_FUNCTION
10
11
STRING And then it happened
12
COUNTDOWN()
13
14
SPACE
15
STRING a door opened to a world
16
$TIMER = 5
17
COUNTDOWN()
18
19
REM The FUNCTION command defines a new function named COUNTDOWN() containing a code block with a WHILE loop which types a single period (".") for each value of $TIMER.
20
REM The first time the COUNTDOWN() function is called, the $TIMER variable holds the value 3. The second time it is called, the $TIMER variable holds the value 5.
21
REM The string "And then it happened... a door opened to a world....." will be typed.
22
23