You can use them to specify who the target will be, or to combine multiple spells into one button to take up less space, and more. This, in turn, declutters your screen and can take out several clicks between you choosing your spell and it landing where you want it to go!
To create a macro, type /macro to bring up your macro panel.
- The General Macros tab is available to all of your characters on your account.
- The macros you create in the Name-Specific tab are only going to be available to that specific character.
When you are done selecting a name and icon, click "OK." The text box at the bottom of the main macro window is where you will type in the commands for the macro itself.
A macro in its rawest form is written as follows:
That is the form that each spell or ability you take from your spellbook follows. The spellname must be typed exactly as it appears in your spellbook, though ranks can be omitted if you choose. From here, you have many choices on how to alter this simple spell cast. You can add specific requirements in [brackets] that tell the game specifically how you want it to handle that spell, and when to ignore it.
Modifiers are keys that act as a toggle, and include Shift, Alt, and Ctrl. You use a modifier key every time you toggle a letter between uppercase and lowercase! For a macro, these modifier keys are held while clicking on a macro in order for the game to cast the spell. You can specify the particular modifier key you wish to use, such as with [mod:shift], or you can use [mod] to let it respond to any of the three modifier keys.
|/cast [mod:shift] Lifebloom|
The game reads the above macro as “cast (if they are holding down the shift key when this macro runs) a lifebloom.” The game will not cast the spell if the shift key is not held down. What this means is that you can then add a second spell to the macro: a second spell that will be cast if the first spell is not cast. Different spells and actions are separated by a semicolon ;
|/cast [mod:shift] Lifebloom; Regrowth|
The game reads this macro as “cast (if shift is held) Lifebloom, else cast Regrowth.” You can add more spells and abilities by adding additional requirements for each spell to cast.
[combat] and [nocombat] are modifiers that tell the game to only use the following ability if you are in or out of combat, as applicable.
|/cast [nocombat] Flight Form; [combat] Travel Form|
The above macro will check first to see if you are out of combat, and if so, it will use Flight Form. If you are in combat, it will skip the first spell and use Travel Form (cheetah).
Now, since the combat requirement is a simple yes/no check (are we in combat, or aren't we?), if we know that the first action of [nocombat] is false, then the only other option is that you are in [combat] instead. Thus, we don’t necessarily have to write [combat] on the second spell, because if the game has passed by the first spell because the [nocombat] requirement was not met, then the only other option is that you are in combat. So,
|/cast [nocombat] Flight Form; Travel Form|
This macro will do the exact same thing as the previous macro. It doesn't really make a difference if you include [combat] with the second spell in this macro or not.
Targets can be chosen by use of the [target=x] parameter, where “x” may be any of the following: player, pet, pettarget, focus, focustarget, target, targettarget, party# (1-5), party#target, partypet#, partypet#target, raid# (1-40), raid#target, raidpet#, raidpet#target, mouseover, mouseovertarget, and none. These are not requirements for the spell to cast, but rather are directions for the game on how you want it to cast the following spell.
[target=none] will place the spell on your cursor, where you can then cast it on the next person you click.
Mouseover is particularly useful for being able to choose whatever target your mouse cursor is currently hovering over, be it a person or mob on the screen, or a unit frame or health bar.
|/cast [target=mouseover] Lifebloom|
The above macro will attempt to cast lifebloom on whoever you are currently hovering your mouse over. In order to use such a macro, you will need to keybind it to a keypress on your keyboard, since clicking it on your action bar means your mouse is hovering over the macro and not a person.
If a target direction is not included, then the game will cast the spell using the default targeting procedures.
Multiple requirements are separated by commas , and are all within the same brackets together; they must all be met in order for the game to cast the spell.
|/cast [nocombat,mod:shift] Flight Form|
This macro will cast flight form only if you are out of combat, AND you are pressing shift when you fire off the macro. You can use this to toggle between different actions that you may wish to use, like follows:
|/cast [nocombat,mod:shift] Flight Form; [nocombat] Mount Name; Travel Form|
If you are out of combat and pressing shift, then cast flight form; else if you are out of combat, use a mount; else cast travel form (cheetah).
You can combine requirements and directions in the same pair of brackets in order to specify how you want a spell to be cast if the requirements are met. There can only be one target= direction per bracket pair, however. The order of requirements and directions within the brackets does not matter, since all "requirements" in the brackets must be met in order for the spell to be cast with the given direction. For example,
|/cast [combat,target=mouseover,exists,dead] Rebirth; [dead,nocombat,exists,target=target] Revive|
- Combat, nocombat
- Stealth, nostealth
- Flyable, noflyable
- Flying, noflying
- Swimming, noswimming
- Exists, noexists
- Dead, nodead
- Mounted, nomounted
- Help, nohelp
- Harm, noharm (simple opposite of the above, same idea)
- Modifier:x or Mod:x (where x is shift, alt, or ctrl)
- Modifier, Nomodifier or Mod, Nomod (Any modifier is held, or none at all)
- Stance:x or Form:X (where x is the number of your stance, 1-6. The number usually corresponds to the order in which you learned the stances. Bear form, for example, is stance:1)
- Stance, Nostance or Form, noform (any stance, or not in any stance. Nostance is typically viewed as caster form)
- Button:x or btn:x (where x is the mouse button number that was used to click the spell. Typically, left-click is 1, right-click is 2, and the scroll-wheel is button:3)
- Spec:x, nospec:x (where x = 1 for your primary spec, and 2 is your 2nd spec)
- Equipped:x or Worn:x (where x is an item name or item ID)
- Actionbar:x or Bar:x (where x is the number of the action bar that the macro is on)
You can also create different sets of requirements for the same spell by adding additional [bracketed requirement lists], like follows:
|/cast [target=mouseover,exists,help] [target=target,exists,help] [target=player] Lifebloom|
This macro will first attempt to cast lifebloom on the target you are currently mousing over, if they exist and they are friendly. Else, it will cast it on your current target, if you have a target and they are friendly. Otherwise, it will cast lifebloom on yourself. This is the same idea as if you had written the macro as
|/cast [target=mouseover,exists,help] Lifebloom; [target=target,exists,help] Lifebloom; [target=player] Lifebloom|
...it’s just much shorter, which can be important since macros have a 255 character limit.
The important things to keep in mind are:
- The order you put the spells in; the game will use the first spell it comes across in the macro that it is allowed to cast based on the requirements you gave.
- The game cannot cast multiple spells at the same time if each sets off a global cooldown (GCD). There are a few spells which do not set off a GCD, so these CAN be tied to cast at the same time as another spell.
|/cast Nature's Swiftness|
/cast [target=mouseover,exists,help][target=target,exists,help][target=player] Healing Touch
Other Slash Commands
The /cast is a slash command for casting. Additional /commands exist that can include their own requirements or do unique things. Many you will find familiar from using them in your chat box.
- #showtooltip (adds the tooltip of the spell the macro will cast under the current conditions. Specific Spellnames can be given)
- #show Spellname (shows the icon for the given spell. If no spell is given, it shows the first available spell in the macro. Useful for monitoring cooldowns.)
- /castsequence reset=n Spellname1,Spellname2,Spellname3 (after casting the first spell, the next time you press the macro it will cast the next spell in the sequence. It will reset to the first spell after n seconds. Replace n with the number of seconds. Alternatively, you can tell it to reset on combat)
- /use Itemname
- /use # (uses item equipped in the numbered slot on your person)
- /use 13 (uses top trinket)
- /use 14 (bottom trinket)
- /use 16 (weapon click-use)
- /use # # (uses item located in bag #, slot #)
- /use 0 1 (uses the toprightmost item located in your backpack)
- /equip Itemname
- /equipslot # Itemname (specifies slot when equipping the item)
- /s (talk in the say channel)
- /p (party)
- /ra (raid)
- /rw (raid warning)
- /target [requirements] or /tar
- /assist or /a
- /cancelform (takes you out of stance to your default caster form)
- /cancelaura BuffName (cancels a buff from your buffbar)
- /stopcasting (will stop whatever is currently casting)
- /stopmacro [requirements] (ignores the rest of the macro if requirements are met)
- /script or /run (a special command that is far more advanced, using different rules for its requirements)
A very complex macro can look like this:
/focus [mod:shift] target
/cast [form:3,nostealth] Mangle - Cat; [stealth] Pounce; [noform:1] Wrath
The above macro does the following:
- Clear the current focus target if shift is held.
- Then focus on the current target if shift is held.
- Then stop the macro if shift is held and read nothing else below this line; do not stop if shift is not being pressed.
- Then assist the focus.
- Then enable auto-attack if not in stealth.
- Then cast Mangle – Cat if in form:3 (catform) and not in stealth; else cast Pounce if in stealth; else cast wrath if not in bear form.
Other macros I use will be added in another post at a later date.