Macro syntax & conditions
How WoW Forever macros work — if/else with [conditions], and/or/not, choosing the target with @unit — with every condition explained and examples you can open in the builder.
For ready-made macros and fixes, see Examples & FAQ →Macro basics
A macro is a list of slash commands that run from top to bottom with one press.
- One command per line. Every line runs on each press, in order.
- A line starting with
#is a directive, not a command.#showtooltipmakes the button show the icon and tooltip of the spell it will use. - A line without
/is said in chat as it is. - A macro can be at most 255 characters, line breaks included.
- The Korean client also accepts English commands (
/cast). Spell names must be in your client's language.
Several commands in one press
Warrior#showtooltip /startattack /cast Heroic Strike
- Starts auto-attack, then queues Heroic Strike — both on one press.
- Heroic Strike has no global cooldown, so nothing gets in the way.
Choose the button icon with #showtooltip
#showtooltip Polymorph /cast [mod:shift] Frost Nova; Polymorph
- Without a name, the icon follows the spell that would be used right now.
- With a name, the button always shows that spell.
Cast and tell your party
#showtooltip /cast Polymorph /p Polymorphing %t
%tis replaced with your target's name.- Chat lines run even when the spell fails, so the message is sent every press.
Branches: if / else
Write conditions in [brackets] before the spell. Options separated by ; are checked from the left, and only the first one whose conditions match is used.
[condition] A; B— if the condition matches, A; otherwise B (an option without brackets always matches).[c1] A; [c2] B; C— if c1, A; else if c2, B; else C. Put the most specific option first.- Without a final option (no else), nothing happens when no condition matches.
- Options after one that always matches are never used.
/stopmacro [condition]ends the macro there when the condition matches — the lines below it do not run.
Heal friends, attack enemies
Priest#showtooltip /cast [help] Flash Heal; Smite
- A friendly target gets Flash Heal; anything else gets Smite.
Three spells on one button (modifier keys)
#showtooltip /cast [mod:shift] Frost Nova; [mod:ctrl] Blink; Fireball
- Shift: Frost Nova. Ctrl: Blink. No key: Fireball.
- If you hold both, the first matching option (Frost Nova) wins.
Different spell in and out of combat
#showtooltip /cast [combat] Fireball; Conjure Water
- In combat it attacks; between fights it makes water.
Only when the condition matches (no else)
#showtooltip /cast [nocombat] Arcane Intellect
- In combat the button does nothing, so you cannot waste mana on a buff mid-fight.
Stop early with /stopmacro
Hunter#showtooltip /stopmacro [noexists] /petattack /cast Arcane Shot
- With no target, the macro stops at the first line, so the pet is not sent anywhere.
- With a target, the pet attacks and you fire Arcane Shot.
Combining conditions: and, or, not
Inside one [ ], conditions must all match. Several [ ] in a row mean “or”.
,inside brackets is AND —[harm,nodead]is “an enemy and not dead”.[a][b]is OR — the option is used if either bracket matches. Each bracket can have its own @target.noin front negates —nocombat,nodead,nomod./between values is OR —mod:shift/ctrlis “Shift or Ctrl”,stance:1/2is “stance 1 or 2”.[](empty) always matches. It is handy as the last bracket: “this target, or else the normal target”.
And: out of combat and not stealthed yet
Rogue#showtooltip /cast [nocombat,nostealth] Stealth
- Pressing again while stealthed does nothing, so you cannot cancel Stealth by mistake.
Or: mouse-over, then target, then yourself
Priest#showtooltip /cast [@mouseover,help,nodead][help,nodead][@player] Flash Heal
- Brackets are checked from the left; the first one that matches decides who is healed.
- The last bracket has no condition, so you heal yourself when nobody else qualifies.
Not: call, revive or heal the pet
Hunter#showtooltip /cast [nopet] Call Pet; [@pet,dead] Revive Pet; [@pet] Mend Pet
- No pet: call it. Dead pet: revive it. Otherwise: heal it.
Several values: Shift or Ctrl
#showtooltip /cast [mod:shift/ctrl] Frost Nova; Fireball
- Same as
[mod:shift][mod:ctrl], but shorter. [mod:shift,mod:ctrl]would mean both keys held at once.
- Same as
Empty brackets as the fallback
#showtooltip /cast [@focus,harm,nodead,mod:alt][@mouseover,harm,nodead][] Polymorph
- Alt: the focus. Otherwise the enemy under the mouse. Otherwise your target.
Choosing the target: @unit
By default a spell goes to your current target. Put @unit at the start of the brackets to cast on someone else without changing your target.
@unitandtarget=unitmean the same. This site writes@.- Conditions about a unit (
harm,help,dead,exists) check the @unit of the same bracket — not your target. - Conditions about you (
combat,mod,stance…) do not depend on @unit. - If the unit does not exist and there is no other option, the spell waits for you to click a target (or fails).
Units you can use after @
| Write | Meaning |
|---|---|
| @target | Your current target (the default) |
| @player | Yourself |
| @mouseover | The unit or unit frame under the mouse |
| @focus | Your focus (set with /focus) |
| @pet | Your pet |
| @targettarget | Your target's target. target can be added to any unit (focustarget, party1target) |
| @party1–4 | Party members, in party-frame order |
| @raid1–40 | Raid members, in raid order |
| @cursor | The ground under the mouse (area spells) |
| @none | No unit — the spell waits for a click |
Heal the party frame under the mouse
Priest#showtooltip /cast [@mouseover,help,nodead][] Renew
- Hover a friendly frame or character and press — no click needed.
Always on yourself
Priest#showtooltip /cast [@player] Power Word: Shield
- Shields you even while an enemy or another player is targeted.
Interrupt the focus
#showtooltip /cast [@focus,harm,nodead][] Counterspell
- Set a focus with /focus, then interrupt it without switching targets.
Heal whoever your enemy is hitting
Priest#showtooltip /cast [help,nodead][@targettarget,help,nodead] Flash Heal
- With a friend targeted, heals them. With an enemy targeted, heals the enemy's target.
A fixed party member
Druid#showtooltip /cast [@party1,help,nodead] Rejuvenation
- party1 is the first member under your own frame in the party list (party1–party4).
All conditions
Write these inside [ ]. Conditions about the unit check the @unit of the same brackets (your target if none).
Every condition can be negated with no (nocombat, nomod, nostance). Values in [ ] are optional unless shown without them.
About the unit (@unit, or your target)
| Write | Meaning |
|---|---|
| exists | The unit exists |
| harm | You can attack it |
| help | You can help it (heal, buff) |
| dead | It is dead |
| party | It is in your party |
| raid | It is in your party or raid |
About you
| Write | Meaning |
|---|---|
| combat | You are in combat |
| stealth | You are stealthed (Stealth, Prowl…) |
| mounted | You are on a mount |
| swimming | You are swimming |
| indoors | You are indoors (mounts cannot be used) |
| outdoors | You are outdoors |
| resting | You are resting (inn or city) |
| channeling[:spell] | You are channeling (a specific spell, if named) |
| stance[:1/2/…] | In a stance or form (by number; without a number, any). form is the same |
| shapeshift | You are shapeshifted |
| pet[:name/family] | You have a pet (of that name or family, if given) |
| group[:party/raid] | You are in a group (a party, or a raid) |
| equipped:type | You have that item type equipped (equipped:Shields). worn is the same |
| known:spell | You know that spell |
| spec:1/2 | Your active talent spec |
| flying | You are flyingLater expansions |
| flyable | You are in a zone where flying is allowedLater expansions |
| advflyable | Dragonriding is allowed hereLater expansions |
How you pressed
| Write | Meaning |
|---|---|
| mod[:shift/ctrl/alt] | A modifier key is held (that key, if given). modifier is the same |
| btn:1/2/3/4/5 | Clicked with that mouse button (1 left, 2 right, 3 middle). button is the same |
| cursor | You are holding something on the cursor (an item, a spell) |
Action bars and vehicles
| Write | Meaning |
|---|---|
| actionbar:1/2/… | That action bar page is shown. bar is the same |
| bonusbar[:n] | A bonus bar (stance or form bar) is active |
| extrabar | The extra action button is shownLater expansions |
| overridebar | An override bar is shownLater expansions |
| possessbar | You control another creature (possess bar)Later expansions |
| vehicleui | You are in a vehicle with its own barLater expansions |
| unithasvehicleui | The unit is in such a vehicleLater expansions |
| canexitvehicle | You can leave the vehicleLater expansions |
| petbattle | You are in a pet battleLater expansions |
Conditions marked “Later expansions” belong to features added after the original game (flying, vehicles, pet battles…); on WoW Forever they most likely never match. Conditions are handled by the game client and some have not been tested on WoW Forever.
Common mistakes
The builder warns about each of these when you type the macro directly.
An option after one that always matches
Wrong
/cast Fireball; [mod:shift] Frost Nova
⚠ Branch 1 always matches, so the 1 after it never run.
The first option has no condition, so it always wins and Frost Nova is never cast. Put the option with the condition first.
Fixed
/cast [mod:shift] Frost Nova; Fireball
Conditions after the spell name
Wrong
/cast Polymorph [@focus]
⚠ Conditions must come before the spell: “Polymorph [@focus]”.
Brackets must come before the spell. Written after it, they become part of the spell name and the spell is not found.
Fixed
/cast [@focus] Polymorph
A unit without @
Wrong
/cast [mouseover,harm] Polymorph
⚠ [mouseover] is not a condition.
mouseoveris a unit, not a condition. Without@the game does not understand it.Fixed
/cast [@mouseover,harm] Polymorph
A misspelled value
Wrong
/cast [mod:shft] Frost Nova; Fireball
⚠ “shft” is not a valid value for [mod].
Values are not checked by the game — a typo just never matches. Modifier keys are shift, ctrl and alt.
Fixed
/cast [mod:shift] Frost Nova; Fireball