Timing
Three commands control pacing. Managing delays is crucial for ensuring the target computer has enough time to process your inputs.
| Command | Behavior |
|---|---|
SET_SPEED <ms|preset> | Sets the delay applied between every keystroke from that point on. |
DELAY <ms> | Pauses the whole script for the given number of milliseconds before the next instruction runs. |
SET_DELAY <ms> | (Legacy) Older version of SET_SPEED. Mostly ignored in modern scripts. |
SET_SPEED
The SET_SPEED command dictates how fast Mantis types text. It accepts either raw millisecond values (e.g. 20) or one of the built-in natural presets ($Fastest, $Normal, $Human, $Random) from Values & constants.
Warning: Per-keystroke pacing has a floor of 7 ms. Anything set lower than that is rejected at compile time.
set_speed.mantis
1REM Use a natural human preset to avoid detection or dropped keys2SET_SPEED $Human34STRINGLN notepad.exeDELAY
The DELAY command pauses the entire script for a specified number of milliseconds. Both DELAY and SET_SPEED accept whole-millisecond values from 0 up to roughly 4.29 billion (about 49 days).
Important: Always use a DELAY after opening a program (like the Run dialog) to give the operating system time to load the UI before you start typing into it.
delay.mantis
1REM Set a fast typing speed2SET_SPEED $Fastest34GUI r5REM Wait half a second for the Run dialog to appear6DELAY 50078STRINGLN calc.exeSET_DELAY (Legacy)
SET_DELAY is the legacy version of SET_SPEED. It only accepts raw millisecond integers and does not support the modern speed presets.
Note:SET_DELAYis mostly unsupported in modern workflows. When writing scripts, you should ignore this command and always useSET_SPEEDinstead.
set_delay_legacy.mantis
1REM Legacy command - avoid using this2SET_DELAY 3034STRINGLN cmd.exeLast updated on