Skip to content

Script Macros

MicroBlaster edited this page Sep 21, 2019 · 1 revision

IF

Usage:

IF (expression) ... ELSEIF ... ELSE ... END

Description:

This macro will write micro-commands to perform a standard 'if' comparison. All the commands under the 'IF' section of this structure will only be executed if the expression evaluates to true. The commands under the 'ELSEIF' will only be executed if the primary expression results to false, and 'ELSEIF' expression results to true. The commands under the 'ELSE' structure will only be executed if no other part of the structure has been.

Example:

IF ($x = "Hello") echo "Hello there!" ELSEIF ($x = "Bye") echo "Bye!" ELSE echo "I didn't hear you!" END

INCLUDE

Usage:

INCLUDE scriptname

Description:

This macro will include the code from another script or pack2 include file during compilation.

Example:

include "includemove"

WAITON

Usage:

WAITON text

Description:

This macro will write the commands to create a temporary TextTrigger. This can be used as a substitute for a waitFor command that will not be 'broken' if another trigger activates while the script is waiting for text.

Example:

waitOn "Command [TL="

WHILE

Usage:

WHILE (expression) ... END

Description: This macro will create a standard 'while' loop. All the commands within this loop will continue to be repeated until the expression evaluates to false.

Example:

setVar $x 1 WHILE ($x < 10) echo "Counting: " & $x & "*" add $x 1 END

Clone this wiki locally