Macros - What Every Player Needs to Know

UI and Macro
1 2 3 15 Next
Table of Contents:
-------------------------------
1. Intro - Macro Basics
2. Macros - What can they do?
3. Macros - What can they NOT do?
4. Conditionals - How do they work?
5. Scripting - What is possible in a macro?
6. Macros - Tips, Tricks, and Shortcuts
7. Off-GCD Abilities List
8. More to Come
9. FAQ
10. Reserved

1. Intro - Macro Basics

Macros are a very useful tool within the World of Warcraft client. They allow you to combine multiple actions onto a single button. While the entire macro will run every time, actions which trigger the Global Cooldown will stop later GCD actions from functioning.

You can make a macro to take almost any action you can click or keybind, with certain restrictions.

Macro commands can be made more useful with [conditionals], snippets that check on various things to allow a small degree of decision making. While macros execute the first valid item from the top down, individual commands execute the first valid conditional, from left to right.

Macros can be used to execute scripts, small snippets of Lua code, from within WoW without the use of an external addon. This is done by using the /run command. Scripting is an advanced feature and is explained more in detail in post 5.

There are a number of tips, tricks, and shortcuts to help you get the most out of your macros. Most of the ones listed have come from this very forum, and I have consolidated them here to make it easier.

My intention is to continue to expand this post with more useful information over time, so feel free to add a post with any questions or useful information you think I should add.
2. Macros - What can they do?

Macros can make many actions within the game environment. Most often, macros are created to use items or abilities. However, macros can also be used to send chat messages, equip gear, change class specializations, and adjust settings, among many, many other things.

Macro commands are prefaced with a /

Examples:
/use
/cast
/say
/equip
/console
/castsequence
/target

There are many other slash commands that can be used in a macro, and more are added in patches or expansions on a regular basis. WoWPedia has a full list of all possible slash commands available to the default game client. Many addons also add their own slash commands, usually to open a configuration menu or perform a specific action; most of these can be used from a macro as well as typed directly into the chat edit box (ie /recount).

There is also a special macro command, #showtooltip. This will show the icon and information for an item or ability, the same as if you had dragged the item or ability onto your action bar.

Example:#showtooltip
/cast Flash Heal


This macro, when placed on your action bar, would function exactly the same as dragging the spell Flash Heal from your spellbook.
3. Macros - What can they not do?

Macros cannot make smart decisions for you. They can't cast spells based on cooldown, or check if a buff is active, or magically fit all your abilities onto one button.

Macros cannot be any longer than 255 characters, unless you use an addon to circumvent this limit.

Macros cannot circumvent the global cooldown to use more than one item or ability at a time. There are some exceptions, but this is the general rule.

Macros cannot simulate additional keypresses. One keypress = one action.

Macros cannot include a delay for most commands. Certain commands (ie chat) can be delayed with an addon.
4. Conditionals - How do they work?

Conditionals are a way to extend the macro interface. They allow limited decision-making to macros; be aware that they are limited. A full list of conditionals will be available at the bottom of this post once the initial posts in all categories have been created.

As an example, let's take the simple macro from the initial post:#showtooltip
/cast Flash Heal

We are going to modify this macro with the [harm] conditional, so it does something different when an enemy is targeted:
#showtooltip
/cast [harm]Smite;Flash Heal

Now, the macro will use Smite if you have an enemy targeted, and Flash Heal otherwise.

You can use multiple conditionals in a macro command. Example:#showtooltip
/cast [harm,mod:ctrl]Holy Fire;[harm]Smite;[mod:ctrl]Heal;Flash Heal

The macro will now use Holy Fire if you are pressing CTRL and you have an enemy target, Smite if you have an enemy target and are not pressing CTRL, Heal if you are pressing CTRL without an enemy target, and Flash Heal if none of the other conditions are true.

IT IS IMPORTANT TO REMEMBER THAT A MACRO WILL EXECUTE THE FIRST TRUE CONDITION.

In the above example, if you have an enemy targeted, the macro will never cast Heal or Flash Heal, no matter what you do. You need to target a friendly or clear your target in order to cast a healing spell.

Conditionals available for use in macros:
(Note that any of these conditions (excepting @unit) can be inverted with no, meaning [nocombat], [nopet], etc, will work exactly as you'd expect.

  • [@unit]

    Attempts to perform the action on the listed unit, unit can be a UnitID (player, target, pet, party1, raid1targettarget, etc) or a name (Adreaver-Undermine). Names are case-sensitive and only valid if the named player is a member of your group. Additionally, for Cross-Realm players, omit spaces (but not punctuation) in the realm name (Bob-SomeRealm rather than bob-some realm). A full list of UnitIDs is available at WoWPedia.

    A special unit is [@mouseover], which refers to the unit (or unitframe) you are pointing your cursor at. Particularly useful for healers to cast healing spells on party members without having to change targets, they are also useful for things like interrupts, offensive dispels, and sending your pet to attack one target while you attack another.

  • [modifier]

    This allows you to cast a different spell when pressing ctrl, shift, or alt. [modifier] can be shortened to [mod] with the same effect. [mod] will register any modifier, while [mod:shift] will only register shift, and ignore ctrl or alt. If desired, you can use multiple modifiers together - [mod:ctrlalt] for example, will only register when pressing ctrl AND alt at the same time.

  • [button]

    This checks which mouse button you used to click the macro. It can also be shortened to [btn]. [btn:1] is implied by default, but you can specify [btn:2] for right click, [btn:3] for middle click, and 4/5 for side buttons on your mouse.

  • [exists], [help], [harm], [dead]

    These check the status of your target. [exists] simply checks for any target, living or dead, friendly or hostile. [help] and [harm] check for a friendly or hostile target respectively, while [dead] check if your target is dead. [help][harm][dead] all imply [exists] - if your target is dead, you obviously have a target.

  • [combat]

    Combat allows you to check if you are in combat. This is helpful when you have certain spells that can only be used out of combat, for example mounts.
    #showtooltip
    /use [combat]Aspect of the Cheetah;Brown Ram
    for example would use your Aspect of the Cheetah in combat, and summon your mount out of combat, thus giving you a speed boost in either scenario.

  • [talent:R/C]

    This checks if you have a certain talent selected, where R and C are the Row and Column of the talent. For example, this macro will make you invisible, using the Camouflage talent if known, and the Alchemy potion Skaggldrynk if not:
    #showtooltip
    /use [talent:5/3]Camouflage;Skaggldrynk

  • [stance],[form],[stealth]

    These check if you are in a stance or form, with [stealth] specifically checking for Stealth. [stance] and [form] are functionally identical, so you can use [form:2] to look for a Warrior's Defensive Stance, or [stance:1] to look for a Druid's Bear Form. Brewmasters, Mistweavers, and Rogues of all specializations also have additional stances, with rogues using additional [form:2] for Vanish and [form:3] for Shadow Dance. A full table of forms is available at http://wow.gamepedia.com/Form. While not covered on WoWpedia, Paladin seals can also be checked with [form].

  • [equipped], [worn]

    This is used to check if you have the specified item type equipped, like [equipped:Shirts] to check if you are wearing a shirt. [worn] is functionally the same but using less characters. You can only check for a spcific item type, not for an individual item by name.

  • [pet]

    This checks if you have a pet out, and optionally, what kind. [pet] will check for any pet, while [pet:bear] or [pet:felguard] will look for that specific type.

  • [spec]

    This checks which of your specializations you are currently in. [spec:1] through [spec:4] go in the same order as the Specializations Window, from top to bottom. Demon Hunters only have 2 specializations, and Druids have 4. All other classes have 3.

  • [actionbar]

    This checks which actionbar you are currently on. In the default UI, you may have noticed that you can press Shift+1 through Shift+6 (or click the small arrows to the right of your actionbar) to change your actionbar page, granting you access to an additional row of abilities. This would allow the same macro, placed on two different pages, to function differently depending on which page you were on at any given moment. Primarily used in actionbar swap macros, not particularly useful outside of this limited context.

  • [group],[group:party],[group:raid]

    This indicates whether you are in a group. [group] is true for a group of any size, while [group:party] is only true for a 5-man party, and [group:raid] is only true for a raid group, regardless of size.

  • [channeling]

    This indicates if you are channeling a spell, like Mind Flay, Blizzard, or Soothing Mist. You can use [channeling:SpellName] to check if you are channeling a specific spell, or don't specify a spell and it will be true if you are channeling any spell.

  • [indoors][outdoors][flyable]

    These all refer to the area where you are. If you are outside (in an area where you can summon your mount), [outdoors] will be true. Otherwise, [indoors] will be true. [flyable] is true in areas where flying on a mount is permitted, regardless of whether you have the requisite flying skill learned.

  • [mounted][flying][swimming]

    These indicate your current movement status. [mounted] checks if you are on a mount of any kind, [flying] checks if you are on a flying mount AND flying in the air, and [swimming] checks if you are in a body of water, regardless of whether or not you are submerged or at the surface.
  • 5. Scripting - What is possible in a macro?

    Scripting is an advanced feature sometimes used in macros. Be aware that scripting can't be used to cast a spell, use an item, or take any other "secure" action. Secure actions are those things which are reserved for the Blizzard UI, and are not available to addons.

    Essentially, if you use a script in a macro, you are using a micro-addon. It has all the abilities and limitations of a normal addon, but restricted to a 255 character limit. Useful examples are announcing cooldown or crowd control targets in a raid environment, calcuiating variables and returning the result (ie How many glyphs do I have left to learn?), or making non-protected spell casts (ie determining which mount to use based on what zone you are in).

    There are far more possibilities available with scripting than I could possibly describe here, so if you have specific questions or a script you want to share, feel free to mention it here or post a new thread.

    7.0 update:
    As a result of some scammers passing off malicious scripts as legitimate, Blizzard has implemented a Lua script warning anytime you run a macro with the "/script" or "/run" commands. You get this same warning if you type a script directly in the chat window without a macro.

    The warning is essentially telling players to be careful of running custom scripts they get on the internet or from other players, that they should not run any scripts they do not trust.

    This warning is for player protection only, and does not reflect a policy change.
    6. Macros - Tips, Tricks, and Shortcuts

    There are a number of tricks and shortcuts you can use in your macros to make them go a bit further within the 255 character limit. For example, /cast and /use function exactly the same way. So in our initial example, you could instead write it as:#showtooltip
    /use Flash Heal
    to shorten it by 1 character.

    Similarly, certain conditionals imply other conditionals. For example, [exists] means "if I have a target". [help] means "if I have a friendly target". Thus [help] implies [exists]; if you have a friendly target, it is obvious that you have a target. Thus only the [help] condition is needed.

    Additional whitespace and punctuation are not needed in the macro interface. /use [help]Flash Healis the same as /use [help] Flash Healremoving additional whitespace can be helpful with complex macros when trying to stay below the 255 character limit.

    Multiple modifiers can be used in the same macro command. For example, the following macro combines all useful teleport spells for a mage, including hearthstones, and blink, into a single line:#showtooltip
    /use [mod:ctrlaltshift]Teleport:Shattrath;[mod:ctrlalt]Teleport:Dalaran;[mod:ctrlshift]Teleport:Stormshield;[mod:altshift]Teleport:Vale of Eternal Blossoms;[mod:ctrl]Teleport:Stormwind;[mod:alt]Garrison Hearthstone;[mod]Hearthstone;Blink


    Certain abilities can be macroed together to be used at the same time - provided they don't incur a Global Cooldown. Common examples are Trinkets, Potions, DPS Cooldowns, Interrupts, Tank's Active Mitigation, among others. Example:#showtooltip Trueshot
    /use Potion of Deadly Grace
    /use Blood Fury
    /use 13
    /use 14
    /use Trueshot
    In this case, the idea is to pop all your DPS cooldowns at once, ensuring maximum benefit (particularly during Bloodlust, or a phase where a boss takes increased damage). Another possible usage would be to add a strong DPS ability, like Marked Shot, ensuring that your DPS cooldowns are used as many times as possible to maximum effect. Abilities that can be used in this way are different for every class/spec, so experiment! If you report off-GCD abilities in this thread, I will compile a list in one of the later posts.

    www.macroexplain.com - great resource for players writing macros, particularly those who are inexperienced. You copy and paste your macro into this web site, and it will tell you, in plain text, what the macro will do. It will also let you know how much room you have to expand the macro, if you go over the 255 character limit, and if you have any errors. This site does have some limitations: it is not up to date on many of the more recent syntax changes (/cast and /use being functionally identical, for example), and it is missing a large amount of spell data, but the basic functionality works very well.

    http://wow.gamepedia.com/Making_a_macro - Very useful writeup of a lot of the information contained in this guide. Like this guide, primarily aimed at users new to the macro system, but there may be some helpful tips for veteran players as well.

    http://wow.gamepedia.com/Useful_macros_for_rogues (or any other class) - Not necessarily the most up to date, but can be a great jumping off point for class-specific macros. A handy Rogue macro (for example) combines Pickpocket with Ambush, ensuring that you pickpocket enemies as you open from stealth. Be aware that many of the macros you see on sites like this may not be updated for Legion.

    PvP Targeting can be tricky - you want to be able to easily TAB target, but with pets, guardians, and totems around it can be difficult to select the target you actually want to attack. This macro will swap your TAB key between "Target Enemy" and "Target Enemy Player":/run local T,t,P,m="TargetNearestEnemy","TAB","Player"," is now set to "if GetBindingAction(t)==T then SetBinding(t,T..P)print(t..m..T..P)else SetBinding(t,T)print(t..m..T)end
    7. Off-GCD Abilities.

    This section is simply a list of off-GCD abilities for each class that can be macro'd with other abilities. I do not have updated information since the release of Legion, your help is appreciated in getting this up to date! Please add new posts to this thread listing off-gcd abilities for your class and spec if you would like to help.
      DEATH KNIGHT
    • Blood
    • Frost
    • Unholy

    • DEMON HUNTER
    • Havoc
    • Vengeance

    • DRUID
    • Balance
    • Feral
    • Guardian
    • Restoration

    • HUNTER
    • Beast Mastery
      - Aspect of the Cheetah
      - Aspect of the Turtle
      - Aspect of the Wild
      - Bestial Wrath
      - Counter Shot
      - Disengage
      - Exhilaration
      - Feed Pet
      - Feign Death
      - Misdirection
      - Binding Shot (Talent)
      - Intimidation (Talent)
      - Volley (Talent)
      - Stampede (Talent)
      - Aspect of the Chameleon (Tome)
      - Play Dead (Tome)
      - Wake Up (Tome)
    • Marksmanship
      - Aspect of the Cheetah
      - Aspect of the Turtle
      - Counter Shot
      - Disengage
      - Exhilaration
      - Feed Pet
      - Feign Death
      - Misdirection
      - Trueshot
      - Sentinel (Talent)
      - Binding Shot (Talent)
      - Camouflage (Talent)
      - Volley (Talent)
      - Aspect of the Chameleon (Tome)
      - Play Dead (Tome)
      - Wake Up (Tome)
    • Survival
      - Aspect of the Cheetah
      - Aspect of the Eagle
      - Aspect of the Turtle
      - Exhilaration
      - Feed Pet
      - Feign Death
      - Muzzle
      - Snake Hunter (Talent)
      - Camouflage (Talent)
      - Aspect of the Chameleon (Tome)
      - Play Dead (Tome)
      - Wake Up (Tome)

    • MAGE
    • Arcane
    • Fire
    • Frost

    • MONK
    • Brewmaster
    • Mistweaver
    • Windwalker

    • PALADIN
    • Holy
    • Protection
    • Retribution

    • PRIEST
    • Discipline
    • Holy
    • Shadow

    • ROGUE
    • Assassination
    • Outlaw
    • Subtlety

    • SHAMAN
    • Elemental
    • Enhancement
    • Restoration

    • WARLOCK
    • Affliction
    • Demonology
    • Destruction

    • WARRIOR
    • Arms
    • Fury
    • Protection


    This section is a work in progress, expect it to have much more information in the near future.
    8. More to come

    This post is becoming a much larger undertaking than I had initially intended. I want to make sure I do it right, so I will leave it here for this evening, and will continue updating it tomorrow. Please leave feedback on what is good/bad/missing, and I will adjust accordingly.
    9. FAQs. No questions yet, so no FAQs.

    Post any questions in this thread and I will list common questions and answers here.
    10. Reserved.

    Reserved for additional information at a later date..
    No, I didn't read thru it all as I don't really use macro's but for those that do, I hope this gets a sticky. It seems to be full of needed information for newish to macro users.
    Oh I have one I'd like you to add. Going into more detail about modifiers. It would be helpful to note.

    For example:
    #showtooltip
    /cast [mod:alt, mod:shift] War Stomp; [mod:ctrl,mod:shift] Divine Protection; Avenger's shield


    I know people who DON'T know you can use multiple modifiers in a single macro. Using this macro I was able to get every spell in my book down to 6 action buttons.
    I've just got back home and made some edits that I failed to do on my iPhone. I also have another macro I'd like to add.

    This macro changes based on your current talent choice:
    #showtooltip
    /use [talent:2/1] Spell1;[talent:2/2] Spell2;[talent:2/3] Spell3


    Just change the Spell1 etc. with the spells that are in your talent page
    02/02/2015 09:27 AMPosted by Gathopally
    Oh I have one I'd like you to add. Going into more detail about modifiers. It would be helpful to note.

    For example:
    #showtooltip
    /cast [mod:alt, mod:shift] War Stomp; [mod:ctrl,mod:shift] Divine Protection; Avenger's shield


    I know people who DON'T know you can use multiple modifiers in a single macro. Using this macro I was able to get every spell in my book down to 6 action buttons.


    You can actually simplify this macro to the following:

    #showtooltip
    /cast [mod:alt/shift] War Stomp; [mod:ctrl/shift] Divine Protection; Avenger's Shield

    Something to keep in mind as you only have 255 characters available maximum.
    @ Kavain:
    Oh okay thanks. I might do that. I just kept the spaces so it was easier to read. That's what I do with html so that it's easier to find anything that's needed... lol but yeah i think i've gotten the hang of it :P
    02/02/2015 02:24 PMPosted by Kavain
    02/02/2015 09:27 AMPosted by Gathopally
    Oh I have one I'd like you to add. Going into more detail about modifiers. It would be helpful to note.

    For example:
    #showtooltip
    /cast [mod:alt, mod:shift] War Stomp; [mod:ctrl,mod:shift] Divine Protection; Avenger's shield


    I know people who DON'T know you can use multiple modifiers in a single macro. Using this macro I was able to get every spell in my book down to 6 action buttons.


    You can actually simplify this macro to the following:

    #showtooltip
    /cast [mod:alt/shift] War Stomp; [mod:ctrl/shift] Divine Protection; Avenger's Shield

    Something to keep in mind as you only have 255 characters available maximum.


    Actually, this is incorrect. [mod:ctrl, mod:alt] means ctrl AND alt, while [mod:ctrl/alt] means ctrl OR alt. To shorten the macro, use [mod:ctrlalt].

    Adding the multiple modifiers to the Tips & Tricks section.

    02/02/2015 02:22 PMPosted by Gathopally
    I've just got back home and made some edits that I failed to do on my iPhone. I also have another macro I'd like to add.

    This macro changes based on your current talent choice:
    #showtooltip
    /use [talent:2/1] Spell1;[talent:2/2] Spell2;[talent:2/3] Spell3


    Just change the Spell1 etc. with the spells that are in your talent page


    Adding [talent] to the conditional post.
    Oh i thought he was talking about the spaces. But yeah one is for both buttons the other is with one or the other.
    Anyone else have helpful tips I missed? I think I've pretty much covered all the bases, but want to make sure this remains relevant and helpful.
    The stance numbers for rogues are 0: no stance, 1: stealth, 2: vanish, 3: shadow dance.

    Join the Conversation

    Return to Forum