Home Death Knight Druid Hunter Mage Paladin Priest Rogue Shaman Warlock Warrior
 

Conditionals

Now you'll get to see the complete list of conditionals and what they mean. Each conditional will be treated more thoroughly below.

Complete list

Below is the entire list of conditionals that are available to the macro system. One of the goals in the 2.0 patch was to eliminate a lot of old "smart buttons" that allowed people to essentially play the entire game spamming one key repeatedly. However, many tasks people used macros to simplify were deemed OK and given Blizzard's blessing via the macro options.

If you don't see a condition listed here, then there is no way to check for it and take a combat-related action. These are essentially non-negotiable though they may be augmented in the future.
help - Can cast helpful spells on the target
harm - Can cast harmful spells on the target
exists - Target exists
dead - Target is dead
stance:0/1/2/.../n - In a stance
stealth - Stealthed
modifier:shift/ctrl/alt - Holding the given key
button:1/.../5/<virtual click> - Macro activated with the given mouse button
equipped:<item type> - item type is equipped (item type can be an inventory slot, item type, or item subtype)
channeling:<spell name> - Channeling the given spell
actionbar:1/.../6 - Given action bar page is selected
pet:<pet name or type> - The given pet is out
combat - In combat
mounted - Self explanatory
swimming - Self explanatory
flying - Mounted or in flight form AND in the air
flyable - In a zone where flying is allowed
indoors - Self explanatory
outdoors - Self explanatory
party - Target is in your party
raid - Target is in your raid/party
group:party/raid - You are in the given type of group
help & harm

These two have been covered fairly thoroughly so far. I can't really think of anything to add right now, but I will leave this section here for completeness.

exists

This determines whether the given unit exists. In other words, if you don't have a target, [exists] will return false. If you have a focus, [target=focus, exists] would be true. Note that in some cases [exists] is unnecessary. [help], [harm], [dead], [party], & [raid] all imply [exists] if they're true.

dead

If you have a target and it's dead, this will be true.

stance:0/1/2/.../n

Stance is the generic term used for Warriors', Druids', Rogues' (Stealth), Priests' (Shadowform) and Shaman's (Ghost Wolf) forms. Stances are only applicable to situations where certain abilities are only usable in specific forms. Because of this, Paladin auras (despite being on the shapeshift bar) and Hunter aspects are NOT considered stances.

The simplest form of [stance], as mentioned previously, means that you are in any stance whatsoever. It is equivalent to [stance:1/2/3/.../n] where n is the number of stances you have. [stance:0] is equivalent to [nostance] so you can use a conditional like [stance:0/3] to evaluate as true if you are either in stance 3 or not in any stance.

The stances themselves are ordered the same way as they appear on your shapeshift bar. So a Druid with Bear, Aquatic, Cat, & Travel forms would have stances 1 through 4. Here is a simple chart to help you remember stance numbers (thanks Neuro :P):
| Warrior | Druid | Priest | Rogue | Shaman ---------+-----------+---------+------------+---------+---------- Stance 1 | Battle | Bear | Shadowform | Stealth | Ghostwolf Stance 2 | Defensive | Aquatic | | | Stance 3 | Berserker | Cat | | | Stance 4 | | Travel | | | Stance 5 | | MK/ToL | | | Stance 6 | | Flight | | |
Note: if a Druid is missing a form, all the higher-number ones will be shifted upwards on the chart.

Example:
/cancelform [nostance:0/1/3] /cast [stance:1/3] Faerie Fire (Feral)(); [nostance] Faerie Fire
In Bear and Cat forms, this will cast Faerie Fire (Feral). In caster form, it will cast Faerie Fire. In any other stance, running the macro will return you to caster form. Note that after patch 2.3, /cancelform will register instantly so it will immediately cast Faerie Fire after leaving a form.

stealth

While the Rogues among you may find this redundant since [stance] behaves the same way, [stealth] also applies to Night Elves' Shadowmeld, Mages' Invisibility, etc.

modifier:shift/ctrl/alt

Modifier keys are a convenient way to save action bar space and make certain decisions. Say you want an implied targeting macro but use one spell normally and another spell when you're holding down a modifier key:
/cast [modifier, help] [modifier, target=targettarget, help]
Flash Heal; [help] [target=targettarget] Greater Heal
This macro will cast a helpful spell on either your target if it's friendly, or your target's target otherwise. When you hold any modifier key, it will cast Flash Heal. Otherwise it will cast Greater Heal.

Of course, you can specify particular modifier keys for more control a la [modifier:shift/ctrl] which means "shift or control." If you want to specify both, you need two modifier conditionals: [modifier:shift, modifier:ctrl].

Beware if you're using key bindings for your macros. If you bind A to a macro with, say, [modifier:shift] and you have something else bound to SHIFT-A, the SHIFT-A binding will take precedence and your macro will not run.

Modifier variables

While modifier keys can only be one of shift, ctrl, or alt, there are a number of system variables that you can use in your modifier conditions as well. For instance, the SELFCAST variable means "whatever your self-cast modifier is set to." The default is alt (holding the alt key while casting a spell will attempt to cast it on yourself) though some addons give you the option to change this. If you create a macro like:

/cast [modifier:SELFCAST, target=player] [target=mouseover] [ ] Greater Heal
It will work as expected no mater what you have set as your self-cast key. Some other variables and their defaults (though with arguably much less utility) are as follows:
AUTOLOOTTOGGLE (shift)
STICKYCAMERA (ctrl)
SPLITSTACK (shift)
PICKUPACTION (shift)
COMPAREITEMS (shift)
OPENALLBAGS (shift)
QUESTWATCHTOGGLE (shift)
button:1/2/.../5/<virtual click>

Similar to [modifier], [button] allows your macro to respond differently based on which mouse button is being used to activate the macro. Button numbers 1-5 correspond to left, right, middle, button 4, & button 5. If your macro is activated by a key binding, [button:1] will always be true. As an example, here is the macro I use for mounting:
#show Swift Green Mechanostrider /userandom [nobutton:2, flyable, nomounted] Ebon Gryphon;
[nomounted] Black Battlestrider, Swift Green Mechanostrider /dismount [noflying] [button:2]
Behavior when not mounted: left-clicking will pick Ebon Gryphon if it can be used (flyable), otherwise it will randomly pick the Black Battlestrider or the Swift Green Mechanostrider. Right-clicking will always pick one of the mechachickens.

Behavior when mounted: left-click will only dismount if not flying. Right-click will always dismount.

The "virtual click" can usually be ignored, but if you use a bar mod it can be useful. Action bars that respond to various state changes translate clicks to virtual ones that determine which action to use. Because these virtual clicks are addon-specific, I'm not going to go into any further detail here.

equipped:<item type>

[equipped] allows you to determine if a particular type of gear is equipped. The item type can be an inventory slot name, an item type, or an item subtype. See http://www.wowwiki.com/ItemType and http://www.wowwiki.com/API_TYPE_InventorySlotName for lists of these types. Here is the macro I use to pick Shield Bash or Pummel depending on what I've got equipped:
#show [equipped:Shields] Shield Bash; Pummel /cast [equipped:Shields,stance:1/2] Shield Bash;
[equipped:Shields] Defensive Stance; [stance:3] Pummel; Berserker Stance
The #show line is used to make it show either Shield Bash or Pummel. Without it, it would show the stance spells as well, when applicable. Here's some pseudocode that illustrates how the second line works:
if a shield is equipped and I'm in Battle or Defensive stance then /cast Shield Bash else if a shield is equipped then /cast Defensive Stance else if I'm in Berserker stance then /cast Pummel else /cast Berserker Stance
Here's another macro that lets you cast Overpower with a bit more vigor:
/equip [noequipped:Two-Handed Axes] Crystalforged War Axe /cast [nostance:1] Battle Stance; [equipped:Two-Handed Axes] Overpower
channeling:<spell name>

Normally, if you are channeling a spell and begin casting another spell, it will cancel the channel. This option allows you to keep that from happening, and also has a few other uses. For instance, maybe you do want to cancel one particular spell but not another. [channeling] alone matches any spell and you can also list an arbitrary number of spell names to check.

Note: channeling is NOT the same as casting. The [channeling] conditional only applies to spells like Arcane Missiles, Drain Life, Mind Flay, etc. where after the initial cast, the spell makes its effect over time.

actionbar:1/.../6

The default UI provides a number of action bar pages. These pages only affect the lower left action bar that is visible by default. Luckily, you can make macros that respond to different action bar pages and place them on the other action bars. One example is for a hunter to emulate stances using their aspects:
/swapactionbar 1 2 /cast [actionbar:1] Aspect of the Hawk; Aspect of the Monkey
This macro will switch between action bars 1 and 2. When it switches to bar 1 it casts Aspect of the Hawk, and when it goes to bar 2 it casts Aspect of the Monkey.

pet:<pet name or type>

Every class with a pet should find this one useful. It allows you to choose an action based on which pet you have out. You can specify your pet's name or your pet's type (Voidwalker, Boar, Imp, Wolf, etc.). [pet] by itself matches any pet. For example, a Mage can choose between their elemental's Freeze spell or their own Frost Nova:

/cast [pet] Freeze; Frost Nova
combat

True if you are in combat.

mounted, swimming, flying, indoors & outdoors

These are all fairly self-explanatory. They all apply to you, the player.

flyable

As briefly mentioned above, [flyable] determines whether you are in the Outland where you're allowed to use a flying mount.

party & raid

These return true if the target is in your party or raid, respectively.

group:party/raid

This lets you determine whether you are in the given group type. [group] is equivalent to [group:party]. [group:raid] implies [group:party]. This can be useful for buffing classes. For example:
/cast [group, nomodifier] Arcane Brilliance;
[help] [target=player] Arcane Intellect
If you're in a group it will normally cast Arcane Brilliance. If you're holding a modifier key or you're solo, it will cast Arcane Intellect on a friendly target or yourself.

   
WoW Power Leveling & Cheap WoW Gold Service,24/7 Live Support & Instant Delivery on World of Warcraft Gold.
Hunter Solo Strategies and Tactics
© 2004-2010 WoW Gold Tips(www.wowgold3000.com) All Rights Reserved.