World of warcraft advanced macros

World of warcraft advanced macros DEFAULT

Macros: Essential Information

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

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 further down.

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.

As the macro system is continually updated with new patches, and new discoveries are made about how certain commands and conditionals work, I will do my best to keep this thread up to date with current information.

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 /


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 list of many possible slash commands available to the default game client. If you want to see a full list, you can pull it directly, in-game, with a script below in the Tips and Tricks section of the guide. 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 (e.g. ).

There is also a special macro command, . 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.


This macro, when placed on your action bar, would function exactly the same as dragging the spell Heal from your spellbook.

One other special command is , which can be used to click on UI elements, such as action bars or pop up buttons. This can be very helpful when trying to keybund UI actions not visible in the default keybinding UI. Another powerful use would be conditional branching for scripts, which enables you to do some pretty advanced stuff.

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 (e.g. chat) can be delayed with an addon.

Conditionals are a way to extend the macro interface. They allow limited decision-making to macros; be aware that they are limited to what Blizzard has specifically allowed for each command, and that not all commands may accept the same conditionals.

As an example, let’s take the simple macro from earlier:

We are going to modify this macro with the conditional, so it does something different when an enemy is targeted:

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:

The macro will now use Holy Fire if you are pressing a modifier (Ctrl, Shift, or Alt) and you have an enemy target, Smite if you have an enemy target and are not pressing a modifier, Heal if you are pressing a modifier without an enemy target, and Flash Heal if none of the other conditions are true.

It is important to remember the proper syntax when using multiple conditionals. would require you to be in combat and holding a modifier, while would only require one or the other.

Another important feature of conditionals is the ability to use an empty conditional, . Empty conditionals function exactly as if you had dragged the spell from your spell book, meaning they will respect your auto-self-cast settings, and will properly alert you if a target is required rather than silently failing without a target. They also serve as a fallback option to ensure a tooltip is generated if other conditions are not met.


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 ) can be inverted with no, meaning , , etc, will work exactly as you’d expect.

Attempts to perform the action on the listed unit, unit can be a UnitID (player, target, focus, 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 (e.g. Jaina-KulTiras, Zekhan-Vol’Jin, etc). A full list of UnitIDs is available at WoWPedia.

Casting a spell in this way will allow you to target one unit and cast the macro’d spell at something else. For example, you could set the tank as your focus, and use to cast Misdirection on the tank while still targeting the enemy.

A special unit is , 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.

Note that assumes the unit is there unless you specifically check for it. Use to check for enemies, to check for friendlies, or to check for either.

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

This checks which mouse button you used to click the macro. is implied by default, but you can specify for right click, for middle click, and 4/5 for side buttons on your mouse.

  • , , ,

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

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.

/use [combat]Aspect of the Cheetah;Brown Ram

The above macro 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.

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 a Potion of Concealment if not:

/use [talent:3/3]Camouflage;Potion of Concealment

  • , ;

This is largely a legacy feature as of 8.0 for the vast majority of classes, but Druids and Rogues can still use this to great effect. These check if you are in a stance or form, with specifically checking for Stealth (or Prowl, for Cat Form Druids). and are functionally identical, so you can use either or to look for a Druid’s Bear Form. Rogues also have additional stances, with rogues using additional for Vanish and for Shadow Dance.

I’d like to get a table set up here for easy reference, but don’t play any classes with forms. Any help would be appreciated.

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

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

This checks which of your specializations you are currently in. through 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.

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.

  • , ,

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

This indicates if you are channeling a spell, like Rapid Fire, Mind Flay, Blizzard, or Soothing Mist. You can use 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. A great usage here is to invert the conditional, which will allow you to spam your abilities near the end of a channel without clipping it early.

  • , ,

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

  • , ,

These indicate your current movement status. checks if you are on a mount of any kind, checks if you are on a flying mount AND flying in the air, and checks if you are in a body of water, regardless of whether or not you are submerged or at the surface.

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, calculating variables and returning the result (e.g. How many glyphs do I have left to learn?), or making non-protected spell casts (e.g. 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.

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.

There are a few changes to the macro system specific to WoW Classic. For the most part, the API is unchanged, and live macros should work in most cases.

NEW: Spell Ranks

  • Classic WoW returns to the ranking system for spells. Most spells with an absolute value effect (read: not percentage-based) have multiple ranks, which cost an increasing amount of mana (and sometimes have a longer cast time) for higher ranks. Some spells (primarily buffs) are level restricted for certain ranks, (You can’t buff a level 1 character with max rank Blessing of Might or Power Word: Fortitude). Use spell ranks in macros like so:

    • will cast Spell at the highest possible rank for that target. For offensive spells, this will always be the highest rank. For beneficial spells, this will be the highest rank depending on target level.
    • will cast Spell at the specified rank. This is primarily useful for healers to conserve mana, or if you have an offensive spell that applies a debuff and you want the debuff effect but not necessarily the spell damage. Rank 1 Frostbolt for Mages is a common tool for kiting as the mana cost is lower and the cast time is shorter than higher ranks.

REMOVED: Focus (UnitID)

  • In Classic, Focus (and related unitIDs, like focustarget) is not recognized as a valid target for spells.
  • This means that you will need to target the unit you want to cast at. You an use other unitIDs like targettarget, pettarget, or party1target, but this is less reliable as the intermediate unitID can swap to a different target.
  • Mouseover is generally a better option as it is 100% within your control, but it does take more coordination and mouse accuracy than Focus macros from BfA.

REMOVED: Reticle Targeting (Conditionals)

  • In Classic, reticle (ground targeted) spells require two keypresses to activate. The first press will bring up the targeting reticle, and the second press will cast the spell.
  • This is a change from BfA, where you can use to immediately drop the spell on your mouse, or to immediately drop the spell on yourself.
  • There is no effective workaround for this issue, though it may be helpful to bind these types of spells to additional mouse buttons (Mouse3 (wheel click), Mouse4 (forward), Mouse5 (back), or other buttons as available depending on your mouse), as that doesn’t require the use of both hands to cast a single spell.

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. Take a look at some of the examples below, and feel free to submit your own in a reply.

  • and can be used interchangeably in most situations (with preferring items and preferring spells, if you have a spell and an item with the same name). So in our initial example, you could instead write it as: to shorten it by 1 character.

  • Certain conditionals imply other conditionals. For example, means “if I have a target”. means “if I have a friendly target”. Thus implies ; if you have a friendly target, it is obvious that you have a target. Thus only the condition is needed.

  • Additional whitespace and punctuation are not needed in the macro interface.
    is the same as . Removing 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 a number of useful teleport spells for a Mage, as well as Hearthstones, and Blink, into a single line:
  • You can use the following script (courtesy of @Ehiztari) to pull an up-to-date listing of all the slash commands available to your client at any time. These commands can then be used in macros.
  • I will put some info about off-GCD abilities here, but need to do some research before I write this up as I am not familiar with the BfA changes for anyone other than Hunters.

  • This is a 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, and it is missing a large amount of spell data, but the basic functionality works very well.

Okay, that should be all the (still relevant) content from the original thread, migrated to the new forum and taking full advantage of the new markdown syntax. If anyone has suggestions for adds/changes, please let me know.

Changelog 20200110:

  • Clarified the functionality of with an example.

Changelog 20200105:

  • Added caveat regarding requiring an existence check to function properly.


If a spell is on cooldown, use another one

One-Button Macro for Multiple Consumables?

Just discovered Macros

Need Macro Plz, help!

Question about Stopmacro

IF/ELSE macro

Making a macro to "Cast x if possible, but if not cast y"

[Classic] Pet Attack/Follow with Target Switch Macro

Classic warrior macro help

2 skills in one macro?

Macro Dummy

Hi i was wondering will this macro get me banned?

Pterrordax Swoop & Goblin Gliders

Putting Apocalypse in a castsequence macro

Simple cast priority macro

Official Manual for Macos

Question about advanced Macros

How to make a cast sequence target macro?

Castsequence macro reset


Specific fishing macro question

Nature's grace: Wrath, Starfire override macro

I don't understand how multiboxing is different that botting

Arcane Barrage Macro

Unholy Assault + Festering Strike macro

Hunter Macro Help

Macro help

Wep swap in combat rotation help

Classic Warrior Macro Help

Macro on Friendly Target

Prowl, Shadowmeld and VOP

Just wishing

New to macros

Unholy DK Pet Macro Autocast Help

Engineering item macro

Delay chat macro

Druid flight form to prowl macro help

Are these macros possible?

Hunter Macro Help

Macro to Cast Spell if Other Spell Fails to Cast?

Quick question about making a Macro for different pets out

Bear/Roar Macro

Combining skills help

If/then/else macros?

Macro request (Druid)

Prayer of Mending Macro

Shadow Dance/BS macro?

How to make a macro to missdirect?

Macro to intimidate if counter shot is on CD

MM advices?

Weapon swap ability macro

Looking for a Focus Target Macro

CD/Filler mix Macro

Help with priest macro please

Soulshape Druid Macro

BM Hunter's New Legendary

Misdirect Macro for MM Hunters

Question about potential macro (or something else)

Help with macros

Pally macro help

Macro para Heal

Help with a trinket macro

Macros sssss

LF Blind macro!

Hunter Macros

Macro Question

Blessing of Seasons & Wings/GCD

Cobra Shot, Barbed Shot macro

Need help with a Hunter macro, if it's even possible

How to make a macro to missdirect?

Why Blizz?

Macro to cast when moving

Plz help, shift macro dependent on talent

Cast sequence macros are god's gift to humanity

Help with making a macro cycle two different things

Arcane Shot to Chimaera shot

Mouseover Macros

Druid Bear Form / Thorns / Frenzied Regen macro

Is it possible to have Regrowth and Rake in a single macro?

Rogue free ambush with mutilate

Conditional for casting when ability is on cooldown?

Self Heal macro

Is there a #showtooltip conditional?

SOLVED: Quick question about the [mod:___] part of a macro, and if what I'm looking for is possible

Is it possible to have a macro check a resource and have and or functionality?

Need "#showtooltip" help from a Macro God please!

New BM Hunter - Advice on PvE Macros plz

Macro that targets enemy with lowest hitpoints?

13 year player first time keybinder/macro

Holy shock smart heal question

WOW World PVP Survival Guide

Noob macro help please

Gearset Equip Toggle?

Hunter's Mark Macro

Macros for Lunar Fire and Sun Fire, and bear form (Druid)

Macros documentation

Please help with macro - Feral

Death From Above Macro

Macro help - Noob

Iso help for a Feral Lunge + Feral Spirit Macro

Druid Macro help?

Help with a macro

Scripts please

Macros in vanilla wow

Healthstone > Health potion

Delete please

Is there a way to cast an aoe at a set distance away with a button?

Macro to intimidate if counter shot is on CD

May a macro behave differently based on mounted or not?

Conditional cooldown based casting in addons

Classic warrior macro help

Demon core macro?

Refreshing icons for Key modifers

Help with priest macro please

Rag stance dance/intercept MACRO : need help

Angelic Feather


Hacking WoW: Creating Advanced Macros

This is the first half of the chapter “Creating Advanced Macros” in the ExtremeTech book “Hacking World of Warcraft.” It will provide you with a fundamental understanding of macros, such as how to use them, cast multiple macros, and so on. Also, check out our two previous excerpts from this book: 14 Add-Ons that Give You an Edge and Custom Interfaces and other Tweaks.

Macros have been around since the beginning of the game, but
they’ve taken on a completely different shape and function
with the release of The Burning Crusade expansion.
Formerly, macros made complex decisions in combat by utilizing blocks
of Lua code. That’s no longer possible. However, a new host of slash
commands has been added to replace (and in some cases improve) the lost
functionality. These commands allow Blizzard a greater degree of control
over what can and can’t be done from within a macro.
This chapter describes in detail what’s currently possible with the
revamped macro system, as well as what was intentionally disabled.

What’s the Point of a Macro?

Macros provide a way for the average user to program action buttons to do
different things without needing to download a full-scale addon. Macros
are often used to reduce the strain of performing a repetitive task. They
also are used to make certain kinds of decisions based on the state of your
character, and then act accordingly. The game provides a macro-editing
window, which can be used to create new macros. The complexity of macros
ranges from the simple Polymorph script introduced to you in Chapter 1
to something as complex as the macro discussed next. In general, macros
are never more then a few lines long (there’s a 255-character limit), although
there are some addons that allow you to create longer macros.

Consider the following Warrior-specific macro:

/cast [nocombat,stance:1] Charge; [combat,nostance:3] Berserker Stance; [nocombat,notstance:1] Battle Stance; [combat,stance:3] Intercept

This macro performs the following checks in order:

  1. If not in combat and in Battle Stance, cast Charge.
  2. If in combat and not in Berserker Stance, cast Berserker Stance.
  3. If not in combat and not in Battle Stance, cast Battle Stance.
  4. If in combat and in Berserker Stance, cast Intercept.

It is designed to let the Warrior use a single button to shift into the right stance, based on
whether he’s in combat, and then cast either Charge or Intercept, again depending on stance
and combat status. The macro can perform only one of the listed actions when run, so it may
need to be run twice in some cases: once to change stances, and again to cast the spell. Continued…

  1. Black outdoor seat pads
  2. Swirly line copy and paste
  3. 2020 halloween svg

Thread: Advanced Macros

Hi all!

I've been an inactive leecher for over a year now here on MMOwned and it's time to contribute. Just a small boring introduction, I'm an addon author, Lua expert and macro guru. I'm sorry if this post is in the wrong section or if it's a repost(I did make every macro here myself though). I hope you enjoy! /end small boring introduction.

Macro #1
This macro will try to use conjured mage refreshment first, after that your own food and if you don't have that one it will try to use the arena water. For editing the macro, the red number is the item ID of the mage refreshment, the green number is the item ID of your own food and the yellow number(all the way in the back of the macro) is the ID of the arena water.


/stopmacro [combat] /run local d,c,i,f=33445,43523,"item",f82Ht or CreateFrame("Button","f82Ht",nil,"SecureActionButtonTemplate")f.s=f.SetAttribute;f.s(f,"type",i)f.s(f,i,"item:"..(GetItemCount(c)>0 and c or IsUsableItem(d)and d or 43236)) /click f82Ht

Macro #2(mage)
Tries to eat your conjured food, and if you have less then a certain amount (default 0) of strudels it'll use conjure refreshment. The red number is the item ID of your refreshment and the yellow number is the amount of strudels the macro will start conjuring instead of eating.


/run local c,t,i,s,f=43523,"type","item","spell",G49jS or CreateFrame("Button","G49jS",nil,"SecureActionButtonTemplate")f.s=f.SetAttribute;if GetItemCount(c)>0 then f.s(f,t,i)f.s(f,i,"item:"..c)else f.s(f,t,s)f.s(f,s,GetSpellInfo(42955))end /click G49jS

Macro #3
This little macro will automaticly train all skills at a trainer. Run again to stop.


/run LoadAddOn"Blizzard_TrainerUI" f=ClassTrainerTrainButton f.e = 0 if f:GetScript"OnUpdate" then f:SetScript("OnUpdate", nil)else f:SetScript("OnUpdate", function(f,e) f.e=f.e+e if f.e>.01 then f.e=0 f:Click() end end)end

Have a friend that you always want to wave to? Or a friend that waves at you but you can never catch them before they fly away? Here's a macro that can help you wave to your friend!

On your "Hello" macro, click in the command box and push down what you've written so far (which should be the "/hello" that you typed in earlier) by pushing your [Enter] key on your keyboard. Next, type in:

Be sure to click the "Save" button above the command box to save what you've written, otherwise once you exit the macro interface you will lose what you just wrote. This will macro will now _target_ your friend and give them a hearty hello at
the same time!

Tip: "/target" and "/tar" do the same command. You will see a lot of commands with different ways to write it. Another example is "/emote", which is elso written as "/e", "/em" and "/me". They all do the same thing, but it's up to you, the
player, to write it how you want!

Tip: Another way you can write this macro is by typing "/hello YourFriend'sName".

Another tip: See how you pushed down the "/hello" command and then you typed _"/target ("your friend's name here")_? Remember that macros will always do in order, unless you tell them to go out of order, which we'll get into later. If you
typed in "/hello" before you targeted your friend, it wouldn't have been as effective.

Here's a way to write this if your friend as already flown away and you don't want to give anyone a hearty hello:

What is this "[]" you might ask? This is what a macro calls a "condition". There are a lot of conditions that a macro can contain, it's up to you what conditions the macro looks for. In this case, it looks for if the target exists, and if it doesn't, then the
macro stops. If the target does exist, then I will give my friend a hearty hello! Conditionals are important for telling your macro what to look for. It prioritizes what's important from left to right. For example:

What does this macro do? Let's go through this line by line:

  1. It looks at my command, "/target", after that, it looks at my conditions, which means it's looking for my focus target. If I don'thave a focus target, then it goes to the next best thing, which happens to be "MyFriend".
  2. If neither of those exists, the macro stops completely, but what's this "nodead"? This means if my focus target, my friend or even my current target, isn't dead, then the macro will stop go through with the "/hello". Even if the target doesn't exist, one of the coniditions is true, so the macro will go through.
  3. Last, if all the conditions are met and I have a target to emote to, then I will give my focus target or my friend a hearty hello!

What does this one do? Now the "nodead" is in a condition outside of the "noexists", which matters. This will do the same thing as the previous example, except it says that both conditions need to be true in order for the macro to work.

Here's a shortened way to write this example, except there's a flaw with it, try to guess what it is:

What happens if I use this macro when I don't have a target or my friend around? That's right, it will give everyone around me a hearty hello! But notice how it's written: the command "/hello" is on the same line as the targets I want to say hello to. This is probably more efficient than the other ways of writing it.

Here is my final version of the macro, I've added in another command that will help me if my targets aren't around and I just want to say hello to my focus target or my friend:

What happened when I switched "MyFriend" with "focus"? That's right, now it prioritized if my friend is around, it will target them first, if notthen it will target my focus target and say hello to them. But, if both were in the same place, it would target my friend first! I changed "[nodead]" to "[dead]" because if my friend was around town and they were still alive, the "[nodead]" condition would stop the macro; putting "[dead]" in instead
makes it so that I will wave to them if they're not dead.

You can use macros with almost every function in the game. Read on for a list of some of the commands you can use...


Macros advanced world warcraft of




Now discussing:


85 86 87 88 89