Command:/if
This command is added by MacroQuest
Notation | Description |
---|---|
Text without brackets or braces | Required items |
<Text inside angle brackets> | Placeholder for which you must supply a value |
[Text inside square brackets] | Optional items |
Vertical bar (|) | Separator for mutually exclusive items; choose one |
{Text | inside | braces} | Set of required items; choose one |
Ellipsis (…) | Items that can be repeated |
Syntax | /if <formula> {commands} [else {commands}] |
---|---|
Description | This will run all commands between the braces ( {} ) if formula evaluates to something other than 0.
numeric operations (eg. Using .Equal or .NotEqual).
numeric operations.
|
Options
Examples
/if (${Target.ID}) { /call Cast "Complete Healing" gem1 }
If (${Target.ID}) does not evaluate to zero (0), then cast the spell Complete Healing on current target.
/if (${Target.ID}) { /echo I have a target } else { /echo No target }
If (${Target.ID}) does not evaluate to zero (0), then write "I have a target", otherwise write "No target."
/if (${Target.CleanName.Equal[Banker Denton]}) { /echo Banker targeted } else /if (${Target.CleanName.Equal[Ward Toft]}) { /echo Ward targeted } else { /echo Banker or Ward not targeted }
If your current target is Banker Denton, then write "Banker targeted", else If your current target is Ward Toft, write "Ward targeted", otherwise write "Banker or Ward not targeted."