Macros
• "Work it harder, make it better, do it faster, makes us stronger." - Daft Punk
• Under normal circumstances, clicking or keying an action button will cast one particular spell or use one particular item every time. And that's it. Macros introduce a limited amount of spell and target selection, action bundling, and input handling. A bit of programmed intelligence for your buttons.
Action Bundling
Each time you click a macro, at most one global cooldown-causing action can be performed along with any number of things that don't trip the global cooldown. Text messages work well:
/cast Resurrection
/say No napping allowed. Back to work, %t!
• The easiest way to include spells in a macro is to open your Spellbook and macro editor at the same time, then Shift click on the desired spell. Spell name and rank will be automatically filled in with proper formatting. Notice that I removed the Resurrection rank above. This makes the macro automatically use your highest trained rank; or the highest rank for which your target is eligible if it's a single target buff. The "%t" signifies the name of your current target.
Undead Priests frequently combine Inner Focus and Devouring Plague since the latter has a high mana cost and both have three minute cooldowns. Inner Focus is one of the few spells which does not trip the global cooldown:
/cast Inner Focus
/stopcasting
/cast Devouring Plague
• This is a little weird since both are instant spells and both will take place during the same instant. The "/stopcasting" line is a workaround for WoW not liking two spells cast at the same time. You only need it between any two "/cast" lines, not in other cases like the Resurrection macro above. An advanced use of /stopcasting is to use it in a two line macro with something like Silence in the second line. This way, if you're more than 1.5 seconds into a cast, the Silence macro will cancel that cast and kick off its own immediately.
There is a way to cast multiple global cooldown spells with one macro, but the macro will have to be clicked for each spell and you can't cheat the cooldown. For instance, a Shadow Priest might like to click one button several times to start a grinding sequence:
/castsequence reset=target Vampiric Touch, Shadow Word: Pain, Vampiric Embrace
• The "reset=target" option causes the sequence to start over when you switch targets. "reset=combat" would make it start over when you leave combat. "reset=10" would make it start over after 10 seconds. You can leave out the reset option entirely for reliable full cycling. Spells can be repeated for a long damage rotation sequence.
Spell Selection
Once upon a time, macros could do crazy things for spell selection like choose a healing spell rank based on target hitpoints. Those days are over but there still are a very limited set of things which can be checked. E.G. whether you are already channeling Mind Flay (or maybe Starshards):
/cast [nochanneling] Mind Flay
• Brackets are conditionals. Attaching a 'no' before any allowed conditional reverses it. So this works out to, "If not channeling, cast Mind Flay." No need to worry about stepping on your last Mind Flay ever again with this macro.
The last example either cast Mind Flay or did nothing. You can list multiple spells with conditionals and a macro will cast the first one with a true condition:
/cast [harm] Smite; Power Word: Shield
I use this and bind it to my 'E' key so that if I'm targeting a harmful (red or yellow tooltip) unit I will cast Smite, otherwise I'll cast Shield. Note that semi-colons are used to separate such spells. I could have written it:
/cast [help] Power Word: Shield; Smite
Which can be read, "If I'm targeting a friendly unit cast Power Word: Shield, otherwise Smite!" But consider what happens if I'm not targeting anything at all and you'll see why the first version is better. There really aren't many other conditionals available, but Shadowform is considered a type of Stance which allows:
/cancelaura [stance:1] Shadowform
/cast [nostance] Flash Heal
Stances are numbered and Shadowform is '1' for Priests. [nostance] is true whenever we're not in Shadowform. This macro can be read, "If in Shadowform, cancel Shadowform. If not in Shadowform, cast Flash Heal." Clicking this macro twice when in Shadowform will first drop it, then start you healing. The other useful conditional for Priests checks if you are in combat:
/cast [combat] Fade; Shadowmeld
Input Handling
This is really just another type of conditional based on mouse and keyboard state instead of in-game situation. If you want to cut action bar slots that buffs take up in half:
/cast [button:1] Power Word: Fortitude; [button:2] Prayer of Fortitude
• Which casts the single target version if you click the macro icon with your left mouse button, or group version with a right mouse click.
/cast [modifier:shift] Mind Blast; Shadow Word: Death
• Usually casts SW:Death, unless shift is being held down at the time. This style works well with keybound macros.
Target Selection
A special-case conditional called 'target' isn't really a conditional at all, but a way to tell the macro what to target. Specifying a target in a macro doesn't switch your selected target.
/use [target=player] Heavy Netherweave Bandage
• Read as, "Use a Heavy Netherweave Bandage on myself." 'player' is shorthand for the casting player, yourself. As you can see, the /use command will use consumables and activatable items by name. See links below for information on how to use items by equipment or bag slot.
Since I use macros heavily anyway, I prefer to handle alt self-casting for my heals and buffs like this:
/cast [modifier:alt,target=player] Flash Heal; Flash Heal
Which reads, "If Alt is held down, cast Flash Heal on myself. Otherwise just cast Flash Heal." Now you're ready to see the kind of macros I actually use:
/cast [modifier:alt,target=player] Power Word: Shield; [harm] Smite; Power Word: Shield
These things can be as simple or as complex as you require. Instead of casting a damage spell if you're targeting a hostile, what about casting a healing spell on the hostile's target?
/cast [harm,target=targettarget] Greater Heal; Greater Heal
Which reads, "If my target is harmful, cast Greater Heal on my target's target. Otherwise, just cast Greater Heal."
Advanced Targeting
/cast [target=mouseover] Dispel Magic
• Will cast Dispel Magic on any unit your mouse pointer is 'hovering' over even if it's not your target. Combined with a keybinding, very useful for patching up allies while continuing to target the tank.
'Focus' is a special target that you can set and refer to later. I bind a key to "Focus Target" but "/focus" in a macro by itself would also work. Once it's in place, the most simple way to use it is:
/cast [target=focus] Shackle Undead
There are more elaborate versions in the links below. Hope I've helped you see a few small ways to start fiddling with'm.