WoW Macro Builder

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. #showtooltip makes 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

    #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
    • %t is 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

    #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

    #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.
  • no in front negates — nocombat, nodead, nomod.
  • / between values is OR — mod:shift/ctrl is “Shift or Ctrl”, stance:1/2 is “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

    #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

    #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

    #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.
  • 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.

  • @unit and target=unit mean 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 @

WriteMeaning
@targetYour current target (the default)
@playerYourself
@mouseoverThe unit or unit frame under the mouse
@focusYour focus (set with /focus)
@petYour pet
@targettargetYour target's target. target can be added to any unit (focustarget, party1target)
@party1–4Party members, in party-frame order
@raid1–40Raid members, in raid order
@cursorThe ground under the mouse (area spells)
@noneNo unit — the spell waits for a click
  • Heal the party frame under the mouse

    #showtooltip
    /cast [@mouseover,help,nodead][] Renew
    • Hover a friendly frame or character and press — no click needed.
  • Always on yourself

    #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

    #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

    #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)

WriteMeaning
existsThe unit exists
harmYou can attack it
helpYou can help it (heal, buff)
deadIt is dead
partyIt is in your party
raidIt is in your party or raid

About you

WriteMeaning
combatYou are in combat
stealthYou are stealthed (Stealth, Prowl…)
mountedYou are on a mount
swimmingYou are swimming
indoorsYou are indoors (mounts cannot be used)
outdoorsYou are outdoors
restingYou 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
shapeshiftYou 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:typeYou have that item type equipped (equipped:Shields). worn is the same
known:spellYou know that spell
spec:1/2Your active talent spec
flyingYou are flyingLater expansions
flyableYou are in a zone where flying is allowedLater expansions
advflyableDragonriding is allowed hereLater expansions

How you pressed

WriteMeaning
mod[:shift/ctrl/alt]A modifier key is held (that key, if given). modifier is the same
btn:1/2/3/4/5Clicked with that mouse button (1 left, 2 right, 3 middle). button is the same
cursorYou are holding something on the cursor (an item, a spell)

Action bars and vehicles

WriteMeaning
actionbar:1/2/…That action bar page is shown. bar is the same
bonusbar[:n]A bonus bar (stance or form bar) is active
extrabarThe extra action button is shownLater expansions
overridebarAn override bar is shownLater expansions
possessbarYou control another creature (possess bar)Later expansions
vehicleuiYou are in a vehicle with its own barLater expansions
unithasvehicleuiThe unit is in such a vehicleLater expansions
canexitvehicleYou can leave the vehicleLater expansions
petbattleYou 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.

    mouseover is 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