Scripts, Commands, & Flow
delegation
Syntax
/delegation {groups}
Use Case:
Sets or displays the groups of sessions that this session will delegate commands to.
Arguments:
- {groups}: Comma-separated list of session group names.
Examples:
- /delegation {healers,tanks}
- /delegation
See Also:
window, delegate
if
Syntax
/if {expression} {command_if_true} [{command_if_false}]
Use Case:
Executes a command if an expression evaluates to true (non-zero). Supports an optional else clause.
Arguments:
- {expression}: The condition to test.
- {true} : Command to run if true.
- {false} : Optional command to run if false.
Examples:
- /if {$hp < 20} {/echo DANGER} {/echo SAFE} (Echos status based on HP)
- /if {@connected()} {look} (Runs look only if connected)
See Also:
while, @if
loop
Syntax
/loop {start,end[,var]} {command}
Use Case:
Executes a command for each value in a specified range. Updates a loop variable for each iteration.
Arguments:
- {start,end}: The range (e.g. 1,5).
- {var} : Optional variable name (defaults to ‘LoopCount’).
- {command} : The command to run.
Examples:
- /loop {1,5} {get item $LoopCount} (Gets items 1 through 5)
- /loop {10,1,i} {/echo Blastoff in $i…} (Countdown from 10 to 1)
See Also:
while
math
Syntax
/math {variable} {expression}
Use Case:
Evaluates a mathematical expression and stores the result in a variable.
Arguments:
- {variable} : The variable name to store the result.
- {expression}: The math formula (e.g. 2 + 2).
Examples:
- /math {gold} {@math($gold + 500)} (Updates the gold variable)
- /math {counter} {$counter + 1} (Increments a counter)
See Also:
var, @math
showother
Syntax
/showother {session} {text}
Use Case:
Displays local text in another session’s terminal window without sending it to the server.
Arguments:
- {session}: Target session name.
- {text} : The text to display.
Examples:
- /showother {chat} {— System Message —}
See Also:
window
while
Syntax
/while {expression} {command}
Use Case:
Repeatedly executes a command as long as an expression remains true (non-zero). Includes a safety limit of 1000 iterations.
Arguments:
- {expression}: The condition to test.
- {command} : The command to repeat.
Examples:
- /while {$count < 10} {/math {count} {$count + 1};/echo $count} (Counts from 1 to 10)
See Also:
if, loop
window
Syntax
/window {windowName} {command}
Use Case:
Sends a command to a specific output window or another active session. The command will be evaluated by the target’s script engine.
NOTE: ** Procedures** and ** Aliases** are evaluated by the ** target’s** script engine. NOTE: ** Variables** are evaluated by the ** sender’s** script engine.
Arguments:
- {windowName}: The name of the target window.
- {command} : The command string to execute.
Examples:
- /window {CommLog} {/echo Hello!}
- /window {Combat} {kill target}
See Also:
session