Skip to contentSkip to Content
Language guideBest practices

Best practices

  • Reach for SET_SPEED presets ($Human, $Normal, $Fastest) instead of hand-picking a SET_DELAY value. They’re easier to reason about and easier to swap later.

  • Wrap any sequence you repeat more than twice in a FUNCTION rather than pasting it. One definition is easier to fix than five copies.

  • Give the target OS a moment after opening a dialog or app before typing into it. A short DELAY after GUI r or launching a program avoids keystrokes arriving before the window has focus.

  • Prefer STRINGLN over STRING followed by a separate ENTER. It’s one line instead of two and behaves identically.

  • Keep DEFINE constants STR-typed when they’ll be substituted into STRING, STRINGLN or FAST_STRING.

  • Always test a payload against the exact OS and keyboard layout you’re targeting before relying on it. Mantis types keystrokes blindly, with no awareness of what’s actually on screen.

Performance tips

  • Flash usage scales with script size at roughly 1 byte per character. See the flash variants table for how much a given flash chip can hold.

  • A FUNCTION body is stored once no matter how many times it’s called, so wrapping a repeated block in a function uses less flash than writing it out each time.

  • Faster pacing ($Fastest, or a low SET_DELAY) executes a payload quicker but looks less human. Balance speed against stealth per payload rather than defaulting to the fastest setting.

  • Only add DELAY where the target OS genuinely needs time to catch up (opening a window, loading a page). Padding delays elsewhere just makes the payload slower to run for no benefit.

Last updated on