Commands Syntax Reference

Jump to: navigation, search

HeroScript is primarily composed of Commands, Functions, and Methods. This page contains a quick reference to the commands.

Please click on the appropriate command to be taken to a page with more information.

Statement Description
ADD <front|back> <item> TO <list> Add an item to the beginning or end of a list. See List Information for more info
ASSERT Stop program execution if a condition is not true
CALL Initiate a remote call
BREAK Breaks out of a recurring LOOP structure
CLEAR Remove all elements from a list or lookuplist. See List Information
CONTINUE Continue with the next iteration of a LOOP, rather than running the rest of the commands in the loop structure
FOREACH A For/Next loop
GOTO Directs code execution to jump to the specified label
IF <condition> ELSE A conditional statement
INSERT Insert an item into a list. See List Information
LABEL Indicates where a GOTO may be directed
LOOP A repeating loop
MARSHAL Convert a value to string for transmission
PARTIALMATCH A branching logic statement for partial string matches
RANDOMIZE Sets a variable of type Enum to a random value.
REMOVE Remove an item from a list. See List Information
RETURN [<value>] (optional) Return to calling function, and pass a return value.
SORT Sort the elements of a list. Also see: List Information
UNMARSHAL Set a variable from the marshaled value.
VAR Variable declaration
WHEN IS Similar to a Case statement, branches dependent on values
WHERE Identify the class of a particular node
WHILE Create a conditional while loop

Deprecated Commands

deprecated-section There are some commands which were used early in development but have since been deprecated or substantially changed. They are listed here for reference, as the docs morph to match.

CHAIN <script> (for in-house use only) Additional scripts to check when a function is not found
DEF <var> as <type> (deprecated) Define a variable. Please see Defining Variables
INHERIT <script> (deprecated) Set a parent script
SET <var> to <value> (deprecated) Set a value in a variable. Please see the section on Assignment for more information.
STARTTIMER <timer field> (deprecated) Enables the specified timer. See the TIMER section for more info
STOPTIMER <timer field> (deprecated) Disables the specified timer. See the TIMER section for more info

See also

There are also various built-in and external functions which are accessed with a <functionname>(<arguments>) syntax. For a list of commonly used functions, please see the Function Index.

Personal tools