Macro Basics Here are some of the basic commands used when scripting macros: /target – target an enemy, friendly player or npc /focus – focus an enemy, friendly player or npc /assist – assist a friendly player /cast – casts a spell /castsequence – casts spells in a determined order /use – use a consumable or item /equip – equip an item /startattack <----- this gets you into combat by starting you're auto attack *** examaple on /castsequence: ' /castsequence reset=10/combat/target/ Icy Touch,Plague Strike,Blood Strike,Heart Strike,Death Strike,Death Coil,Icy Touch,Plague Strike,Blood Strike,Heart Strike,Death Strike,Death Coil ' *Note on /castsequence* the 'reset=' is a condition for the macro to reset, you can use a numeric value in seconds like 'reset=10', this will reset the macro to the first spell in the sequence after 10 seconds of inactivity (not pressing the button). You can also use 'reset=target' to reset the macro when you change targets. *Inputting an item or a spell into a macro is very easily done by holding down shift while clicking on the spell or item icon in your skills tab or inventory.* Pet commands are as follows: /petpassive – puts pet on passive /petdefensive – puts pet on defensive /petaggressive – tells your pet to attack anything and everything /petattack – sends your pet to attack /petfollow – tells your pet to follow you /petstay – tells your pet to stay put [modifier:shift], [modifier:ctrl], [modifer:alt] – Modifiers allow you to add more decision making abilities to macros. By using an additional modifier key in combination with the macro key bind, you’re able to combine added conditionals to your macro. Does that make sense? If not, just read on and I’m sure you’ll start to understand once you see them in the context of the various macros. @ – The @ symbol is now used to mean target=, so if you see a macro with @Focus or @ mousover, this means that the action would be directed to your Focus Target or mouseover target, respectively. *Note* @ symbol is for 4.1+ use target= Example: ' /cast [@focus] Misdirection ' 4.1+ ' /cast [target=focus] Misdirection ' 3.3.3 *Note* some @ functions work with 3.3.5 (go figure) This is an example of a macro with the '@' that works, it's my multi-function hunter's mark-pet attack-call pet-revive and mend /cast [nopet,nomod] Call Pet /cast [@pet,dead][mod:shift] Revive Pet /cast [mod:ctrl] Mend Pet /petfollow [@target,noexists] /cast [@mouseover,harm] Hunter's Mark; [harm] Hunter's Mark /stopmacro [mod] /target [@mouseover,harm] /petattack [@target,harm] (it's exactly 255 characters, and it was pain in the butt to get it to 255. That's when i discovered that some '@' work in 3.3.5) /use 13 – Use the trinket in your top trinket slot /use 14 – Use the trinket in your bottom trinket slot /script UIErrorsFrame:Clear() – Prevents an on-screen error message when an ability isn’t ready. This is handy for eliminating the on-screen combat message spam you’ll get when rapid-pressing a macro key. Each piece of gear that we wear is assigned a number as follows: 1 = head 2 = neck 3 = shoulder 4 = shirt 5 = chest 6 = belt 7 = legs 8 = feet 9 = wrist 10 = gloves 11 = finger 1 12 = finger 2 13 = trinket 1 14 = trinket 2 15 = back 16 = main hand 17 = off hand 18 = ranged 19 = tabard Using the gear slot number as opposed to the actual item name is a more practical way of doing things. It not only makes for easier macro scripting, but it also allows for more freedom when swapping out gear. The important equipment slots to remember are: 13 – Trinket 1 14 – Trinket 2 *Note* instant cast spells can be linked in the same macro, spells with cooldowns can't be linked together unless it's by /castsequence, same cooldown spells can be linked together but sometimes one or the other fail to execute (i don't think anyone knows why lol, if you find out let me know) *Notes about spell names and ranks* The /cast command is pretty picky when it comes to your spell name. In order for it to successfully 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. 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, and Travel forms would have stances 1 through 4. Here is a simple chart to help you remember stance numbers: Stance ---------- Warrior----------Druid----------Priest----------Rogue----------Shaman 1 Battle Stance Bear Form Shadowform Stealth Ghost Wolf 2 Defensive Stance Aquatic Form 3 Berserker Stance Cat Form 4 Travel Form 5 Moonkin Form,Tree of Life 6 Flight Form Using Focus Focus is a unit ID like target, player, or raidpet1target. 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://www.wowinterface.com/downloads/info6463-FocusFrame.html), 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, noharm] [target=focus, dead] [modifier] /stopmacro [target=focus, noexists] /cast [target=focus] Polymorph The first line sets your focus to your current target (or clears your focus if you don't have a target) in one of the following situations: • You don't have a harmful focus (either it's friendly or doesn't exist) • Your current focus is dead • 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). 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. 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, Rogues with Stealth, etc.) can use /cancelform to leave their current form. Example: /cancelform /use Super Healing Potion Stopping a cast /stopcasting was touched on briefly in other contexts but its main use is used to stop another spell cast that's in progress. This is great for making 'panic buttons' that interrupt whatever you're doing at the moment in favor of something more important. On a Warlock, for instance, you can use the following macro: /stopcasting /cast Shadowburn This is a compilation of what i have learned so far about macros, remember to take into consideration the cooldowns especially for rotation macros using '/castsequence '. an example on that could be this: /castsequence reset=target Concussive Shot,Serpent Sting,Arcane Shot,Steady Shot,Steady Shot,Arcane Shot Concussive Shot has a 10 sec cooldown, Serpent Sting is instant but has a 15 sec duration and Arcane Shot has a 6 sec cooldown, i put in the 2 consecutive Steady Shot and a second Arcane Shot to buy the time need it to refresh the Concussive Shot and the Serpent Sting so the macro flows consistently until the target is dead or i die whatever happens first lol. i really hope this helps you guys in macro creation, I'll add more as i learn more. |