Best practices
-
Reach for
SET_SPEEDpresets ($Human,$Normal,$Fastest) instead of hand-picking aSET_DELAYvalue. They’re easier to reason about and easier to swap later. -
Wrap any sequence you repeat more than twice in a
FUNCTIONrather 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
DELAYafterGUI ror launching a program avoids keystrokes arriving before the window has focus. -
Prefer
STRINGLNoverSTRINGfollowed by a separateENTER. It’s one line instead of two and behaves identically. -
Keep
DEFINEconstantsSTR-typed when they’ll be substituted intoSTRING,STRINGLNorFAST_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
FUNCTIONbody 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 lowSET_DELAY) executes a payload quicker but looks less human. Balance speed against stealth per payload rather than defaulting to the fastest setting. -
Only add
DELAYwhere 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.