ADD
Syntax: #AD varname value
This command is included for backwards compatibility. The easier way to perform addition is via the normal variable assignment:
varname = @varname + value
When using the #ADD command, do not specify the @ character at the beginning of the variable name.
The value is added to the current value of the variable varname. If amount is not numeric, an error occurs. amount can also be a reference to another variable, adding its current value to the value of the listed variable. To subtract a value, use a negative amount.
ADD example
#ADD moves 1
Add one to the @moves variable
moves = @moves + 1
same as the above
#ACTION {You get (%d) coins} {#ADD gold %1}
When you pick up some coins, add their value to the @gold variable. |