Difference between revisions of "TRIG-SET"
From 4Dimensions
(Bot: Automated import of articles) |
m |
||
Line 1: | Line 1: | ||
'''TRIG-SET''' | '''TRIG-SET''' | ||
[[Category:Help Files]] | [[Category:Help Files]] | ||
− | + | [[Category:Building]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Usage: set <variable> <value> | Usage: set <variable> <value> |
Latest revision as of 11:27, 14 July 2017
TRIG-SET
Usage: set <variable> <value>
Set sets variable to value, without evaluating it.
Example: set foobar 15 - 5
sets the variable foobar to the string "15 - 5"
- this example sets the value of result to '%self.hitp% * 100 / %self.maxhitp%'
set result %self.hitp% * 100 / %self.maxhitp%
- The %result% var now works as a 'function' every time it's accessed.
say My hitpoint percentage is %result% %damage% %self% 30
say My hitpoint percentage is %result%
The set command is used to set (or create) the specified variable equal to
the provided expression, which will be evaluated when the variable is accessed.
There also exists an "eval" command, with the same syntax. Eval differs in that
the expression is evaluated immediately.
See Also: EVAL