Blocks
Group and repeat lines — write blocks, repeat, while, functions, and comment blocks
Auf dieser Seite
Blocks group several lines under a single start/end pair. Text blocks type each enclosed line; control blocks repeat, loop, define, or skip the lines between their markers.
Text blocks
Instead of one write command per line, a text block types every line between its markers. Each variant matches the corresponding single-line keyboard command.
writeStart … writeEnd types each line; writeLnStart … writeLnEnd presses Enter after each line. A small inter-line gap lets the host keep up — the default is 12 ms. Pass an optional gap on the start marker to raise it (e.g. writeLnStart 30).
writeLnStart
First line
Second line
writeLnEndwriteLnStart 30
Paced line one
Paced line two
writeLnEndaccurateWriteStart … accurateWriteEnd types each line with a fixed per-character delay; accurateWriteLnStart … accurateWriteLnEnd adds Enter. The per-character delay is read from the start marker and defaults to 40 ms (negative values are treated as 0). A fixed 300 ms gap is inserted between lines. HID transport only.
accurateWriteStart 40
slow and reliable
one char at a time
accurateWriteEnddelayedWriteStart … delayedWriteEnd (and the …Ln variant) is the same idea as accurateWrite, but the per-character delay is applied inside the HID driver. Delay defaults to 40 ms; 300 ms between lines. HID transport only.
delayedWriteStart 25
rate-limited input
second line
delayedWriteEndRepeat
repeatStart <n> … repeatEnd runs the enclosed commands n times. The count is a signed integer (max 2147483647). A stop request breaks out of the loop.
repeatStart 3
writeLn "Repeat me"
write "and me"
repeatEndWhile
whileStart "<a>" <op> "<b>" … whileEnd repeats the body while the condition holds. The condition uses the same quoted-operand syntax as IF and is re-expanded and re-evaluated every iteration, so it usually references a variable you mutate inside the loop. A runaway guard caps the loop at 100,000 iterations.
_$VAR counter = "0"
whileStart "${counter}$" < "5"
writeLn "Attempt ${counter}$"
add counter 1
whileEndFunction
functionStart <name> … functionEnd defines a reusable named block. The body is stored, not executed, at definition time; invoke it later with call <name> or <name>(). Functions must be defined before they are called, and recursion is bounded to a call depth of 16.
functionStart greet
writeLn "Hello from a function"
functionEnd
call greet
greet()Comment block
Everything between commentStart and commentEnd is skipped while the script is read. Unlike single-line // and # comments, a comment block also works inside repeat, while, and function bodies.
commentStart
This whole section is ignored,
including any commands inside it.
commentEndBlock reference
| Block | Start | End | Behavior |
|---|---|---|---|
| Write | writeStart [gap] | writeEnd | Types each line (default gap 12 ms) |
| WriteLn | writeLnStart [gap] | writeLnEnd | Types each line + Enter (default gap 12 ms) |
| AccurateWrite | accurateWriteStart [ms] | accurateWriteEnd | Per-char delay (default 40 ms), 300 ms between lines, HID only |
| AccurateWriteLn | accurateWriteLnStart [ms] | accurateWriteLnEnd | As above + Enter, HID only |
| DelayedWrite | delayedWriteStart [ms] | delayedWriteEnd | Driver-side per-char delay (default 40 ms), HID only |
| DelayedWriteLn | delayedWriteLnStart [ms] | delayedWriteLnEnd | As above + Enter, HID only |
| Repeat | repeatStart <n> | repeatEnd | Runs body n times (signed int, max 2147483647) |
| While | whileStart "<a>" <op> "<b>" | whileEnd | Loops while condition holds (max 100,000 iters) |
| Function | functionStart <name> | functionEnd | Defines a callable block (recursion depth ≤ 16) |
| Comment | commentStart | commentEnd | Skips everything in between |