FOREVER REFERENCE
Look it up. Get back in game.
Clear syntax notes for macro commands, conditions, and targeting, without making you dig through an essay.
New to macros? Start with Introduction to Macros.
89ENTRIES
Macro reference
Macro command33 ENTRIES
/castCasts a spell or ability using the first matching option. Adjacent bracket groups are OR alternatives; semicolon-separated branches are checked in order./useUses an item or ability, honoring the same conditions and branches as /cast. Items can be given by name, item id, inventory slot number, or bag and slot./castsequenceCasts the next item in an ordered list on each press. The reset option returns to the first item when its conditions are met./targetChanges your current target to a unit by name or selector. Unlike @ selectors on other commands, this changes the actual target./targetexactChanges your current target to the unit whose name matches exactly, including capitalization./assistChanges your current target to whatever the chosen unit is targeting./startattackStarts auto-attacking the chosen unit./stopattackStops auto-attacking./stopcastingStops your current spell cast. Commonly placed before an interrupt so the interrupt goes off immediately./stopmacroStops running the rest of the macro when its conditions match. Lines after it do not run./cancelauraRemoves a named aura from your character./cancelformLeaves your current shapeshift form./clearfocusClears your current focus./cleartargetClears your current target./equipEquips an item by name or bag slot./equipslotEquips an item into a specific inventory slot./dismountDismounts you./petattackOrders your pet to attack the chosen target./petfollowCalls your pet back to follow you./petstayOrders your pet to hold its position./runRuns a Lua script. Script text is preserved verbatim; it is not macro option syntax./scriptRuns a Lua script, like /run. Script text is preserved verbatim; it is not macro option syntax./clickSimulates a click on a secure button. Lines using it are preserved verbatim./petdefensiveSets your pet to defensive stance so it attacks when you or it is attacked./petaggressiveSets your pet to aggressive stance so it attacks nearby enemies on its own./petpassiveSets your pet to passive stance so it only attacks when ordered./petautocastonTurns autocast on for one of your pet's spells./petautocastoffTurns autocast off for one of your pet's spells./equipsetEquips a saved equipment set by name./changeactionbarSwitches your main action bar to the given page./swapactionbarSwaps between two action bar pages, using the closer one each press./castrandomCasts one spell chosen at random from a comma-separated list. Lines using it are preserved verbatim./userandomUses one item chosen at random from a comma-separated list. Lines using it are preserved verbatim.
Targeting12 ENTRIES
Current targetSelects your current target for this action.Your characterSelects your character for this action without changing your current target.Your focus's targetSelects your focus's target for this action without changing your current target.Raid memberSelects a numbered raid member for this action without changing your current target. raid1 to raid40 cover the full raid. Suffix forms work too: @raid5target selects their target and @raidpet5 selects their pet.Your target's targetSelects your current target's target for this action without changing your current target.Your mouseover's targetSelects your mouseover unit's target for this action without changing your current target.Chained targetsA unit selector can follow another unit's target by appending target to the unit token, and the step can repeat. @targettarget is your current target's target and @party1targettarget is party member 1's target's target.Your petSelects your pet for this action without changing your current target.Your pet's targetSelects your pet's target for this action without changing your current target.Party memberSelects a numbered party member for this action without changing your current target. party1 to party4 are your group members. Suffix forms work too: @party2target selects their target and @partypet2 selects their pet.Focus targetUses your focus as the unit for this action without changing your current target.Mouseover targetUses the unit under your cursor for this action without changing your current target.
Conditional30 ENTRIES
existsTrue when the selected unit exists.deadTrue when the selected unit is dead.combatTrue while you are in combat.nocombatTrue while you are out of combat.Any modifierTrue while any modifier key is held.Ctrl modifierTrue while Ctrl is held.Alt modifierTrue while Alt is held.No modifierTrue while no modifier key is held.partyTrue when the selected unit is in your party.raidTrue when the selected unit is in your raid group.groupTrue while you are in a group; group:party and group:raid check the group type.mountedTrue while you are mounted.stealthTrue while you are stealthed.swimmingTrue while you are swimming.flyingTrue while you are flying.flyableTrue in areas where flying mounts are allowed.indoorsTrue while you are indoors.outdoorsTrue while you are outdoors.restingTrue while you are resting.channelingTrue while you are channeling; channeling:Spell checks a specific channeled spell.petTrue while you have a pet out; pet:name or pet:family checks which pet.stance:nTrue while you are in stance or form n. form is an accepted alias and compiles as stance.equipped:typeTrue while an item of the given type or name is equipped. worn and item are accepted aliases.button:nTrue when the macro was activated with mouse button n. btn is an accepted alias.actionbar:nTrue while action bar page n is active. bar is an accepted alias.bonusbar:nTrue while a bonus action bar page n is active.harmTrue when the selected unit can be attacked.helpTrue when the selected unit can be helped, such as by healing.nodeadTrue when the selected unit is alive.Shift modifierTrue while Shift is held.
Directive02 ENTRIES
Example01 ENTRIES
Slash command05 ENTRIES
/assist [@focus]/assist [@focus] changes your current target to your focus's target.Available/assist/assist on a friendly player target changes your current target to that player's target.Available/focusUsing /focus on a living friendly player target sets that unit as your focus.Available/follow/follow on a living friendly player target begins following that unit.Available/target [@focustarget]/target [@focustarget] changes your current target to your focus's target.Available
API / Script reference
API / Script06 ENTRIES
GetPlayerFacingCompatibility conclusions for GetPlayerFacing in tested contexts.API · Available · 1 tested contextGetUnitPositionGetUnitPosition("player") is not available in this tested context: addon Lua; out of combat; solo; open world.API · Unavailable · 1 tested contextInCombatLockdownInCombatLockdown() works in this tested context: addon Lua; out of combat; solo; open world.API · Available · 1 tested contextUnitAffectingCombatUnitAffectingCombat("player") works in this tested context: addon Lua; out of combat; solo; open world.API · Available · 1 tested contextUnitExistsUnitExists("player") works in this tested context: addon Lua; out of combat; solo; open world.API · Available · 1 tested contextUnitPositionUnitPosition("player") works in this tested context: addon Lua; out of combat; solo; open world.API · Available · 1 tested context