Macro: A macro is a small script that is used to combine several actions in a single button, with the potential for a (limited) amount of intelligent choice without player input.
Macros are divided into two sets; General Macros, which are shared across your entire account, and Character-Specific Macros, which are useable by your current character only. Each set has a limit of 16, for a total of 32 potential macros, and each macro has a 256-character length limit.
Creating a Macro in World of Warcraft is easy! Just hit the Escape key until the Game Options menu appears, and then to click on the Macros button. Click the "New" button in the bottom of the Macros pane, pick the icon you want your macro to use as well as the name and you're all set to start writing!
For our example we're going to create a simple macro that will use a /say command to talk and also use an emote action. Name your macro "Hello World" and pick whichever icon you want, then hit okay. Click on the text-box in the bottom of the Macro pane and type the following;
/say Hello, world! /danceDrag the macro onto your action bar and hit it, and you'll tell the world hello and start dancing. Congratulations, you've just made your first macro! Yes, it really is that easy.
Macro Commands are useful slash-comamnds you can put into macros (or your chat bar!) to make the game perform certain actions for you. Combined with macro conditionals you can create useful macros to perform a wide variety of tasks for you.
|Casts the ability, item or spell
|/cast [Conditonal] First Spell; [Conditional] Second Spell
|Identical to /use
|Casts the ability, item or spell
|/use [Conditional] First Spell; [Conditional] Second Spell
|Identical to /cast
|Casts the abilities in order, then repeats
|/castsequence reset=ResetFunctions [Conditional] First Spell; Second Spell
|Can use reset= to determine when to return to the first ability
|Casts a random ability
|/castrandom [Conditional] First Spell; Second Spell
|Stops the macro
|Useful for creating if->then sequences
|Targets the named unit
|Switches your target to your target's target
|Switches your target to your previous target
|Clears your target
|Focuses your target
|Clears your focus target
|Targets your closest enemy
|Functionally identical to tab-target
|Targets your closest party member
|Targets your closest raid member
|Equips the named item
|/equip Name of Item
|Equips the named item in the selected slot
|/equip # Name of Item
|Full list of item slots
|Cancels the named buff
|/cancelbuff [Conditional] Buff Name
|Cancels your current form
|Primarily used by Druids to return to Caster form
|Cancels your current mount
The heart and soul of most macros, the Cast and Use commands allow you to use spells, abilities and items when the conditionals are met. There is no limit to the number of conditional checks the /cast command can make, but it will stop at the first ability it sees that passes the conditional checks to use it.
A very powerful but limited function, Cast Sequence allows you to tell the macro to use different abilities in a certain order. Unlike /cast, there is only a single conditional check at the start of the macro; the command will not allow you to bypass parts of the sequence if certain conditions aren't met. More to the point, it will 'freeze' on each step until that step can be completed, rather than bypassing it. If one ability has a cooldown or is event triggered (such as Overpower) then it will hang on that step of the sequence until it can perform that command.
This is partially mitigated by the ability to use the reset= tag, which will cause the castsequence to go back to square one on certain events - target for target changes, combat for when you leave combat, or simply a number for a certain number of seconds. These can be combined; for example, 'reset=target/combat/3' will reset the macro to step 1 if you change targets, leave combat or more than three seconds pass without it being activated. Unfortunately, though, the time-based reset of the Castsequence button goes off how much time has passed since you hit the button, not since it last cast an attack in the sequence. The 'idle timout' instead of an active timer, combined with the other restrictions on Cast Sequence, make it much less valueable than it could be; as it is, though, the tool is extremely useful, especially for Hunters trying to perfect their shot rotation.
A simple function, this will randomly use one of the abilities in its list every time you use the button. Like castsequence, only one conditional check is allowed - it will either pick any one of the random choices, or none at all. Useful for brute-forcing events or for performing a random action, like selecting a different mount for you to use each time.
If this command passes its conditional checks, it will stop the macro from proceeding any further. This can be used in lieu of constant conditional checks to create an If->Then functionality, as without failing the Stop Macro's conditions nothing further in the macro will be accessed.
These commands are used to modify your current target or focus target. The /targetparty/raid/enemy commands are functionally identical to tab-targetting.
These commands are all used to cancel certain buffs. You can, in fact, use /cancelbuff Black War Raptor in order to cancel your mount (or /cancelbuff Dire Bear Form), but the /cancelform and /dismount functions will always choose your shapeshift or mount to remove. /dismount is especially handy with a random-mount macro.
Macro Conditionals are used to establish the parameters within which the commands you use will activate. For example,
/cast [harm] Shadow Word: Pain; [help] Power Word: Shield
Will cast Shadow Word: Pain if your target is unfriendly, and Power Word: Shield if your target is friendly. All conditionals can also be inverted with a prefix of no - for example, [harm] (is my target unfriendly) and [nohelp] (is my target not friendly) are functionally identical.
|Changes the target of your conditional/command to a different unit
|Not a true conditional, but a modifier
|TRUE if target is hostile
|TRUE if target is friendly
|TRUE if your target exists (i.e. if you have one)
|TRUE if your target is dead
|TRUE if your target is a member of your party
|TRUE if your target is a member of your raid
|TRUE if your target is a member of your party or raid
|Can be used without a type to return true for either parties or raids
|TRUE if you are in the given stance or shapeshifting form
|Complete list of stances, can be used without a # to check if you are in any stance/form
|TRUE if you are stealthed
|TRUE if you are in combat
|TRUE if you are channeling the named spell
|Can be used without a spell to determine if you are channeling a spell at all
|TRUE if the selected modifier is pressed
|Valid modifiers: shift, ctrl, alt
|TRUE if that button was used to activate the macro
|Using a keybind is considered the same as a left-mouse click (1)
|TRUE if the given item is equipped
|TRUE if the given pet's name or type matches your active pet
|TRUE if you are riding your mount
|Not that kind of mounted
|TRUE if you are on a flying mount
|TRUE if you are swimming
|TRUE if you are in a location where you can use a flying mount
|TRUE if you are indoors
|TRUE if you are outdoors
|Your focus target
|Your current pet
|The #'th member of your party
|1-4 valid; player is excluded
|The #'th member of your raid
|1-40 valid; player is included
|The unit frame you mouseover'd
|Current or most recent
|The #'th member of your party's pet
|1-4 valid; player is excluded
|The #'th member of your raid's pet
|1-40 valid; player is included
Target is not a true conditional, but a modifier for the macro. By default, all targeted conditionals are evaluated on your current target and if true spells will be used against your target (if applicable). By using the target modifier, though, you can change the target of the macro - [target=focus] will reevaluate all conditionals based on your focus, [target=self] wlll use the player as the target, and <target=pet> will use your own pet. Additionally, you can add any number of "-target suffixes; <target=focustargettarget> will target your Focus's Target's Target. Any valid UnitID (see table) can be used with the target command.
All targeting conditionals can be redirected with the target= function. By default, however, they evaluate against your current target.
All personal conditionals cannot be redirected with the target= function, and will always evaluated based off your current status.
A subset of personal conditions, these also cannot be redirected with the target= function and will always be evaluated based off your current status.
There are quite a few ways to use macros /use items in macros.
The current list of inventory slots and their numbers are as follows:
When selecting the icon for your macro to use, if you select the '?' icon the macro will use the icon of the ability it would use in that situation. Extremely useful for Castsequence macros, because it will update at each step to give you a visual indication of where in the sequence the macro is, and just plain useful.
The special #show and #showtooltip functions let you further customize the appearance of your macro. #show lets you change the appearance of the macro to mirror another spell, ability or even an item, such as a Prayer of Fortitude macro displaying the number of Sacred Candles remaining in your inventory. #showtooltip is identical to #show, except it also changes the tooltip of the macro to match whatever you put behind it. Additionally, you can leave the area after #show or #showtooltip blank to have it show the name/tooltip of the top macro function, similar to how the ? icon works.
See useful macros