Supported In:
? ? ?

The scripting command GotoRandom has the opcode (0x38).


  • n (byte) - the number of supplied line numbers
  • Array of bytes (byte * n) - each a one byte line number


This operation randomly jumps to one of any number of predefined line numbers in the current event. It is essentially a 'goto' operation which transfers execution a randomly-selected line from the array of supplied line numbers.

For example, if the supplied arguments were "03 05 09 1A", the first byte indicates that there are three possible jump locations and that the jump locations are lines 5, 9, and 28 (0x1A).


The theoretical maximum number of potential line numbers that could be supplied is approximately 250, however this is not an issue as the maximum number of lines that make up an event is limited to 255, due to the way the event data is stored.