Macro (WoW)  

Macro: A macro is a small script that is used to combine several actions in a single button, with the potential for a (limited) amount of intelligent choice without player input.

Contents [hide]

Types of Macros

Macros are divided into two sets; General Macros, which are shared across your entire account, and Character-Specific Macros, which are useable by your current character only. Each set has a limit of 16, for a total of 32 potential macros, and each macro has a 256-character length limit.

My First Macro

Creating a Macro in World of Warcraft is easy! Just hit the Escape key until the Game Options menu appears, and then to click on the Macros button. Click the "New" button in the bottom of the Macros pane, pick the icon you want your macro to use as well as the name and you're all set to start writing!

For our example we're going to create a simple macro that will use a /say command to talk and also use an emote action. Name your macro "Hello World" and pick whichever icon you want, then hit okay. Click on the text-box in the bottom of the Macro pane and type the following;

/say Hello, world!
/dance
Drag the macro onto your action bar and hit it, and you'll tell the world hello and start dancing. Congratulations, you've just made your first macro! Yes, it really is that easy.

Writing a Macro

Macro Commands

Macro Commands are useful slash-comamnds you can put into macros (or your chat bar!) to make the game perform certain actions for you. Combined with macro conditionals you can create useful macros to perform a wide variety of tasks for you.

Macro Commands
Command Use Syntax Notes
/cast Casts the ability, item or spell /cast [Conditonal] First Spell; [Conditional] Second Spell Identical to /use
/use Casts the ability, item or spell /use [Conditional] First Spell; [Conditional] Second Spell Identical to /cast
/castsequence Casts the abilities in order, then repeats /castsequence reset=ResetFunctions [Conditional] First Spell; Second Spell Can use reset= to determine when to return to the first ability
/castrandom Casts a random ability /castrandom [Conditional] First Spell; Second Spell
/stopmacro Stops the macro /stopmacro [Conditional] Useful for creating if->then sequences
/target Targets the named unit /target Name
/assist Switches your target to your target's target /assist [Conditional]
/targetlasttarget Switches your target to your previous target /targetlasttarget [Conditional]
/cleartarget Clears your target /cleartarget [Conditional]
/focus Focuses your target /focus [Conditional]
/clearfocus Clears your focus target /clearfocus [Conditional]
/targetenemy Targets your closest enemy /targetenemy [Conditional] Functionally identical to tab-target
/targetparty Targets your closest party member /targetparty [Conditional]
/targetraid Targets your closest raid member /targetraid [Conditional]
/equip Equips the named item /equip Name of Item
/equipslot Equips the named item in the selected slot /equip # Name of Item Full list of item slots
/cancelbuff Cancels the named buff /cancelbuff [Conditional] Buff Name
/cancelform Cancels your current form /cancelform [Conditional] Primarily used by Druids to return to Caster form
/dismount Cancels your current mount /dismount [Conditional]

Cast and Use

The heart and soul of most macros, the Cast and Use commands allow you to use spells, abilities and items when the conditionals are met. There is no limit to the number of conditional checks the /cast command can make, but it will stop at the first ability it sees that passes the conditional checks to use it.

Cast Sequence

A very powerful but limited function, Cast Sequence allows you to tell the macro to use different abilities in a certain order. Unlike /cast, there is only a single conditional check at the start of the macro; the command will not allow you to bypass parts of the sequence if certain conditions aren't met. More to the point, it will 'freeze' on each step until that step can be completed, rather than bypassing it. If one ability has a cooldown or is event triggered (such as Overpower) then it will hang on that step of the sequence until it can perform that command.

This is partially mitigated by the ability to use the reset= tag, which will cause the castsequence to go back to square one on certain events - target for target changes, combat for when you leave combat, or simply a number for a certain number of seconds. These can be combined; for example, 'reset=target/combat/3' will reset the macro to step 1 if you change targets, leave combat or more than three seconds pass without it being activated. Unfortunately, though, the time-based reset of the Castsequence button goes off how much time has passed since you hit the button, not since it last cast an attack in the sequence. The 'idle timout' instead of an active timer, combined with the other restrictions on Cast Sequence, make it much less valueable than it could be; as it is, though, the tool is extremely useful, especially for Hunters trying to perfect their shot rotation.

Cast Random

A simple function, this will randomly use one of the abilities in its list every time you use the button. Like castsequence, only one conditional check is allowed - it will either pick any one of the random choices, or none at all. Useful for brute-forcing events or for performing a random action, like selecting a different mount for you to use each time.

Stop Macro

If this command passes its conditional checks, it will stop the macro from proceeding any further. This can be used in lieu of constant conditional checks to create an If->Then functionality, as without failing the Stop Macro's conditions nothing further in the macro will be accessed.

Target Functions

These commands are used to modify your current target or focus target. The /targetparty/raid/enemy commands are functionally identical to tab-targetting.

Buff Functions

These commands are all used to cancel certain buffs. You can, in fact, use /cancelbuff Black War Raptor in order to cancel your mount (or /cancelbuff Dire Bear Form), but the /cancelform and /dismount functions will always choose your shapeshift or mount to remove. /dismount is especially handy with a random-mount macro.

Macro Conditionals

Macro Conditionals are used to establish the parameters within which the commands you use will activate. For example,

/cast [harm] Shadow Word: Pain; [help] Power Word: Shield

Will cast Shadow Word: Pain if your target is unfriendly, and Power Word: Shield if your target is friendly. All conditionals can also be inverted with a prefix of no - for example, [harm] (is my target unfriendly) and [nohelp] (is my target not friendly) are functionally identical.

Macro Conditionals
Conditional Use Syntax Notes
Target Changes the target of your conditional/command to a different unit [target=unittype] Not a true conditional, but a modifier
Harm TRUE if target is hostile [harm]
Help TRUE if target is friendly [help]
Exists TRUE if your target exists (i.e. if you have one) [exists]
Dead TRUE if your target is dead [dead]
Party TRUE if your target is a member of your party [party]
Raid TRUE if your target is a member of your raid [raid]
Group TRUE if your target is a member of your party or raid [Group:type] Can be used without a type to return true for either parties or raids
Stance TRUE if you are in the given stance or shapeshifting form [stance:#] Complete list of stances, can be used without a # to check if you are in any stance/form
Stealth TRUE if you are stealthed [stealth]
Combat TRUE if you are in combat [combat]
Channeling TRUE if you are channeling the named spell [channeling:spell] Can be used without a spell to determine if you are channeling a spell at all
Modifier TRUE if the selected modifier is pressed [modifier:type] Valid modifiers: shift, ctrl, alt
Button TRUE if that button was used to activate the macro [Button:#] Using a keybind is considered the same as a left-mouse click (1)
Equipped TRUE if the given item is equipped [equipped:item name]
Pet TRUE if the given pet's name or type matches your active pet [pet:type/name]
Mounted TRUE if you are riding your mount [mounted] Not that kind of mounted
Flying TRUE if you are on a flying mount [flying]
Swimming TRUE if you are swimming [swimming]
Flyable TRUE if you are in a location where you can use a flying mount [flyable]
Indoors TRUE if you are indoors [indoors]
Outdoors TRUE if you are outdoors [outdoors]
Valid Unit IDs
UnitID Use Notes
player Yourself
focus Your focus target
pet Your current pet
party# The #'th member of your party 1-4 valid; player is excluded
raid# The #'th member of your raid 1-40 valid; player is included
mouseover The unit frame you mouseover'd Current or most recent
partypet# The #'th member of your party's pet 1-4 valid; player is excluded
raidpet# The #'th member of your raid's pet 1-40 valid; player is included

Target

Target is not a true conditional, but a modifier for the macro. By default, all targeted conditionals are evaluated on your current target and if true spells will be used against your target (if applicable). By using the target modifier, though, you can change the target of the macro - [target=focus] will reevaluate all conditionals based on your focus, [target=self] wlll use the player as the target, and <target=pet> will use your own pet. Additionally, you can add any number of "-target suffixes; <target=focustargettarget> will target your Focus's Target's Target. Any valid UnitID (see table) can be used with the target command.

Targeting Conditionals

All targeting conditionals can be redirected with the target= function. By default, however, they evaluate against your current target.

Personal Conditionals

All personal conditionals cannot be redirected with the target= function, and will always evaluated based off your current status.

Enviromental Conditionals

A subset of personal conditions, these also cannot be redirected with the target= function and will always be evaluated based off your current status.

Using Items

There are quite a few ways to use macros /use items in macros.

  • The easiest way to do it is to /use itemname, such as /use Runic Healing Potion'. This is straightforward and easily used in many macros. Also if you use this with equipment such as trinkets it'll attempt to equip it and cause an internal cooldown for the item. Note if you are in combat it will not equip it unless it's a weapon.
  • It is possible to use items equiped by /use number. The slot is numbered ingame and trinkets are the most commonly used this way such as /use 13 or /use 14 for top trinket and bottom trinket respectively.
  • /use can also be used with a coresponding item in your bag by slot. Each bag has a numerical value from 0 to 4, starting with the backpack going from left to right. Macros assume when you use two numbers seperated by spaces you are referencing a bag slot rather than an inventory slot. The secondary number corresponds to the actual slot inside the bag starting with 1 and going all the way to the last number in the bag. The 1 slot is always the highest left most slot in the bag and keeps going to the right and going to the next row and repeating until the end of the bag. So a 16 slot bag would look like this:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

For example let's say you want to use food that's in the 4th slot in your 3rd bag. So since it's your 3rd bag it would be bag number 3 (backpack+bag+bag+bag+bag) and it's the 4th slot you'd /use 3 4 to eat the food you have in that slot.

Item Slots

The current list of inventory slots and their numbers are as follows:

  • 0 = ammo
  • 1 = head
  • 2 = neck
  • 3 = shoulder
  • 4 = shirt
  • 5 = chest
  • 6 = belt
  • 7 = legs
  • 8 = feet
  • 9 = wrist
  • 10 = gloves
  • 11 = finger 1
  • 12 = finger 2
  • 13 = trinket 1
  • 14 = trinket 2
  • 15 = back
  • 16 = main hand
  • 17 = off hand
  • 18 = ranged
  • 19 = tabard

Macro Tricks

The ? Icon

When selecting the icon for your macro to use, if you select the '?' icon the macro will use the icon of the ability it would use in that situation. Extremely useful for Castsequence macros, because it will update at each step to give you a visual indication of where in the sequence the macro is, and just plain useful.

Show and Showtooltip

The special #show and #showtooltip functions let you further customize the appearance of your macro. #show lets you change the appearance of the macro to mirror another spell, ability or even an item, such as a Prayer of Fortitude macro displaying the number of Sacred Candles remaining in your inventory. #showtooltip is identical to #show, except it also changes the tooltip of the macro to match whatever you put behind it. Additionally, you can leave the area after #show or #showtooltip blank to have it show the name/tooltip of the top macro function, similar to how the ? icon works.

Useful Macros

See useful macros

World of Warcraft
Wikibase™

This page last modified 2009-03-12 17:02:45.