Skip to content
TopBuilds.gg logo

Macro lessons · Lesson 1 of 5

TopBuilds.gg

Lesson 1 Macro conditions

Make one line do different things depending on the situation.

WoW Macro Conditions

A condition is a test written in square brackets before a spell name. The game checks it at the moment you press the button, so one macro can cast different spells, or aim at different targets, depending on what is happening.

By TopBuilder · Updated November 24, 2026

Syntax

Everything between two semicolons is one option. The game reads the options from left to right and uses the first one whose conditions are all true. A spell with no brackets at the end is the fallback that runs when nothing above matched.

82 / 255 characters
/cast [condition,condition] Spell One; [other condition] Spell Two; Fallback Spell

The rules in five lines

  • A comma inside one bracket means and: [combat,harm] needs both to be true.
  • A second bracket right after the first means or: [@focus,harm][harm] tries the focus first, then your target.
  • Add no in front of a condition to flip it: [nodead] means alive, [nocombat] means out of combat.
  • A value goes after a colon, and a slash lists alternatives: [mod:shift/ctrl] is true when you hold either key.
  • An empty [] is always true, so it works as a catch-all option.

Order is priority

Because the first matching option wins, put the most specific option first. An option that always matches, such as a plain spell name, hides every option written after it. The Explainer warns you when an option can never run.

Examples

Different spell in and out of combat

Fireball while in combat, Frostbolt otherwise.

34 / 255 characters
/cast [combat] Fireball; Frostbolt

Only enemies that are alive

Both conditions must be true, so the press does nothing on a friend or a corpse.

29 / 255 characters
/cast [harm,nodead] Frostbolt

Either of two keys

Polymorph while you hold Shift or Ctrl, Frostbolt otherwise.

43 / 255 characters
/cast [mod:shift/ctrl] Polymorph; Frostbolt

Try it yourself

Try it yourself

50 / 255 charactersTry an example:
  1. /cast [harm,nodead] Frostbolt; [help,nodead] Renew

    Casts Frostbolt when your target is an enemy you can attack and your target is alive; otherwise casts Renew when your target is a friend you can help and your target is alive.

    /cast
    Casts
    harm
    The unit is an enemy you can attack
    nodead
    The unit is alive
    Frostbolt
    Spell name
    help
    The unit is a friend you can help
    nodead
    The unit is alive
    Renew
    Spell name

Tested in the game

WoW Forever

6 of 6 parts here were tried in the WoW Forever client.

  • /cast · tested
  • [combat] · tested
  • [harm] · tested
  • [help] · tested
  • [dead] · tested
  • [mod] · tested

WoW Retail

6 of 6 parts here were tried in the WoW Retail client.

  • /cast · tested
  • [combat] · tested
  • [harm] · tested
  • [help] · tested
  • [dead] · tested
  • [mod] · tested

FAQ

What does the semicolon do in a macro?

It separates options. The game uses the first option whose conditions are true and ignores the rest.

What is the difference between [a,b] and [a][b]?

A comma inside one bracket means both must be true. Two brackets in a row mean either one may be true, tried in order.