OPie: Extended macros
Macros executed via OPie can make use of additional advanced functionality described on this page, and can be of arbitrary length.
Table of Contents
- Macro preprocessing
- Extended conditionals
- Muting error notifications
- Controlling automatic form cancellation
- Controlling macro feedback
- /runmacro recursion
- Secure value escape sequences
- Macro variables
Macro preprocessing
Custom macros are preprocessed to account for the abilities available to your character. When you edit a custom macro, recognized ability names in /cast-like commands are highlighted in blue, and are stored as {{spell:id}} tokens. When preprocessing the macro prior to use, these tokens are replaced by the corresponding ability name if the ability is known by your character, or removed from the macro if it is not. Commands where all arguments are removed in this fashion are removed from the macro, and empty macros are by default not displayed in OPie rings.
This makes it easier to write macros that adapt to your specialization or talent choices. For example, you could write /cast Heart of the Wild; Nature's Vigil; Feral Frenzy in a custom macro in order to cast the first of these abilities that your character knows, or /castrandom Heart of the Wild, Nature's Vigil, Feral Frenzy to cast a random known ability among those listed.
Available replaceable tokens
You can include the following special tokens within /cast-like commands in your macros:
- {{spell:id}}
- Replaced by the spell name corresponding to the specified ID if the player character knows a spell with that name. Ranks are typically omitted, causing you to cast the highest-known rank. You may specify multiple spell IDs separated by slashes; the spell ID that would produce output is used to do so.
- {{spellr:id}}
- Replaced by the spell name corresponding to the specified ID if that spell is known by the player character. Spell ranks are typically included, causing you to cast the rank corresponding to the given spell ID. You may specify multiple spell IDs separated by slashes; the spell ID that would produce output is used to do so.
- {{mount:ground}} (Modern-only)
- Replaced by an arbitrary ground mount.
- {{mount:air}} (Modern-only)
- Replaced by an arbitrary flying mount.
- {{mount:dragon}} (Modern-only)
- Replaced by an arbitrary dragonriding mount.
Additional castable actions
The /cast, /castrandom, and /use commands recognize certain additional abilities in custom macros. You can for example use:
- /cast Summon Random Favorite Mount
- /cast Summon Random Favorite Battle Pet
- /cast spell:768 to cast a spell by ID.
Extended conditionals
You may use extended macro conditionals and units in combination with any macro command or metacommand that accepts secure options (like /cast or #show).
For example, you might try:
/cast [form:cat] Prowl; Cat Form
/cast [@healer1] Innervate
Using secure options with other commands
You can use the #parse metacommand to cause the next line's slash command arguments to be parsed as secure options, even if the next command does not natively do this. If none of the option clauses apply, the following command is not executed.
For example, you could use secure conditionals in combination with /say to only send a message if a conditional is true:
/say [@target,exists] I have a target!
Muting error notifications
The #mute metacommand suppresses error notifications (like "Invalid target" or "Ability is not ready yet") and sounds until the end of the macro, or until an #unmute, whichever occurs first.
The #mutenext metacommand suppresses error notifications and sounds caused by the next command only.
For example, you might use when attempting to use cooldowns opportunistically:
/use 13
/use 14
/cast Presence of Mind
#unmute
/cast Pyroblast
/use 13
/cast Pyroblast
Controlling automatic form cancellation
The #nounshift metacommand temporarily configures the client to not automatically drop Druid forms in order to cast spells. It accepts extended secure options. If its argument evalutes to next, the auto-unshift behavior is suspended for the following slash command; if it evalutes to any other value, the auto-unshift behavior is suspended while the macro is running; if none of the conditional clauses apply, no change is made.
Due to a Blizzard restriction, on Modern WoW, this command only works while out of combat.
You might use this in a macro like the following, where the conditional prevents the player from exiting out of Cat Form if the Predatory Swiftness buff allowing an instant in-form Regrowth cast isn't active:
/cast [@player] Regrowth
Controlling macro feedback
You can use the #skip metacommand to indicate that the next command should not be used to provide feedback (icon, cooldown information) for the slice.
You can use the #important metacommand to indicate that the next command should be used to provide feedback for the slice with higher priority than it would ordinarily be.
For example, the following two macros provide a similar effect: despite /cast Presence of Mind appearing first, feedback for the slice will be based on /cast Pyroblast:
/cast Presence of Mind
/cast Pyroblast
#important
/cast Pyroblast
The #show and #showtooltip metacommands treated as a virtual /use command at the start of the macro, preceded by an #important metacommand. When used without arguments, #show and #showtooltip have no effect, as feedback is provided based on a macro's content by default.
In the background, each command in a macro is assigned a numeric priority value to determine what command in a macro will be used to provide feedback for the slice. Most command priorities are in the 0-100 range, with player abilities at 100, items at 90, and actions like equipping items or setting raid/world markers at lower priorities. By default, #skip reduces innate priority by ∞ (preventing the command from ever being used for feedback), while #important raises innate priority by 1000; you may customize both of these effects by providing a numerical argument to either metacommand.
The innate priorities allow the following macro to display feedback for Pyroblast rather than the trinket:
/cast Pyroblast
#icon, #iconb, #iconc
You can use the #icon metacommand to override the action-based icon assignment using macro conditionals, specifying an icon using either its filename (for icons in the Interface/Icons directory), a full texture path, or a fileID; or an atlas entry using its name. You may use secure command options and extended conditionals to specify the arguments to this metacommand.
For example, the following macro cycles through various cake icons depending on modifier state while using the Fireball spell for other feedback:
/cast Fireball
#iconb and #iconc metacommands accept the same arguments as #icon. These commands only change the feedback icon if there was no other source of icon feedback for the macro. If an icon is applied via #iconc, the macro will provide feedback that its action is not currently usable, which typically results in a dimmed icon being displayed.
#count
You can use the #count metacommand to override the action-based count feedback using macro conditionals, specifying an item name (or ID) to display the bag count of. You may use secure command options and extended conditionals to specify the arguments to this metacommand.
#label
You can use the #label metacommand to provide a short text label to display as part of the action feedback. This is typically used to display macro names. You may use secure command options and extended conditionals to specify the arguments to this metacommand.
/runmacro recursion
You can use the /runmacro command to trigger another macro created through the /macro interface by name.
For example, you might branch conditionally:
Secure value escape sequences [in Zeta 7 and later]
The following escape sequences are recognized in secure command option values, and in arguments to some conditionals:
- \\ → \
- \n → new line
- \l → [
- \r → ]
- \s → ;
- \c → ,
- \f → /
- \p → %
Note that using these escapes for Blizzard-provided macro conditionals, or in option values to Blizzard-provided commands that natively accept secure options, will not prevent syntax errors.
For example: [have:Thunderfury\c Blessed Blade of the Wind Seeker] is satisfied (out of combat, as [have] is a non-combat conditional) when you have Thunderfury, Blesssed Blade of the Wind Seeker in your bags, while [have:Thunderfury, Blessed Blade of the Wind Seeker] would have been interpreted as requiring two separate conditions: [have:Thunderfury] (which is not satisfied as there is no such item) and [Blessed Blade of the Wind Seeker] (which is probably not a valid conditional).
Macro variables
For commands accepting secure options, you may specify option values using macro variables, with variable values assigned using the /varset command.
For example, /varset nuke Frostbolt assigns the value Frostbolt to a variable named nuke; and /cast [mod] %nuke can then be used to cast Frostbolt.
You may specify a default value to use if the variable has not been assigned a value (or is an empty) after a colon, and this value may again be a variable reference. For example, you can write /cast [mod] %nuke:Frostbolt or /cast [mod] %nuke:%othernuke:Frostbolt.
The /varset name value command accepts secure options, e.g. /varset [mod] nuke Frostbolt; nuke Fireball. Variable names are case sensitive, must begin with a letter, and must only contain alphanumeric characters and underscores. Values are optional and can be any literal string, or a variable reference with optional default values as above. For example, /varset othernuke %nuke:Frostbolt sets othernuke to the value of the nuke variable or to Frostbolt if nuke was unassigned or empty.
Arguments to /!command macro extensions are parsed as secure options, and the value of the satisfied clause is temporarily assigned to the args variable while the extension runs. For example, if /!nuke is defined as /cast %args:Frostbolt, then /!nuke [mod] will cast Frostbolt (only while holding a modifier key), while /!nuke Fireball will cast Fireball (always).