TLO:If
Performs Math.Calc on conditions, gives whentrue if non-zero, gives whenfalse if zero. Warning: The `If` TLO was made for macros, not recommended Lua.
This TLO is added by MacroQuest
Forms
Type | Member | Description |
---|---|---|
string | If[conditions,whentrue,whenfalse] | |
If[conditions~whentrue~whenfalse] |
Access to Types
Type | Description |
---|---|
string | A string is an array of characters. In MQ there is no single character datatype, so any variable or expression that contains text is considered a string. |
Examples
/docommand ${If[${Me.Sitting},/stand,/echo I am not sitting down]}
If I am sitting, stand up, Otherwise echo "I am not sitting down".
/docommand ${If[${Me.CurrentHP}<50,/cast "Gate",/goto :Continue]}
If my hp percent is below 50 cast the Gate spell, otherwise goto the :Continue label.