Syntax

Command Description Return Value
Random <value> Generates a random number from 0 to value A random number
Random {<value1>, <value2>} Generates a random number from value1 to value2 A random number

Abbreviation

RAND

The Random command to generate a random number. Use the Random command in CueScript expressions or commands to introduce randomness.

The Random command comes in two forms. If a single number is specified, a random number from 0 through that number (inclusive) will be returned. If an array of two numbers are specified, a random number from the first number through the second number (inclusive) will be returned.

When using the Random command as a substitution for a single parameter to another command, it must be enclosed in parenthesis. This is because the random command needs to be evaluated as if it is an expression, so the result of the expression is substituted into the outer command properly. See the examples below for clarification.

Examples

Random 5
Returns a random number from 0 through 5.

Random {10,20}
Returns a random number from 10 through 20.

Macro (Random{5,8})
Executes a random Macro from 5 through 8.

Cue (Random{1,4}) Go
Executes a random Cue from 1 through 4.

Channel 1 At (Random{50,100})
Sets Channel 1 to a random value from 50 through 100.