Blizzard Entertainment World of Warcraft
  • UI & MACROS FORUM

  • Forum Nav:
    Jump To This Forum
  • Account

  • Password
  • Help
1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . 10 . 11 . 12 . 13 . 14 . 15 . 16 . 17 . 18 . 19 . 20 . 21 . 22 . 23 . 24 . 25 . 26
70
view posts by this user ignore
  • 0. Cogwheel's Complete Macro Guide - READ 1ST!  |  04/17/2007 03:56:48 PM UTC
    limit-reached limit-reached
THIS THREAD HAS BEEN CONTINUED HERE: http://forums.worldofwarcraft.com/thread.html?topicId=2366703212

Cogwheel's Complete Macro Guide
Last updated: 2005-10-15 22:59 PDT
This guide is also available with better formatting and easier navigation at http://www.wowwiki.com/Making_a_macro

Blizzard has recently started their own official guide to creating macros (http://www.worldofwarcraft.com/info/basics/macroguide-one.html). If you find yourself confused by anything in my guide, take a look at theirs. The different approach may help clarify things. As of this moment, Blizzard's guide only covers a subset of Part I but they will be making additions in the future.

--==≡≡ Table of Contents ≡≡==--
  • Part I: Basic Macros
    • What is a macro?
    • How do I make a macro?
    • How do I cast spells?
      • Notes about spell names and ranks
    • How do I use an item/trinket?
    • Multiple actions with one click
    • Targeting
      • /target
      • Other targeting commands
        • /assist
        • /cleartarget
        • /targetlasttarget
        • /targetenemy, /targetfriend
        • /targetparty, /targetraid
    • How do I control my pet?
    • Controlling button feedback and the question mark (?) icon with #show
    • Other slash commands
      • Equipping items
      • Sequencing spells and items
      • Random spells and items
      • Attacking
      • Action bar manipulation
      • Removing buffs
      • Leaving a form
      • Stopping a cast
      • Halting a macro early
      • Dismounting
      • Simulating button clicks
    • Advanced Scripting
      • What scripts can't do
      • So, what is a script?
  • Part II: Macro Options
    • What are macro options?
    • Commands that accept options
    • [target=unit]
    • Syntax overview
      • General options syntax
      • Condition syntax
      • Empty parameters
      • Empty conditions
      • [target=] vs. unit parameters
    • Conditionals
      • Complete list
      • help & harm
      • exists
      • dead
      • stance
      • stealth
      • modifier
        • modifier variables
      • button
      • equipped
      • channeling
      • actionbar
      • pet
      • combat
      • mounted, swimming, flying, indoors & outdoors
      • flyable
      • party & raid
      • group
    • Using focus
  • Part III: Miscellany
    • Custom Icons
    • Keeping macros on multiple computers
    • More Information
    • Acknowledgments
--==≡≡ Part I: Basic Macros ≡≡==--

What is a macro?

A macro is simply a list of slash commands. I'm sure you are familiar with some of the more common slash commands:
  • /say (/s)
  • /whisper (/w, /talk, /t)
  • /emote (/e, /em, /me)
  • /dance
  • Oh, and for you PvPers out there, I mustn't forget /spit
With macros, not only can we issue commands like these from action buttons, but we can also use many of them at once. Each unique command goes on its own line and is written exactly as you would type it in the chat box. For instance, if you wanted a macro that yelled "Everybody, dance now!" and burst you into dance, you would write it thus:
/y Everybody, dance now!

/dance
A mostly complete list of slash commands is available at http://www.wowwiki.com/List_of_Slash_Commands though at the time of this writing some of the new commands in 2.0 haven't been added. WoWWiki is a great source of additional information for macros, especially scripts using the /run command (which will be covered later).

Note: I will take this early opportunity to let you know that macros run all at once. This means that when you click the button, the macro runs each command from start to finish before returning control to the game. This has two important effects. First, if you write a macro that takes a long time to execute (like /run for i=1, 100000000 do end), the game will freeze for as long as it takes to run the macro.

Second, and arguably more important, there is no way to wait in a macro without freezing the game. This fact will become much more apparent when we start dealing with the /cast command and its ilk. Some addons can provide a way to issue a command at a later time, but they can only be used for "benign" functions like chatting, emotes, and issuing commands to other addons (though equipping weapons in combat is allowed).

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 1. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 03:57:49 PM UTC
    limit-reached limit-reached
How do I make a macro?

First, open up the macro window. You can do this either by opening the main menu and selecting Macros, or by typing /macro (/m) in the chat box. At the top of the window, you'll see two tabs: General Macros and Yourname Specific Macros. General macros are stored on an account-by-account basis and are shared by all your characters. Character specific macros are, well, I think you can figure this one out yourself. :P Immediately under the tabs is a grid of 18 boxes where the macros are displayed. Under those, there is a single box which displays your currently-selected macro with a Change Name/Icon button next to it. Below that is the edit box where you actually type the macro. Finally, at the bottom you have a number of self-explanatory buttons.

To create a macro, click the New button at the bottom of the window. This brings up another small window off to the side where you choose the icon and type a name for the macro. If you choose the question mark (?) icon, WoW will automatically pick an icon for your macro based on what spells or items are listed in the macro. Once you have chosen an icon and a name, click the Okay button.

A few notes: You can control what icon is shown in place of the question mark with the #show commands. Although you can name two macros the same, it is better to avoid this since some functions of addons or even certain macro commands reference macros by name. You can also add custom icons to the list (see the Part III).

Now you will notice that the macro icon you chose has been added to the 18 boxes mentioned earlier (as much of the name as will fit is also displayed on the icon). The newly created macro will also be selected so now it's time to start writing your macro. Click in the edit box of the macro window to start typing.

Note: Macros have a 255 character limit. Rumor has it this is because they intend to store macros on the servers some day. For now, though, see Part III below for information on preserving your macros among multiple computers.

When you are done typing your macro, simply drag its icon from the grid and place it on an action button. The macro will be automatically saved when you first try to use it or when you close the macros window. Click the button, and there you have it!

How do I cast spells?

During the normal course of play, you aren't likely to type many slash commands that are generally useful for macros. Sure, the occasional emote macro can make for some interesting role playing, but c'mon... There's got to be more to it than that...

There is. Enter /cast, the most common command you will see in macros. The /cast command allows you to cast any spell from your (or your pet's) spell book by name. The simplest case is a command like:
/cast Shadow Word: Pain
This macro will cast your highest-rank Shadow Word: Pain on your target. It behaves exactly as if you had dragged SW:P onto that spot on your action bar. The action bar code recognizes the spell and will show cooldown and range feedback on the icon. In fact, if you choose the question mark icon I mentioned earlier, the action bar will even show the icon for SW:P.

"Ho, hum," you might be thinking... Why not just put the spell on your bar? Well, that's where combining multiple commands comes in handy, and this is exactly what makes macros so useful. What if you're a mage and you want to let your party know that you're about to sheep something? Well, simply put the cast & /p message in a macro (there are better macros for this task--[insert shameless plug for my CCWarn (http://www.wowinterface.com/downloads/info6826-CCWarn.html) addon here]--but this is a nice, easy to understand example):
/cast Polymorph

/p Sheeping %t! You break it, you tank it!
Note: Since the macro is executed all at once, the /p command will be issued when you start the cast, and will not care either way whether you have a valid target or whether Polymorph is on cooldown. This also means you can put the two commands in either order and it will have the same effect. If you want to say something only when you actually cast the spell, check out the addon AfterCast (http://www.wowinterface.com/downloads/info4167-AfterCast.html). AfterCast schedules a slash command to run... well... after you cast a spell (within the limitations mentioned at the end of "What is a macro?"). For example:
/aftercast /p Click the portal to get %t's lazy butt over here

/cast Ritual of Summoning

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 2. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:00:49 PM UTC
    limit-reached limit-reached
Notes about spell names and ranks

The /cast command is pretty picky when it comes to your spell name. In order for it to sucessfully cast a spell you must use correct spelling, punctuation, spacing, etc. The best way to guarantee you enter the right name is to open your spell book while writing the macro, place your cursor in the macro where the spell should be, and shift-click the spell in your spell book. This will enter the exact name of the spell including its rank like the following:
/cast Shadow Word: Pain(Rank 5)
You can safely remove the (Rank 5) from the macro and it will automatically pick the highest rank--assuming you want to, of course; there are many situations where it is advantageous to use a particular rank (like specific timing on a Warlock's banish). Beware, though... Some spells with parentheses in their name may need some coddling. For example, using shift-click on a Druid's feral Faerie Fire spell produces the following macro:
/cast Faerie Fire (Feral)(Rank 2)
If you remove the entire (Rank 2), the internal code that translates the spell name gets confused by (Feral) thinking it is a rank and the spell doesn't cast. You will have to change it to the following in order for it to work as expected:
/cast Faerie Fire (Feral)()
The empty parentheses are seen as the rank since they're at the end. Because they're empty, the parser picks your highest rank and casts the spell. You can also use empty parentheses for other spells, but with the 255 character limit, space is definitely an issue.

How do I use an item/trinket?

Simple answer: the same way you cast a spell. The command for using an item is (you guessed it) /use. Like /cast, its simplest form takes the name of the item you want to use:
/use Green Mechanostrider
There are also a couple other forms of the /use command:

/use <inventory slot>

This form of use allows you to use an item in the specified slot. See http://www.wowwiki.com/InventorySlotId for a list of the slot numbers. Example:
/use 13
Uses whatever is in your top trinket slot.

/use <bag> <slot>

You can also use an item in a specific bag location. Lets say you always keep the food you want to feed your pet in the first slot of your backpack. You can easily write a macro to feed your pet as follows:
/cast Feed Pet

/use 0 1
Bags are numbered 0-4 from right to left (0 is always the backpack) and the slots are numbered starting at 1 going left to right, top to bottom (like reading):
1  2  3  4

5 6 7 8
...
or
      1  2

3 4 5 6
7 8 9 10
...
Trading risk of confusion for completeness, I'll let you know that /cast and /use function exactly the same way. /cast can use items and /use can cast spells. This isn't very useful for simple macros like you've seen so far. However, when you start dealing with macro options and sequences you'll be happy to know that you can intermingle items and spells in the same command.

Multiple actions with one click

In general, you cannot cast more than one spell with a single click of a macro. Most spells and some items trigger the global cooldown (GCD) which keeps you from taking too many actions at once. Even if a spell fails to cast, if it would trigger the GCD, it prevents subsequent /casts in the macro from running. This was not the case prior to patch 2.0 which is why you may still come across macros like the following:
/cast Overpower

/cast Execute
/cast Mortal Strike
/cast Sunder Armor
Macros like this do not work anymore. As soon as Overpower fails to cast, the game will block all the other spells from casting as well, even though the GCD is not actually triggered.

There is a bit of good news, though. Certain spells can actually be cast at the same time in a single macro. Any spell that is instant and does not trigger the GCD can be followed by another cast ("Next Melee" abilities like Heroic Strike fall under this category too). The spell's tooltip will tell you if it's instant, but you have to use the spell (or check a spell database site like thottbot.com) to know if it triggers the GCD.

Until patch 2.3 you must to place a /stopcasting command after the instant, non-GCD spells (but not items). The game engine assumes that after the first /cast is attempted, a spell is now in progress. /stopcasting removes this assumption and prevents the "Another action is in progress" error. Since the spell is instant, /stopcasting does not actually cancel the cast. Example:
/use Talisman of Ephemeral Power

/cast Arcane Power
/stopcasting
/cast Presence of Mind
/stopcasting
/cast Pyroblast

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 3. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:01:54 PM UTC
    limit-reached limit-reached
Targeting

Targeting is another common task in macros. This is accomplished either by using dedicated targeting slash commands which actually change your target or by using the [target=] macro option on commands that accept them. When you use the macro option, you are actually casting the spell or using the item directly on the unit without changing targets. Macro options will be covered in great detail in Part II. For now, I'll show you how to use the targeting commands.

The most basic targeting command (unsurprisingly) is /target. Its use is as simple as
/target Cogwheel
/target does a closest match which means if you do /target Cog and I'm standing near you (and no one named Cog is) it will target me. This is a plus or a minus depending on your situation. Unfortunately, it will also target irrelevant units (like corpses). This makes macros like the following much less useful than they might first appear.
/target Blackwing Mage

/cast Curse of Agony
If no Blackwing Mages are around, this might target someone in your raid who happens to have the letters B and L in their name. While they're safe from the wrath of your curse, it's still a bit disconcerting. Another problem is that it may target something 100 yards behind you that you don't really care about. (Patch 2.3 will add a /targetexact command to eliminate part of the problem.)

In addition to specifying the name of someone you would like to target, you can also provide a unit ID. Unit IDs are a way to identify a particular character, mob, NPC, etc. For instance, your current target can always be accessed by the "target" unit ID (obviously not the most useful for the command we're discussing at the moment :P). You yourself are accessed by the "player" ID, and if you have a pet it would be referenced by "pet." You can also append "target" to the end of any valid unit ID to arrive at that unit's target. There is a joke about Kevin Bacon involving a macro like:
/target targettargettargettargettargettarget
http://www.wowwiki.com/UnitId has a full list of allowed IDs.

Other targeting commands

Here is a brief overview of the other targeting commands:

/assist

By itself, assist targets your target's target (e.g. if you are targeting me, and I'm targeting Iriel, /assist would make you target Iriel). You can also provide a name or unit to /assist and you will assist the specified entity:
/assist Cogwheel 
There is an interface option which will automatically start you attacking if you end up with a hostile target.

/cleartarget

Leaves you with no target

/targetlasttarget

As the name suggests, this will target your previous target. If you previously had no target, this command will do nothing.

/targetenemy, /targetfriend

These commands cycle through the specified type of unit. /targetenemy is like pressing TAB, and /targetfriend is like pressing CTRL-TAB (in the default key bindings). You can also add a parameter of 1 which reverses the direction of the cycle (/targetenemy 1 is like pressing SHIFT-TAB).

Note: You can only use these commands once per macro.

/targetparty, /targetraid

Cycles through your nearest party or raid members. Like /targetenemy, you can add a 1 to reverse the direction.

How do I control my pet?

As mentioned in the spell casting section, you can use /cast to cast your pet's abilities by name. In fact, Blizzard had to change the name of the Mage elemental's Frost Nova to Freeze because there was no way to use it in a macro. :P But as everyone with a pet is aware, that's nowhere near the end of the line for pet control. Luckily the Burning Crusade patches brought us a host of new pet commands.

/petattack, /petfollow, /petstay, /petpassive, /petdefensive, and /petaggressive all correspond to the basic control commands on your pet bar. Additionally we have /petautocaston <spell> and /petautocastoff <spell> which activate or deactivate, respectively, your pet's auto cast for the named spell. There is no command to toggle auto-cast, but see "Simulating button clicks" below for a workaround (patch 2.3 will add /petautocasttoggle).

Controlling button feedback and the question mark (?) icon with #show

By default, WoW uses the first spell or item that appears in a macro to show cooldown, range, and availability feedback on the button, and to pick which icon to display when you use the question mark icon. Take our multi-spell macro from earlier as an example:
/use Talisman of Ephemeral Power

/cast Arcane Power
/stopcasting
/cast Presence of Mind
/stopcasting
/cast Pyroblast

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 4. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:02:57 PM UTC
    limit-reached limit-reached
With this macro, WoW chooses Arcane Power for the feedback. However, this is probably not what you really want. The main point of this spell is to cast Pyroblast. The first few lines merely exist as support spells to make the Pyroblast more effective. You can make the button behave as if Pyroblast were the first spell by adding the following line to the top of the macro:
#show Pyroblast
If you used the question mark icon for the macro, the button will even have the icon of Pyroblast without any extra effort on your part. The parameter to #show (in this case Pyroblast) works the same way as the /cast and /use commands. You can use a spell name, item name, item id (item:12345), inventory slot, or bag and slot numbers.

Similar to #show is #showtooltip. Normally when you mouse over a macro on an action bar, your tooltip displays the name of the macro. This is not incredibly useful most of the time (especially if you use an addon like TheoryCraft to give you detailed spell information in tooltips). However, the #showtooltip command allows you to specify a spell to use in the tooltip the same way as #show. If you use #showtooltip, you do not need to use #show.

If you're happy with the spell that WoW is choosing for the feedback, you can use #showtooltip without a spell to save space in your macro. WoW will still use whichever spell it was choosing before, but it will now show the tooltip info for that spell/item.

Please Note: unlike slash commands, #show and #showtooltip must be written in lower case letters.

Other slash commands

Now that you have a solid foundation I'd like to briefly cover some of the other slash commands at your disposal. Some of these commands may seem a bit pointless at first glance, but when you combine them with the macro options from Part II, they can perform some neat tricks.

Equipping items

There are two commands for equipping items: /equip and /equipslot. /equip simply takes an item name and will equip it to the default slot as if you had right-clicked it in one of your bags (i.e., a one-handed weapon will be equipped to your main hand). /equipslot takes an inventory slot id (see http://www.wowwiki.com/InventorySlotId) and an item name, and equips the item to the specified slot. Examples:

Equip a weapon to default slot:
/equip Honed Voidaxe
Equip a trinket to the lower trinket slot:
/equipslot 14 Carrot on a Stick
Note: Addons are allowed to use the equipping functions directly, even during combat. By the same mechanism, you can use the equipping slash commands with addons like AfterCast or Chronos. You might have some trouble if the addon first checks whether the command is secure; the equipping commands are in the secure command list, though they aren't inherently secure.

Sequencing spells and items

Many times you will find yourself casting a series of spells or use certain items in the same order on pretty much any mob you fight. To make this job a bit easier, we have the /castsequence command. /castsequence takes a list of spells and/or items separated by commas. These follow the same rules as /cast and /use. This means you can interchange spell names, item names, item IDs, inventory slots, and bag slot combinations. Each time you run the macro, it activates the current spell/item. If the spell or item is used successfully, the sequence will move to the next entry. You must repeatedly activate the macro to use all the spells in the sequence. Once you use the last entry in the list, it will reset to the beginning. Example:
/castsequence Immolate, Corruption, Curse of Agony, Siphon Life
This might be something you would use for a Warlock's opening attack. Note, however, that if Immolate fails to cast for some reason (out of mana, not in range, silenced, etc.), the sequence will remain at that point. Because of this, you cannot use a /castsequence to make a spammable macro like:
/castsequence Overpower, Execute, Mortal Strike
Before the spell list, you can also specify reset conditions to start the sequence over before it reaches the end. The basic syntax for reset conditions is:
reset=n/target/combat/shift/alt/ctrl
Where n is a number of seconds. You can specify any number of these conditions separated by slashes as shown. Seconds are used as a timeout for the command. Each time the sequence runs, it resets the timer. If you don't use the macro within the number of seconds specified, the sequence will start over. This is a very important distinction because it means you cannot use a reset timer to account for cooldown. target resets the sequence when you change targets; combat when you leave combat; shift, alt, and ctrl when you activate the macro with one of those keys depressed. Example:
/castsequence reset=10/shift Spell 1, Other Spell, Some Item

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 5. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:03:58 PM UTC
    limit-reached limit-reached
If you used the question mark icon, WoW will automatically update the icon to the current element of the sequence. If you have other /casts or /uses before the /castsequence, though, they will interfere and there is no way currently to tell WoW to pay attention to the sequence instead.

Random spells and items

One of the most common requests on this forum is for a macro to use a random mount. This is extremely trivial thanks to the addition of /castrandom and /userandom. Like /castsequence, /castrandom and /userandom takes a list of spells and/or items separated by commas and picks one at random when you run the command. Example:
/castrandom Swift Green Mechanostrider, Black Battlestrider, Summon Dreadsteed 
Attacking

The simplest attack command is /attack. This functions identically to the attack skill or key binding and will toggle your attack. If you'd rather have an "always start" or "always stop" attack, you can use /startattack or /stopattack, respectively. Both /attack and /startattack can take a name or unit ID to specify who to attack. Example:
/attack Cogwheel 
Action bar manipulation

There are two commands that allow you to change action bar pages: /changeactionbar and /swapactionbar. /changeactionbar takes a single number and will always switch to that page. One use of this is for hunters to emulate stances by having a pair of macros like:
/cast Aspect of the Hawk

/changeactionbar 1
and
/cast Aspect of the Monkey

/changeactionbar 2
/swapactionbar takes two page numbers and will swap between them each time it runs. If you're on a page other than one of the two specified, it will be change to the first of the two.
/swapactionbar 1 2
Removing buffs

The /cancelaura command allows you to remove unwanted buffs. For example, a tank could remove an unwanted buff in a macro with the following command:
/cancelaura Blessing of Salvation 
Leaving a form

With the exception of Warriors, any class with stances (Druids, Priests with Shadowform, etc.) can use /cancelform to leave their current form. See the stance section of Part II for an example.

Stopping a cast

/stopcasting has been touched on briefly in other contexts but its main use, as you might guess, is to stop another spell cast that's in progress. This is useful for making "panic buttons" that interrupt whatever you're doing at the moment in favor of something more important. On my Warlock, for instance, I use the following macro:
/stopcasting

/cast Shadowburn
Halting a macro early

/stopmacro is one of those commands that doesn't really come into its own unless you use it with macro options. Its main use is to implement "fall-through" logic to prevent you from continuing a macro if certain conditions are true. See "Using Focus " for an example.

Dismounting

/dismount

'nuff said...

Simulating button clicks

The /click command takes the name of a frame and virtually clicks the frame with your mouse. By default, it behaves like a left-click, but you can specify other mouse buttons in the command. To determine the name of the frame you're interested in, you can use an addon like MoveAnything, look through the UI code for the frame, or activate the following macro by a key binding with your mouse over the frame in question:
/run local f = GetMouseFocus(); if f then DEFAULT_CHAT_FRAME:AddMessage(f:GetName()) end
/click can be used for many different purposes. You can chain macros together by ending each with a /click command that activates the next macro in the sequence. You can also do things you wouldn't normally be able to do with macros. For instance, there is no command to toggle your pet's auto-cast abilities (until patch 2.3). However, you can use /click to reproduce a right-click on the given button (the fifth one in this example):
/click PetActionButton5 RightButton
Advanced Scripting

What scripts can't do

Scripts are very powerful tools that can make complex decisions based on a number of criteria. Because of this power, Blizzard has limited the types of things we're allowed to do with them in order to keep macros and addons from taking actions that should be controlled by the player. I'm starting this section with what you can't do because I don't want you to get your hopes up. While scripts do remain useful for quite a few purposes, you cannot use them to cast spells, use items, change your action bar page or affect your target in any way. You are limited to using the "secure" commands already shown for those tasks.

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 6. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:05:13 PM UTC
    limit-reached limit-reached
So what is a script?

The WoW UI is controlled by code written with the Lua scripting language. You can take advantage of this scripting system in a macro with the /run command (equivalent to /script--I use /run to save a few characters). The whole script must be on one line, though you can have multiple /run commands in a single macro.

A full treatment of Lua and programming in general is well beyond the scope of this document. However, if you have some programming experience, you should head over to http://www.lua.org/pil/ to learn the basics of Lua and if you don't have any programming experience, you may want to check out http://pine.fm/LearnToProgram/ to get a foundation of the concepts used in scripts.

Blizzard provides many functions (called the API) which the Lua scripts can use to control the UI. You can view the API and other features of the UI system over at http://www.wowwiki.com/Interface_Customization (if you spend any considerable time with scripts and/or addons, WoWWiki will be indispensable). I can't possibly cover all the details of the UI environment, so I will simply present you with one of my favorite scripts as an example. See the previously linked references and the Mod Author Resources sticky (http://forums.worldofwarcraft.com/thread.html?topicId=11381244&sid=1) for more information.

The following macro (on which I based my CCWarn addon) will whisper everyone in your raid to change their targets if they have the same target as you. This is to help keep them from breaking the sheep that this macro casts as well.
/cast Polymorph

/run for i=1,GetNumRaidMembers()-1 do local u,t="raid"..i,"target"if UnitIsUnit(u..t,t)then SendChatMessage("Change targets! Trying to sheep...","WHISPER",nil,UnitName(u))end end
There are two reasons that it looks as obfuscated as that. First, there is the 255 character limit; you often need to take certain shortcuts in order to get a script to fit in a macro. Second, you have to keep the entire script on one line. Under more ideal circumstances, that code would look more like:
for i = 1, GetNumRaidMembers() - 1 do

local unit = "raid"..i
if UnitIsUnit(unit.."target", "target") then
SendChatMessage("Change targets! Trying to sheep...", "WHISPER", nil, UnitName(unit))
end
end
--==≡≡ Part II: Macro Options ≡≡==--

What are macro options?

Macro options are a way to control actions based on various pieces of information. To dive right into an example, the following macro will cast Renew on a friendly target and Shadow Word: Pain on a hostile one.
/cast [help] Renew; [harm] Shadow Word: Pain
When you run this macro, the [help] condition is checked. This determines whether your target is someone you can cast beneficial spells on. If the [help] is true, it then casts Renew and the macro moves to the next line. Otherwise (either you have no target, or you can't cast a helpful spell on your target), it falls through to the next clause. Now it checks for the [harm] condition. [harm] is just like [help] but for offensive spells. If true, it casts Shadow Word: Pain. If it isn't true (no target or you can't harm your target) then it does nothing because there are no more clauses.

Note: I could have left the [harm] check out and it would have functioned in much the same way. However, if you have no target or your target can be neither helped nor harmed, you would receive an error message or, depending on the spell, the target selector cursor.

Commands that accept options

Only the "secure" commands respond to macro options. In fact, the secure commands are the reason macro options were created in the first place. Insecure commands like chatting, emotes, etc. can be scripted using Lua and the /run command. Furthermore, Blizzard didn't want to confuse people who use semicolons in their chat messages. If /say could use macro options, the following would always just say "Hello":
/say Hello; I'm a n00b
The following is a list of all the secure commands currently available in WoW:
  • #show *
  • #showtooltip *
  • assist
  • cancelaura
  • cancelform
  • cast
  • castrandom
  • castsequence
  • changeactionbar
  • clearfocus
  • cleartarget
  • click
  • dismount
  • equip +
  • equipslot +
  • focus
  • petagressive
  • petattack
  • petautocastoff
  • petautocaston
  • petdefensive
  • petfollow
  • petpassive
  • petstay
  • startattack
  • stopattack
  • stopcasting
  • stopmacro
  • swapactionbar
  • target
  • targetenemy
  • targetfriend
  • targetlasttarget
  • targetparty
  • targetraid
  • use
  • userandom
* #show and #showtooltip are not technically secure commands, but they operate with macro options just like /use and /cast.

+ /equip and /equipslot are not technically secure since their functionality is available to addons and macro scripts.

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 7. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:06:14 PM UTC
    limit-reached limit-reached
If you would like a way to use macro options for insecure commands, there are addons that provide such capability. My addon, MacroTalk (http://www.wowinterface.com/downloads/info6853-MacroTalk.html), adds a number of /opt___ commands for each chat command and a generic /opt command that lets you use options to choose other full (insecure) slash commands.

[target=unit]

In addition to condition checking, the macro option system provides us with a way to set the target of various actions. For example, the following macro will always use the bandages on the player regardless of what is targeted (see http://www.wowwiki.com/UnitId for a full list of unit IDs):
/use [target=player] Heavy Netherweave Bandage
Besides setting the target of the action itself, the [target=] assignment also sets the unit that the conditionals are checked against. Since that probably didn't make much sense, here's a macro that combines concepts from both of the examples you've seen so far:
/cast [help] [target=targettarget, help] [target=player] Flash Heal
First it checks against [help]. If it's true, then it passes Flash Heal to /cast. Otherwise it moves on to the next condition, [target=targettarget, help]. Now it checks for help again, but this time it's checking to see if your target's target is friendly. If it is, then it will pass Flash Heal to /cast, but this time it also tells /cast that it should be cast on your target's target. If it still hasn't found a valid target yet, it'll move onto the next condition, [target=player]. Since there are no actual conditions in there, it will always be true, so Flash Heal is sent to /cast with you, the player, as the target.

Syntax overview

There can be an awful lot of confusion around how macro options work, so I will take this early opportunity to break down the general concepts behind them. I will be providing some real-world examples using actual options. Don't worry too much if you don't understand what they mean. All options will be covered in detail later on.

General options syntax

All slash commands basically work the same way. You have a command, and a set of parameters. The parameters depend on the command, and some commands don't take any. Here are a few examples:
/cast Smite

\___/ \___/
| |
| parameters
|
command


/petattack
\________/ V
| |
| parameters (empty)
|
command


/castsequence reset=target Immolate, Corruption, Curse of Agony, Siphon Life
\___________/ \____________________________________________________________/
| |
command parameters
Macro options allow you to choose a set of parameters based on a number of criteria. At the highest level, you have a set of criteria/parameter groups separated by semicolons. The criteria consist of zero or more sets of conditions. Each condition set is enclosed with square brackets. Here is an illustration of this basic syntax.
/command [conditions] [more conditions] parameters; [conditions] parameters ...
As you saw in the basic examples above, the command is evaluated from left to right. As soon as it finds a set of conditions that are true, it runs the command with the corresponding parameters. If there are no conditions in a clause, it will always be true. In fact, you can imagine a single-spell /cast command as a macro option with one clause that has no conditions. When the command does not have any conditions that are true, it will not execute at all.

Condition syntax

Each set of conditions is a simple comma-separated list. They can appear in any order, though [target=] is always taken into account first, before any of the conditionals. Think of the comma as an "and." A condition like [help, nodead, target=focus] means "My focus is friendly AND not dead."

Notice: Conditions are case-sensitive. If you use [Help] instead of [help], the macro will generate an error. However, this does not necessarily include the condition's parameters (described below). Still, it's usually better to consistently capitalize as things appear. Write spells and items just like you see in their tooltips. Follow the examples in this guide precisely.

Conditions themselves have a few building blocks. First off, as you just saw with "nodead", you can put "no" in front of a condition to mean the opposite. Notice that [nohelp] does not mean the same thing as [harm]. [harm] and [help] both return true only if there is a target to begin with. Furthermore, there are some targets that can neither be helped nor harmed (unflagged players of the other faction, non-combat pets, escort quests, etc.).

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 8. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:07:16 PM UTC
    limit-reached limit-reached
Some conditions also take their own sets of parameters. For example, [stance] by itself means "In any stance" (useful for every class with stances except Warriors since they are always in a stance). However, you can also specify one or more particular stances to check. The set of parameters begins with a colon (:) and each parameter is separated with a slash (/) that means "or." Here's a generic illustration of the syntax of a single condition where everything inside angle brackets (<>) is optional.
[<no>condition<:parameter</parameter</parameter<...>>>>]
Here's a simple example that uses Shield Bash in Defensive or Battle Stance, but switches into Defensive Stance if you're in Berserker:
/cast [stance:1/2] Shield Bash; Defensive Stance
Note: "no" applies to the whole condition and all of its parameters. This means that [nostance:1/2] would mean "anything but stances 1 or 2"

Empty parameters

One source of confusion comes in dealing with parameterless commands. A very common error when writing macros is to add an extra semicolon to the end, but this creates some unexpected bugs. Take the following macro:
/petattack [target=focus, harm];
To the uninitiated, that looks like it'll send your pet after your focus if it's harmful, and do nothing otherwise. However, let's look at a breakdown of this macro:
/petattack [target=focus, harm]  ;

\________/ \__________________/ V V V
| | | | |
command options | | parameters (empty)
| |
| options (empty)
|
parameters (empty)
See that extra blank set of options & parameters? Remember that a blank set of options always evaluates to true, so that second empty parameter gets passed to /petattack if the first conditions are false.

Empty conditions

Sometimes you may want a command to cast on a particular target under certain circumstances but behave like normal if those conditions aren't true. In this case you will want to use an empty set of conditions which will always evaluate to true. The following macro will cast Flash of Light on the unit under your mouse. If you have no mouseover or it's hostile, the macro will behave like a plain /cast Flash of Light, casting on your target and respecting self-cast key and auto-self-cast interface option.
/cast [target=mouseover, help] [ ] Flash of Light
[target=] vs. unit parameters

Some commands accept units directly as their parameters. For example, /target party1 will target your first party member. The command /target [target=party1] while a bit more verbose has the equivalent behavior. However, in most cases the designers don't want us to be able to test conditions on one unit and then act on another, so you must use one or the other. E.g., a macro like the following will not work as expected:
/target [target=focus, dead] party1
WoW will ignore party1 because you set a unit with the [target=]. There are some specific exceptions to this rule. A few commands have "key units" that are fundamental to the command. If you use that unit in your [target=], WoW will allow you to specify another unit or will use the default unit for the command if you don't specify one. That last bit needs a concrete example:
/focus [target=focus, dead] [target=focus, noharm] target
In this case, the key unit is focus. Since we are using [target=focus], WoW will send "target" to the /focus command. We could also have left off the "target" at the end since the /focus command defaults to your target. Below is a list of all commands with key units, and their default units if any. To reiterate for clarity, the key unit is a unit you can use in [target=] that will allow you to send another unit to the command. The Default Unit is the unit that will be sent to the command if you don't provide one.
Command      | Key Unit  | Default Unit

-------------+-----------+-------------
/target | target |
/focus | focus | target
/startattack | target | target
/petattack | pettarget | target
Conditionals

Now you'll get to see the complete list of conditionals and what they mean. Each conditional will be treated more thoroughly below.

Complete list

Below is the entire list of conditionals that are available to the macro system. One of the goals in the 2.0 patch was to eliminate a lot of old "smart buttons" that allowed people to essentially play the entire game spamming one key repeatedly. However, many tasks people used macros to simplify were deemed OK and given Blizzard's blessing via the macro options.

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 9. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:08:29 PM UTC
    limit-reached limit-reached
If you don't see a condition listed here, then there is no way to check for it and take a combat-related action. These are essentially non-negotiable though they may be augmented in the future.
  • help - Can cast helpful spells on the target
  • harm - Can cast harmful spells on the target
  • exists - Target exists
  • dead - Target is dead
  • stance:0/1/2/.../n - In a stance
  • stealth - Stealthed
  • modifier:shift/ctrl/alt - Holding the given key
  • button:1/.../5/<virtual click> - Macro activated with the given mouse button
  • equipped:<item type> - item type is equipped (item type can be an inventory slot, item type, or item subtype)
  • channeling:<spell name> - Channeling the given spell
  • actionbar:1/.../6 - Given action bar page is selected
  • pet:<pet name or type> - The given pet is out
  • combat - In combat
  • mounted - Self explanatory
  • swimming - Self explanatory
  • flying - Mounted or in flight form AND in the air
  • flyable - In a zone where flying is allowed
  • indoors - Self explanatory
  • outdoors - Self explanatory
  • party - Target is in your party
  • raid - Target is in your raid/party
  • group:party/raid - You are in the given type of group
help & harm

These two have been covered fairly thoroughly so far. I can't really think of anything to add right now, but I will leave this section here for completeness.

exists

This determines whether the given unit exists. In other words, if you don't have a target, [exists] will return false. If you have a focus, [target=focus, exists] would be true. Note that in some cases [exists] is unnecessary. [help], [harm], [dead], [party], & [raid] all imply [exists] if they're true.

dead

If you have a target and it's dead, this will be true.

stance:0/1/2/.../n

Stance is the generic term used for Warriors', Druids', Rogues' (Stealth), Priests' (Shadowform) and Shaman's (Ghost Wolf) forms. Stances are only applicable to situations where certain abilities are only usable in specific forms. Because of this, Paladin auras (despite being on the shapeshift bar) and Hunter aspects are NOT considered stances.

The simplest form of [stance], as mentioned previously, means that you are in any stance whatsoever. It is equivalent to [stance:1/2/3/.../n] where n is the number of stances you have. [stance:0] is equivalent to [nostance] so you can use a conditional like [stance:0/3] to evaluate as true if you are either in stance 3 or not in any stance.

The stances themselves are ordered the same way as they appear on your shapeshift bar. So a Druid with Bear, Aquatic, Cat, & Travel forms would have stances 1 through 4. Here is a simple chart to help you remember stance numbers (thanks Neuro :P):
         | Warrior   | Druid   | Priest     | Rogue   | Shaman

---------+-----------+---------+------------+---------+----------
Stance 1 | Battle | Bear | Shadowform | Stealth | Ghostwolf
Stance 2 | Defensive | Aquatic | | |
Stance 3 | Berserker | Cat | | |
Stance 4 | | Travel | | |
Stance 5 | | MK/ToL | | |
Stance 6 | | Flight | | |
Note: if a Druid is missing a form, all the higher-number ones will be shifted upwards on the chart.

Example:
/cancelform [nostance:0/1/3]

/cast [stance:1/3] Faerie Fire (Feral)(); [nostance] Faerie Fire
In Bear and Cat forms, this will cast Faerie Fire (Feral). In caster form, it will cast Faerie Fire. In any other stance, running the macro will return you to caster form. Note that after patch 2.3, /cancelform will register instantly so it will immediately cast Faerie Fire after leaving a form.

stealth

While the Rogues among you may find this redundant since [stance] behaves the same way, [stealth] also applies to Night Elves' Shadowmeld, Mages' Invisibility, etc.

modifier:shift/ctrl/alt

Modifier keys are a convenient way to save action bar space and make certain decisions. Say you want an implied targeting macro but use one spell normally and another spell when you're holding down a modifier key:
/cast [modifier, help] [modifier, target=targettarget, help] Flash Heal; [help] [target=targettarget] Greater Heal
This macro will cast a helpful spell on either your target if it's friendly, or your target's target otherwise. When you hold any modifier key, it will cast Flash Heal. Otherwise it will cast Greater Heal.

Of course, you can specify particular modifier keys for more control a la [modifier:shift/ctrl] which means "shift or control." If you want to specify both, you need two modifier conditionals: [modifier:shift, modifier:ctrl].

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 10. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:09:31 PM UTC
    limit-reached limit-reached
Beware if you're using key bindings for your macros. If you bind A to a macro with, say, [modifier:shift] and you have something else bound to SHIFT-A, the SHIFT-A binding will take precedence and your macro will not run.

Modifier variables

While modifier keys can only be one of shift, ctrl, or alt, there are a number of system variables that you can use in your modifier conditions as well. For instance, the SELFCAST variable means "whatever your self-cast modifier is set to." The default is alt (holding the alt key while casting a spell will attempt to cast it on yourself) though some addons give you the option to change this. If you create a macro like:
/cast [modifier:SELFCAST, target=player] [target=mouseover] [ ] Greater Heal
It will work as expected no mater what you have set as your self-cast key. Some other variables and their defaults (though with arguably much less utility) are as follows:
  • AUTOLOOTTOGGLE (shift)
  • STICKYCAMERA (ctrl)
  • SPLITSTACK (shift)
  • PICKUPACTION (shift)
  • COMPAREITEMS (shift)
  • OPENALLBAGS (shift)
  • QUESTWATCHTOGGLE (shift)
button:1/2/.../5/<virtual click>

Similar to [modifier], [button] allows your macro to respond differently based on which mouse button is being used to activate the macro. Button numbers 1-5 correspond to left, right, middle, button 4, & button 5. If your macro is activated by a key binding, [button:1] will always be true. As an example, here is the macro I use for mounting:
#show Swift Green Mechanostrider

/userandom [nobutton:2, flyable, nomounted] Ebon Gryphon; [nomounted] Black Battlestrider, Swift Green Mechanostrider
/dismount [noflying] [button:2]
Behavior when not mounted: left-clicking will pick Ebon Gryphon if it can be used (flyable), otherwise it will randomly pick the Black Battlestrider or the Swift Green Mechanostrider. Right-clicking will always pick one of the mechachickens.

Behavior when mounted: left-click will only dismount if not flying. Right-click will always dismount.

The "virtual click" can usually be ignored, but if you use a bar mod it can be useful. Action bars that respond to various state changes translate clicks to virtual ones that determine which action to use. Because these virtual clicks are addon-specific, I'm not going to go into any further detail here.

equipped:<item type>

[equipped] allows you to determine if a particular type of gear is equipped. The item type can be an inventory slot name, an item type, or an item subtype. See http://www.wowwiki.com/ItemType and http://www.wowwiki.com/API_TYPE_InventorySlotName for lists of these types. Here is the macro I use to pick Shield Bash or Pummel depending on what I've got equipped:
#show [equipped:Shields] Shield Bash; Pummel

/cast [equipped:Shields,stance:1/2] Shield Bash; [equipped:Shields] Defensive Stance; [stance:3] Pummel; Berserker Stance
The #show line is used to make it show either Shield Bash or Pummel. Without it, it would show the stance spells as well, when applicable. Here's some pseudocode that illustrates how the second line works:
if a shield is equipped and I'm in Battle or Defensive stance then

/cast Shield Bash
else if a shield is equipped then
/cast Defensive Stance
else if I'm in Berserker stance then
/cast Pummel
else
/cast Berserker Stance
Here's another macro that lets you cast Overpower with a bit more vigor:
/equip [noequipped:Two-Handed Axes] Crystalforged War Axe

/cast [nostance:1] Battle Stance; [equipped:Two-Handed Axes] Overpower
channeling:<spell name>

Normally, if you are channeling a spell and begin casting another spell, it will cancel the channel. This option allows you to keep that from happening, and also has a few other uses. For instance, maybe you do want to cancel one particular spell but not another. [channeling] alone matches any spell and you can also list an arbitrary number of spell names to check.

Note: channeling is NOT the same as casting. The [channeling] conditional only applies to spells like Arcane Missiles, Drain Life, Mind Flay, etc. where after the initial cast, the spell makes its effect over time.

actionbar:1/.../6

The default UI provides a number of action bar pages. These pages only affect the lower left action bar that is visible by default. Luckily, you can make macros that respond to different action bar pages and place them on the other action bars. One example is for a hunter to emulate stances using their aspects:
/swapactionbar 1 2

/cast [actionbar:1] Aspect of the Hawk; Aspect of the Monkey
This macro will switch between action bars 1 and 2. When it switches to bar 1 it casts Aspect of the Hawk, and when it goes to bar 2 it casts Aspect of the Monkey.

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 11. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:10:33 PM UTC
    limit-reached limit-reached
pet:<pet name or type>

Every class with a pet should find this one useful. It allows you to choose an action based on which pet you have out. You can specify your pet's name or your pet's type (Voidwalker, Boar, Imp, Wolf, etc.). [pet] by itself matches any pet. For example, a Mage can choose between their elemental's Freeze spell or their own Frost Nova:
/cast [pet] Freeze; Frost Nova
combat

True if you are in combat.

mounted, swimming, flying, indoors & outdoors

These are all fairly self-explanatory. They all apply to you, the player.

flyable

As briefly mentioned above, [flyable] determines whether you are in the Outland where you're allowed to use a flying mount.

party & raid

These return true if the target is in your party or raid, respectively.

group:party/raid

This lets you determine whether you are in the given group type. [group] is equivalent to [group:party]. [group:raid] implies [group:party]. This can be useful for buffing classes. For example:
/cast [group, nomodifier] Arcane Brilliance; [help] [target=player] Arcane Intellect
If you're in a group it will normally cast Arcane Brilliance. If you're holding a modifier key or you're solo, it will cast Arcane Intellect on a friendly target or yourself.

Using focus

Focus is a unit ID like target, player, or raidpet1target (See http://www.wowwiki.com/UnitId). It allows you to reference a mob, player, or NPC you specify. The simplest usage of focus is with key bindings. There are two focus-related functions in the bindings menu: Focus Target, and Target Focus. Focus Target sets your focus to whatever you are currently targeting (it will clear your focus if you have nothing targeted). Once you have a focus set, you can use it as a unit ID for any other command. Target Focus will, as you might guess, target the entity you have focused. However, these bindings don't really take full advantage of focus. In order to get the most bang for your buck, you will need to use macros with macro options.

One of the most common uses is to set a crowd control target. A mage can select a mob to sheep and set it as their focus. Now they can change targets for DPS and use the following macro whenever they need to re-sheep.
/cast [target=focus] Polymorph
Or maybe a healer could set their focus to the main tank. With an addon like FocusFrame (http://wow.curse.com/downloads/details/5681/), they would then have a frame devoted to their main tank that they could easily use for healing.

In addition to the key bindings, there are also the /focus and /clearfocus slash commands. Without any parameters, /focus works exactly like the key binding, setting your current target as your focus. You can also specify any valid unit ID (see Targeting above) or name as a parameter to /focus:
/focus party3target
Here is an example of more advanced focusing:
/focus [target=focus, noexists] [target=focus, dead] [target=focus, help] [modifier]

/stopmacro [target=focus, noexists]
/cast [target=focus] Polymorph
The first line sets your focus to your current target (or clear your focus if you don't have a target) in one of the following situations:
  • You don't already have a focus
  • Your current focus is dead
  • Your current focus is friendly
  • You are holding down a modifier key (in case you want to change your focus after you already have a valid one)
The second line keeps the macro from proceeding if you don't have a focus. Finally, it casts Polymorph on your focus. This gives you a one-button solution for your crowd control with focus. You may notice that we could have used an exists condition in the /cast command instead of a separate /stopmacro command. However, /stopmacro affords us a bit more flexibility by stoping any other commands we may add to the macro later (like a warning in /p).

It's possible to swap your target and your focus, giving you in effect two targets you can toggle between:
/cleartarget [target=target, dead]

/clearfocus [target=focus, dead]
/target focus
/cleartarget [target=focus, noexists]
/targetlasttarget
/focus target
/targetlasttarget
The first two lines clear the target and/or focus if they are dead (if you really want to keep track of multiple dead targets, e.g. to resurrect or loot them, then delete those lines). The fourth is needed because /target focus doesn't clear your target if you have no current focus (without it, the fifth line would then retrieve your previous target).

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
  • 12. Re: Cogwheel's Complete Macro Guide  |  04/17/2007 04:11:44 PM UTC
    limit-reached limit-reached
--==≡≡ Part III: Miscellany ≡≡==--

Custom Icons

If you would like to use custom icons for your macros, you can place them in your World of Warcraft\Interface\Icons folder (creating this folder if it doesn't exist). The files must follow the same guidelines for UI textures. Namely, they must be either BLP files or 24-bit/24-bit+alpha uncompressed TGA files. Their dimensions must be powers of two up to 512 (e.g. 32x32, 512x128). Note: any images that aren't square will look squished on your action bar.

Keeping macros on multiple computers

Until Blizzard decides to store macros on the server, you must copy your World of Warcraft\WTF\Account\Youraccountname folder between computers. This will also preserve all of your settings for any addons you have installed, though the addons will also have to be installed on each computer.

If you would rather have your macros and nothing else, you need to copy World of Warcraft\WTF\Account\Youraccountname\macros-cache.txt for your general macros, and World of Warcraft\WTF\Account\Youraccountname\Yourrealmname\Yourcharactername\macros-cache.txt for character-specific macros.

More Information

If you have a specific question and did not find your answer here, check out the Macro FAQ & Repository (http://forums.worldofwarcraft.com/thread.html?topicId=108386180). It contains answers to quite a few questions as well as numerous example macros. You should also take a look at http://www.wowwiki.com for more inspiration. There are a number of macro-related articles as well as details of the WoW API for use with scripts (/run).

Finally, don't be shy to ask questions on the forums. As long as you understand the basics that this guide has presented and you demonstrate an effort to solve the problem yourself, the posters will be more than happy to help.

Acknowledgments

All our cookie are belong to Slouken! He has consistently been one of the most accessible and responsive Blizzard employees on the forums, and the macro system wouldn't be where it is today without his consideration of everyones' suggestions.

Thanks also have to go out to Iriel, Tem, Cladhaire, and others who are intimately familiar with the WoW UI and have shared their knowledge with the rest of the world.

Some other characters roaming around that deserve some recognition for their contributions to the community are Neuro, Shirik, Jelly, Lunessa, Troodi, Lealla, Aella, Valaron, Lopeppeppy, Kamdis and plenty of others I'm forgetting as I am wont to do.

Finally, I'd like to recognize the contributors on WoWWiki who have worked to spruce up this article in wiki form, correct my spelling, and add new tidbits of information while I've been slacking off writing a book.

/rollcredits

[ Post edited by Cogwheel ]


See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
Houma
  • Burning Legion
  • 13. Re: Macro Intro & FAQ  |  04/17/2007 04:54:16 PM UTC
    limit-reached limit-reached
Question on the /click, it can click something in the spell book correct?
70
view posts by this user ignore
  • 14. Re: Macro Intro & FAQ  |  04/17/2007 04:57:51 PM UTC
    limit-reached limit-reached
Technically, yes, but it won't do you much good unless you have the spell book open and on a particular page. The spell book doesn't have an arbitrary number of buttons that map to particular spells. When you change pages or tabs it simply reconfigures the existing buttons to reference a different set of spells.
See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
70
view posts by this user ignore
Houma
  • Burning Legion
  • 15. Re: Macro Intro & FAQ  |  04/17/2007 04:59:03 PM UTC
    limit-reached limit-reached
Ahh, so I'd be better off sticking the ability on an action bar and referencing the button. Thank you very much for the help and the informative post.

For those wondering what I was doing, I've run into problems inserting Adrenaline Rush into an activation macro for rogue cooldowns. For some reason, no matter what, Adrenaline Rush would not activate. It's finally solved with the /click function.

Here's the Macro:

/click BT3Button60
/cast Blade Flurry
/stopcasting
/cast Berserking(Racial)
/stopcasting
/cast Evasion
/stopcasting

I'm using Bartender3 for my buttons, so it's refering to button 12 of bar 5. As Cogwheel said, use MoveAnything to find the correct frame reference for the /click command. As an additional note, the /click has to come first in the macro, otherwise it will not work.

As a side note, a macro like above normally works as a dumb logic style, aka it'll activate the cooldowns as long as you're clicking it, even if the others are on CD, unlike /castsequence. By adding in the /click, it stops that process, but by setting them all up using /click it returns it to the dumb logic state, but will only activate one at a time. The above activates all with one button press, as long as all are off of CD.

EDIT: Scratch all that, it's not working correctly, only now it's Blade Flurry that's not activating, and I'm still annoyed by it. Check back later to see the results.

[ Post edited by Houma ]

48
view posts by this user ignore
Qualizar
  • Blackwing Lair
  • 16. Re: Macro Intro & FAQ  |  04/22/2007 04:41:29 PM UTC
    limit-reached limit-reached
Cogwheel...

I am looking to see if it were possible to setup a one button tanking ability....
I want to combine Revenge, Sunder, and Heroic Strike to one button click...
I got it workin fine with /castsequence.
But that doesn't solve my dilema since I want revenge to be my main attack and it isn't always available.
I am looking for something that would be like this...
(My prgramming language knowledge is limited so bear with me)

/cast Revenge;
/if (Revenge = true);
/resetmacro;
/else if (Revenge = false;
/cast Sunder Armor;
/if (Sunder Armor = true);
/reset macro;
/else if (Sunder Armor = false);
/cast Heroic Strike;

I know that is very bad example but I can only relate the programming to a more Java style.
But, I would think that give you the idea of what I am trying to accomplish.
70
view posts by this user ignore
  • 17. Re: Macro Intro & FAQ  |  04/22/2007 08:56:23 PM UTC
    limit-reached limit-reached
See "How do I cast a spell if _______?"
See my mods at http://cogwheel.wowinterface.com

I'd rather teach a man to fish.

http://www.catb.org/~esr/faqs/smart-questions.html#before
32
view posts by this user ignore
Ull
  • Tanaris
  • 18. Re: Macro Intro & FAQ - READ 1ST!  |  04/22/2007 11:32:01 PM UTC
    limit-reached limit-reached
Fantastic information. I am wondering why I can't get this to work though even using /castsequence:

/castsequence Hunter's Mark, petattack

Do I need to specify a target with the petattack? Having seen the other examples you gave I'm assuming I could do something like:

/click PetActionButton1
/cast Hunter's Mark

but only in that order since HM triggers a GC. Am I way off-base here?

[ Post edited by Ull ]

70
view posts by this user ignore
Kaydeethree
  • Medivh
  • 19. Re: Macro Intro & FAQ - READ 1ST!  |  04/22/2007 11:42:24 PM UTC
    limit-reached limit-reached
petattack is a command, not a spell

/cast Hunter's Mark
/petattack

is what you want. If you don't give it a specific target, your pet will attack the same thing you've got targetted.
Live or die trying.

It seems mages were saving more money than originally intended. Any money saved will now be reduced by 10% and will break frost nova.
1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . 10 . 11 . 12 . 13 . 14 . 15 . 16 . 17 . 18 . 19 . 20 . 21 . 22 . 23 . 24 . 25 . 26
Forum Nav : Jump To This Forum

Blizzard Entertainment
Online Privacy Policy
©2007 Blizzard Entertainment. All rights reserved.