Combat macro’s are the most important macro’s for me. For the time being, I am focusing on writing simplistic restoration druid casting macros, most notably mouseover macros. Healing is a lot easier if you can mouseover your target rather than needing to click through health bars. This is not a comprehensive summary of all macro’s, but a small portion of core commands and conditions that I am using frequently when writing my own macro’s. Wowwiki has a more comprehensive command list here.
The core of a macro looks like this:
/<command> [condition1, condition2, etc] spellname ; [condition1, condition2, etc] spellname
Several slash commands are available. I use the following combat slash commands:
/cast: Casts a spell listed in the spellbook
/startattack and /stopattack: toggles auto attack
/use <itemname> or <slot> or <bagslot> : Use an item by name, Itsuch as potions, flasks or bandages, by name or slot or bagslot.
/equip <item name>: equips an item by name
/dismount: obviously to dismount if mounted
Conditions are important and it’s often the place where my macro breaks. A condition (or the sum of all set conditions) must be true if the spell is to be cast. If all conditions aren’t met, the macro will continue onward to the next set of conditions and if there isn’t any, the macro will end without casting. It’s vital to get your conditions correct. Any condition usually has an opposite, such as combat vs nocombat, where ‘no’ negates the condition. If no conditions are mentioned, the spell will automatically cast. My favourite conditions:
[target=mouseover] – spell will be cast on mouseover target
[combat, nocombat] – evaluates combat status
[harm, help] – harm is true if your target is attackable and help is true if target is assistable
[nostance, stance, stance:0 – stance:6] very important as a shapeshifting druid. Nostance or stance:0 refers to normal stance, i.e. caster form as a druid, whilst stance:1 to stance:6 is each form as you count them from your druid shapeshifting bar. As a resto, I always remember stance:5, which is Tree of Life or Moonkin form. [stance] means the condition is true in any form.
[stealth, nostealth] – applies to rogues and cat form
[modifier, nomodifier, modifier:<shift,ctrl,alt>] – I don’t use modifiers much as it generally requires pressing two keys at once, but a lot of macro’s do and that creates the need to know about them.
[exists, noexists] – Returns true if the target or spell exists. Rarely useful to me, but used occasionally.
[dead, nodead] – Great for resurrection spells in particular.
A macro to cast Lifebloom on mouseover if the target exists:
/cast [target=mouseover,exists] Lifebloom; Lifebloom
Writing a macro can be easy. I just want my Lifebloom to be cast on mouseover rather than requiring a click. For changes that small and simple, just pick a slash command, add your conditions and finish with the spell name and you’re done.