concepts:macros:macro_variables
Macro Variables
Macro variables are variables that are local to a particular macro on a particular node. Unlike the more complex variable system that sits under zones, they are simply represented by name/value pairs, like:
thisVar=cheese
They can be set one of three ways:
- From within the macro using #setlocal or #inclocal
- Using the command node_macroset
- When a macro trigger is received with a list of equality statements after it in square brackets. For example:
node_macrorun: mynode | mytrigger[var3=foo, var4=bar]
would set those two variables and then run the macro.
Variables are created by setting a value; they cannot be deleted without clearing the macro.
Variables can then be referred to using the same interpolation system used by variables. Local variables are interpolated as the macro is run before the command is passed to the command parser - so macro variables can reference zone variables and dynamic_objects, but not the other way around.
Note that as local variables, they cannot be referenced from outside their containing macro.
concepts/macros/macro_variables.txt · Last modified: 2024/09/20 07:47 by 127.0.0.1