User Tools

Site Tools


concepts:macros:parser_directives

Macro Parser Directives

Parser directives are commands that can only be run from within macros.

They all need to start with # and are used for controlling the flow of commands:

#label: <label name>

A label that can be used by the jump commands as opposed to a delay target

#halt:

A parameter-less command that halts the macro

#haltif: <condition1> | <condition2> | etc…

Halts if all the supplied conditions are true; in this case, commas can't be used to separate conditionals

#haltifany: <condition1> | <condition2> | etc…

Halts if any the supplied conditions are true; in this case, commas can't be used to separate conditionals

#jump: <delay/label>

Jumps to a delay time or label within the macro - the latter is more precise as it allows you to pick a position in simultaneous commands

#jumpif: <delay/label> | <condition1> | <condition2> | etc…

Like #haltif, a conditional jump command; in this case, commas can't be used to separate conditionals

#jumpifany: <delay/label> | <condition1> | <condition2> | etc…

As above, but jumps if any of the conditions are true; in this case, commas can't be used to separate conditionals

#setlocal: <statement1>, <statement2>, etc…

Applies an arbitrary number of equality statements1) to the macro, setting local variables - a pipe (“|”) separator can be used in this case.

#inclocal: <variable> | <value>

Increments a local variable by the integer value = assuming the variable and the value can be parsed as an integer.

1)
So, something like: #setlocal: var1=true, var2=green
concepts/macros/parser_directives.txt · Last modified: 2024/09/20 07:47 by 127.0.0.1