Skip to contentSkip to Content
Language guideCommand reference

Mantis Command Reference

Mantis Language · Complete Syntax & Command Cheat Sheet

Every command currently supported in Mantis, grouped by functional category with links to dedicated reference pages.

Core commands

CommandSyntaxWhat It DoesDedicated Guide
STRINGSTRING textTypes text exactly as written.STRING Guide
STRINGLNSTRINGLN textTypes text, then presses Enter.STRINGLN Guide
FAST_STRING (Pro)FAST_STRING textTypes text via batched HID codes at maximum speed.FAST_STRING Guide
STRING_BLOCKSTRING_BLOCK ... END_STRINGTypes multiple lines collapsed into one.Strings Guide
DELAYDELAY msPauses the script.DELAY Guide
SET_DELAYSET_DELAY msSets fixed per-keystroke pacing.SET_DELAY Guide
SET_SPEEDSET_SPEED speedSets per-keystroke pacing via preset (e.g. $Random, $Human).SET_SPEED Guide
DEFINEDEFINE name type valueDeclares a compile-time constant.DEFINE Guide
REMREM commentComment — stripped during compilation.REM Guide
LOOPLOOP [count] ... END_LOOPRepeats a block infinitely or a finite number of times.LOOP Guide
BREAKBREAKExits the current loop early.LOOP Guide
CONTINUECONTINUESkips to the next iteration of the loop.LOOP Guide
IF / ELSEIF cond THEN ... END_IFBranching based on a condition (BUTTON_PRESSED, TRUE).IF & ELSE Guide
LED_ON / LED_OFFLED_ON / LED_OFFScriptable onboard status LED control.LED Guide
WAIT_FOR_BUTTON_PRESSWAIT_FOR_BUTTON_PRESSPauses until the onboard button is pressed.Button Guide
BUTTON_DEFBUTTON_DEF ... END_BUTTONDefines an on-press handler block.BUTTON_DEF Guide
FUNCTIONFUNCTION name() ... END_FUNCTIONDefines a reusable named block.FUNCTION Guide
Function callname()Runs a previously defined function.FUNCTION Guide
ATTACKMODEATTACKMODE modeConfigures USB CDC/HID/OFF modes.ATTACKMODE Guide
INJECT_MODINJECT_MOD modifierDirectly injects raw modifier bitmasks.INJECT_MOD Guide

Examples

Related commands are grouped into one runnable example where it makes sense; standalone commands get their own.

STRING / STRINGLN / FAST_STRING / STRING_BLOCK

hello.mantis
1STRING Hello
2STRINGLN Hello
3FAST_STRING Hello
4STRING_BLOCK
5This block spans three source lines
6but types as one.
7END_STRING

DELAY / SET_DELAY / SET_SPEED

hello.mantis
1DELAY 500
2SET_DELAY 30
3SET_SPEED $Human
4SET_SPEED $Random

DEFINE

hello.mantis
1DEFINE #NAME STR Karvi
2STRINGLN Hello #NAME

LOOP / BREAK / CONTINUE

hello.mantis
1LOOP 10
2IF BUTTON_PRESSED THEN
3 BREAK
4END_IF
5STRING .
6DELAY 300
7END_LOOP

IF / ELSE

hello.mantis
1IF BUTTON_PRESSED THEN
2 STRINGLN Button is pressed!
3ELSE
4 STRINGLN Button is released.
5END_IF

LED_ON / LED_OFF

hello.mantis
1LED_ON
2DELAY 300
3LED_OFF

WAIT_FOR_BUTTON_PRESS

hello.mantis
1STRING Waiting...
2WAIT_FOR_BUTTON_PRESS
3STRINGLN Button pressed, continuing.

FUNCTION … END_FUNCTION / name()

hello.mantis
1FUNCTION greet()
2STRINGLN Hello from a function!
3END_FUNCTION
4
5greet()
6greet()

BUTTON_DEF … END_BUTTON

hello.mantis
1BUTTON_DEF
2STRINGLN You pressed the button!
3END_BUTTON

ATTACKMODE / INJECT_MOD

hello.mantis
1ATTACKMODE HID
2INJECT_MOD CTRL ALT

Keys & modifiers

See Keyboard commands for the full key and modifier tables and examples.

Pro / roadmap

Reserved for a future release — not available in the base Mantis firmware today:

NameNote
Serial / CDC scriptingPlanned commands for scripting the device’s serial (USB CDC) channel directly.
Last updated on