Macro Basics

Macro Basics

The macro editing window can be brought up by typing /m in the chat window. There you can write, edit, and store macros either for your entire account (if the macro is useful for multiple characters) or for just the current character (if you have a class-specific macro, for example).

Create a new macro by clicking “New”. Then you will have to give the macro a name and an icon. Personally, I don’t like text appearing over my skill icons so I tend to name my macros “ “ which is just a press of the spacebar. For the icon, I typically suggest using the first icon, the red “?”.This icon is special, because it will adapt to the functionality of the macro. It will automatically attempt to find the appropriate icon based on the action performed by the macro.

First Macros

After you’ve chosen a name and icon for the macro, you must write the functionality of the macro – what will the macro do? In the big box at the bottom of the macro editor window (where it says “Enter Macro Commands”)you can type something as simple as:

/s Hi

Then, if you drag the icon for this macro to an action bar, and press/click it, your character should say “Hi”.

Now try something more useful. Create a macro that has the following command:

/cast Demon Armor

Now you’ve written a macro that will cast the warlock spell Demon Armor for you! You might not think this is very useful, since you could have just had the spell on your action bar in place of the macro. You’d be correct, but this macro’s functionality is more subtle and useful than you think. This macro will automatically use the highest rank of the spell! As you level, you will never need to replace Demon Armor with the new rank; just use this macro and you will automatically have the highest-rank spell available.

A More Useful Macro

Macros are only useful if they save you time, key presses, or action bar slots. Getting the most out of a macro means having a basic knowledge of what a macro can do. Here’s an example:

/cast [@player] DevourMagic

This macro will use the Felhunter’s Devour Magic spell (assuming he is the active summoned demon) on you, even if you have an enemy targeted.

Notice the “@player” inside the square brackets. This is called a conditional and it modifies the nature of the action being performed.

Actions

Most macros are meant to use and/or equip items, cast spells, announce your actions to appropriate chat channels. Here are some of the basic actions a macro can perform:

/cast

Cast a spell. Probably going to be your most-used type of macro command.

/stopcasting

Interrupts a spell cast. Useful in front of/cast or /use commands, to interrupt your cast and complete your next action faster.

/castsequence

Cast several spells in a pre-determined order. You can have the sequence reset upon special circumstances.

/use

Use an item, such as health/soul/spellstones, potions, food/water, trinkets, whatever.

/equip

Equip an item from your bag. Will induce a 30-second cooldown on items with a Use effect.

/say

Self-explanatory

/party

Self-explanatory

/raid

Self-explanatory

/r

Responds to a whisper. Can make a macro that says “Leave me alone I’m watching Asmongold!”

/dismount

Takes you off your mount. This is handy to put in front of a /cast macro for your opener spells.

/userandom

Uses a random item from a list you specify. The only use I can think of for this is to summon a random non-combat pet :P

/petaggressive

Set your demon to aggressive.

/petattack

Command your demon to attack.

/petautocasttoggle

One button to turn on/off autocast for a specific demon ability.

/petautocaston

Turns autocast on for a specific demon ability.

/petautocastoff

Turns autocast off for a specific demon ability.

/petfollow

Recalls your pet to follow you.

/petpassive

Set your pet to passive.

/petstay

Command your pet to stay in place.

/targetlasttarget

Targets your previous target, without having to find their name/unitframe/nameplate/character.

Conditionals

Here is the focus of the guide portion of this document. If you can understand this, you’ll be able to write useful macros for any situation, playing any class (though of course you only play Warlock, right?).

You can chain these together to make very nice macros. Mix and match them to suit your needs.

Here are some of the most important conditionals, with a brief description of what they do:

Targeting

Target tags can be chained together as well. For example,@targettargetpettarget will cast at your target’s target’s pet’s target.

@player

Casts the spell towards the player (you) regardless of what you have targeted. A good example is the previously shown Self-Devour macro.

@pet

Casts the spell towards your pet regardless of what you have targeted.

@targetpet

Casts the spell towards your target’s pet regardless of what you have targeted.

@mouseover

Casts the spell towards the unit your cursor is floating over. This is an extremely important modifier for pvp, for two reasons: first, it eliminates the time/hassle of clicking or tabtargeting. Second, it doesn’t show which target you are casting your spell towards. Make sure you have important curses, fear, spell lock, etc, on mouseover.

@cursor

Similar to mouseover, but this is for “aimed” abilities with reticules like Rain of Fire, Inferno, and Iron Grenade. With this modifier, you won’t have to activate the ability and then click the location – the spell will automatically cast at the location of your mouse pointer.

@targettarget

Casts at your target’s target. This is pretty useful in PVP; for example, you can fear the target of your healer.

Key Modifiers

These conditionals completely change the function of the macro when a modifier-key is held before pressing the key of the original macro. For example, you might bind the /s Hi macro to the button F. You can add another line to the macro /s [mod:shift] Bye so that when you press Shift + F you say Bye instead of Hi.

IMPORTANT: The modified key combination must be available(not taken by any other action) for these macros to work. For example, you would not be able to put a macro on the 1 slot, and then use a shiftmodifier (resulting in the keypress Shift + 1) because Shift + 1 is already bound to Action Page 1 by Blizzard Default. You must unbind the modified key combination to use these.

These are self-explanatory I think, so I won’t note them individually.

mod:shift
mod:alt
mod:ctrl

Demons

These conditionals change the function of the macro depending on which demon you currently have summoned. These are also self-explanatory.

pet:imp
pet:voidwalker
pet:succubus
pet:felhunter

Misc

These don’t fit nicely into the other sections but they are important in my opinion, so I’ve just thrown them in a pile here. You might find several useful. Several of these benefit from using the ‘no’ prefix (example: noparty, noharm, noexists).

worn:item_name_or_slot_number

Changes the behavior of the macro if a specific item is equipped (“worn”). This may be useful for Spellstone macros, or engineering trinket macros.

btn:1 or btn:2

Allows you to make a macro that performs differently depending on left-click (1) or right-click (2). Normally you don’t want to click anything, but for some things, it can be okay.

group:party_or_raid

Changes the behavior of the macro depending on whether you are in a party or a raid group.

party

Changes the behavior of the macro if your target is a party member

raid

Changes the behavior of the macro if your target is a raid member

dead

Changes the behavior of the macro if your target is dead

exists

Changes the behavior of the macro if your target exists. Sounds weird, but this is most useful for things that you don’t want to cast unless you have something targeted.

harm

Changes the behavior of the macro if your target is an enemy (someone/something you can attack and that can attack you)

help

Changes the behavior of the macro if your target is friendly (unable to attack you or be attacked by you)

channeling

Changes the behavior of the macro if you are currently channeling a spell (such as DrainSoul, Rain of Fire, etc). Works well with the ‘no’ prefix (nochanneling).

For a full list of macro conditionals, see this article (note that some of these may not work in Classic, as they are written with BfA context).

Other Things

#showtooltip spell_name

This should go at the start of most macros. Adds a tooltip and icon to macros (assuming you use the red ? icon). If you do not put the spell_name, the macro will attempt to figure out what the correct spell should be automatically.

/stopmacro

Stops the execution of the macro past this line. A slightly more advanced command can be combined with conditions (such as [pet:imp]) to make more complex macros.

/script UIErrorsFrame:Hide()

Disables the red error messages “Out of range”, “Not in line of sight”, etc. Reduces some visual clutter for macros you are going to spam.

Share this lesson