Skip to contentSkip to Content

Mantis FUNCTION Command

The FUNCTION command creates named, reusable payload subroutines that can be called anywhere in the script using function_name().

Functions are stored once in flash memory regardless of how many times they are invoked, keeping compiled bytecode lightweight.


Syntax & Examples

hello.mantis
1FUNCTION open_terminal()
2 GUI r
3 DELAY 400
4 STRINGLN cmd
5 DELAY 800
6END_FUNCTION
7
8REM Call function
9open_terminal()
10STRINGLN echo Running first task...
11
12open_terminal()
13STRINGLN echo Running second task...

  • LOOP — Loop repetition structures.
  • DEFINE — Constant definitions.
Last updated on