Skip to contentSkip to Content

Timing

Three commands control pacing. Managing delays is crucial for ensuring the target computer has enough time to process your inputs.

CommandBehavior
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 keys
2SET_SPEED $Human
3
4STRINGLN notepad.exe

DELAY

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 speed
2SET_SPEED $Fastest
3
4GUI r
5REM Wait half a second for the Run dialog to appear
6DELAY 500
7
8STRINGLN calc.exe

SET_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_DELAY is mostly unsupported in modern workflows. When writing scripts, you should ignore this command and always use SET_SPEED instead.
set_delay_legacy.mantis
1REM Legacy command - avoid using this
2SET_DELAY 30
3
4STRINGLN cmd.exe
Last updated on