[GUIDE] How to make macros!

Post by Wildhorn

1) Ingame, type "/macro" or "/m" to open up the macro menu. Now you have 2 macro tabs. "General" and "YourCharacterName" macro. You can have up to 36 general macros that are shared between all your characters on the server and up to 18 macros only for your character.2) Select the appropriate tab and click on "New" button at bottom right of the window.3) Now you you must enter a name for your macro and choose an icon. You can select a colorful icon that will always show up or the "?" icon that will change depending of the "active" spell.4) Click on "Okay" button.5) Select the new macro in the list and click in the text area at bottom of the window. Macros can be up to 255 characters long (but there is a way to bypass this, see /click command).

Now, how does a macro work?

Macros are fairly simple. They are made of 3 parts:

- Command- Conditions- Object (Spells/Abilities/Items)

It starst with a "/" followed by a command, then conditions (separated by a ",") in between "", then the name of the spell. If there is more than one spell you want to cast with the same command, you separate their conditions/spell with a ";". You can have more than one set of conditions for each spell, so if the first set of conditions are not true, it will check the 2nd set, then third, etc. If none are true, it will then go the next spell (if there is one) and check conditions the same way.Do not add a ";" at the end of the macro, it would just cause bugs.

Might sound complicated, so here is a pattern and an example:

/command Spell1; Spell2

/cast Smite; Renew

(will cast Smite if your target is hostile and alive else will cast Renew if your target is friendly and alive, else will cast it on you)

Note: A macro will always read condition set in order. If the first spell condition is met, it will cast that spell, no matter what conditions are after. Comon mistake made by people is to break down their conditions.Example:

/cast Power Word: Shield; Renew

This is bad because now PW:S and Renew both have same condition (@mouseover), so PW:S will always be cast and Renew will never.What he wanted to do was

Toggleable AbilitiesYou can add a "!" in front of a spell name to prevent it from toggling off.Example: /cast !Ice Block (will prevent you from turning off Ice Block if it is already active).

Spell RankBy default a macro will cast the last rank of a spell. But you can add "Spell(Rank X)" to cast rank X of a spell.Exception: Spell with "()" in their name require you to add "()" after the name.Example: "Faerie Fire(Feral)()" because "Faerie Fire(Feral)" would confuse the game and it would try to cast "Faerie Fire" of rank "Feral" /duh.

scriptingThis is using some API functions used by addons as macro. This is more advanced programming and I wont talk about it in this guide. The command is either /run or /script

Example: /run if(ShowingHelm()) then ShowHelm(0) else ShowHelm(1) end

This script will hide your helm if it is displayed, else will make it to show up.

If "?" icon is selected, will show the "active" spell icon. When you mouse over the macro icon, #show will show only the name of the spell as tooltip while #showtooltip will show the whole tooltip. You can add conditions like a macro to show different spells.

/assist

Does the same thing than "/target targettarget" (see /target). You can add a name as parameter to target the target of a specific target.

/cancelaura

You must add a buff name as parameter. It will cancel the buff, just like right-clicking would do it.

/cancelform

You can add a form/stance name as parameter. It will make you leave the form/stance (doesnt work for warrior). If no parameter is added, will make you leave any form/stance you are into.

/cast

The main command of macros. Example: /cast Spell1; Spell2

/castrandom

Same as /cast but will cast random spell among a list (separated by ",").Example: /castrandom Spell1, Spell2, Spell3, Spell5; Spell1, Spell3, Spell4, Spell6

/castsequence

Same as /cast but will cast spell one after another in a sequence each time you use the macro. You can add reset conditions to make it restart at beginning.Example: /castsequence reset=alt/ctrl/combat Spell1, Spell2, Spell3; reset=n/shift/target Spell2, Spell4, Spell5

You can add any of these after "reset=" separated by "/":n = number of seconds macro will reset after last time macro was called (i.e. when you pressed/clicked/pushed/poked/spammed macro) and not after when last spell was cast.target = when you change targetcombat = when you leave combatshift,alt,ctrl = when you activate the macro with specified modifier pressed (not just by pressing the modifier)

/changeactionbar #

You must add an actionbar number as parameter. Allow you to change your main actionbar to the specified bar.

/clearfocus

Clear your focus (see /focus).

/cleartarget

Clear your target (make you target nothing).

/click

Simulate a click on a specific action button. Allow you to chain macros.Example: /click MultiBarBottomLeftButton7

Bar name list:

ActionButton#: Main BarBonusActionButton# : Dynamic bar that switches based on form/stance (do same thing than ActionButton#)MultiBarBottomLeftButton#: Bottom Left BarMultiBarBottomRightButton#: Bottom Right BarMultiBarRightButton#: Right BarMultiBarLeftButton#: Right Bar 2 (to the left of "Right Bar")PetActionButton#: Pet BarShapeshiftButton#: form/stance bar

/dismount

Dismount you.

/equip

You must enter an equipable item as parameter. Will equip it to default slot (main hand, first ring, first trinket).

/equipslot #

You must enter a slot number and an equipable item as parameter. Will equip an item to the specified slot number.Example: /equipslot 17 OffHandItemName

You must enter name of an armor set as parameter. Name are the one you have set in equipement manager.Example: /equipset SetName

/focus

Set your current target as your focus if no parameter is added. You can add a name as parameter to focus a specific target.

/petaggressive/petdefensive/petpassive

Set your pet to agressive, defensive or passive

/petattack/petfollow/petstay

Make your pet to attack, follow or stay

/petautocastoff/petautocaston/petautocasttoggle

You must enter a pet spell as parameter. Will set the autocast to off, on or will toggle between on/off.

/startattack/stopattack

Will make you to auto attack the nearest target or stop attacking.

/stopcasting

Will make you stop casting any spell you were casting

/stopmacro

Will make a macro to not go further if the conditions are met.

/swapactionbar # ##

Will make you swap between action bar # and ## (see /changeactionbar).

/target

You must enter a name of a target as parameter. Make you to target the closest name specified target ("Rag" would target "Rag" as well as "Raging", "Rager", "Ragwhatever"). You can add as many "target" as you want to select target of target of target of... etc.Example: /target targettargettarget Bob (will target the target of the target of Bob)

/targetexact

You must enter a name of a target as parameter. Same as above, but if specified name do not exist or is near you, your target wont be changed ("Rag" will only target "Rag" and nothing else).

/targetenemy/targetfriend

Will cycle next enemy/friend target (equivalent of Tab/Ctrl+Tab by default). Add a "1" as parameter to cycle backward.

/targetenemyplayer/targetfriendplayer

Same as above, but will only target players. (Will pass on NPCs, minions, pet, etc). Add a "1" as parameter to cycle backward.

/targetparty/targetraid

Same as above, but will only target party/raid members. Add a "1" as parameter to cycle backward.

/targetlasttarget

Will target last target you had selected. If you had none, it will do nothing.

/use

Samething as /cast.

/usetalents #

Will active either primary (# = 1) or secondary (# = 2) talent build if you have Dual Spec.

/userandom

Same as /castrandom.

Post by Wildhorn

Here is the (also long) list of all conditions available in WoW:

Note: You can add "no" before a condition to have its opposite. Example "nocombat" means when not in combat.Note: Every condition set must be inbetween "" and every conditions of a set must be seperated by a ",".Note: Every conditions of a set must be "true" for the set to be considered true. Else it moves to next condition set.Note: When a condition have a ":", you can add multiple parameters by separating them with a "/". Example "form:1/3" will check if you are in form 1 or 3.

If the target exists. Some conditions, like "harm" and "help" imply "exists".

flyable

If the zone you are in allow to fly (not that if YOU can fly). Do not check if Wintergrasp battle is going on or not.

flying

If you are mounted or in flight form and in the air.

group:party/raid

If you are in a party/raid

harm

If target is hostile (can cast damage spell on it)

help

If target is friendly (can cast healing spell on it)

indoors

If you are indoors

modifier:shift/ctrl/altmod:shift/ctrl/alt

If you are holding the specified modifier.

mounted

If you are mounted

outdoors

If you are outdoors

party

If target is in your party

petpet:<pet name or type>

If your pet is active. Can specify the name or the type (Cat, Bear, Devilsaur, etc).

raid

If target is in your raid

spec:#

If you are in the specified spec (1 or 2) if you have Dual Spec.

stance:#form:#

If you are in the specified stance number. It follow the order of your stance/form bar.

stealth

If you are stealthed

swimming

If you are swimming.

target=<parameter>@<parameter>

Note: "@" will only be avaible in patch 3.3Add one of the following as <parameter>:mouseover = target model/panel under your mouse cursortarget = your current target.targettarget = target of your target (add as many target as you want to go as far in target of target of target of etc as you want)lasttarget = target your last targetpet = target is your pet.pettarget = target is your pet's target.focus = target your focusparty/raid# = will target party/raid member number #.<name> = to target a specificate targetplayer = yourself

Note: target=target is optional. Example: is the same as .Note: There is no "notarget" option, but a way to go around it is to use "noexists".Warning: target is not a real condition. It only serve to assign a target.

Post by Wildhorn

(Reserved!)

Feel free to comments about it, point out typos or error and how I could improve it or if there is something missing.

I made it because forum start to get flooded with way too basic macro questions and I had nothing to do today >_<

Post by HighFive

There's a "pettarget=<parameter>"?Am I understanding it wrong or would it be totally the same as just "target=<parameter>"?

Post by Wildhorn

Woops... i dont know how this got there... there is none.

Post by Wanderingfox

You may want to consider wrapping that nice slot diagram in code tags...

<-

edit: Actually all the quote stuff should probably be in code tags too :P

Post by Fizzles

Very nice :OIn fact there's now a link to it in the sticky.

Post by Wildhorn

@Wanderingfox: Na. I do not like how code tag take all the width of the post. So unless there is some problem with quote tag, I still stick with it :)

Post by cudgel

@Wanderingfox: Na. I do not like how code tag take all the width of the post. So unless there is some problem with quote tag, I still stick with it :)

My 2 cents:

The fixed-width font is better for code because one can see spaces, punctuation, etc., more readily

Having a different font for code immediately informs the reader there's something special/different about that text vs. the rest of the text.

Then again, I've probably read too many O'Reilly books in my life, and expect everything to follow similar conventions. ;)

Post by Kikt

Post by Wildhorn

Post by TrooperXXX

Give this man a STICKY :DSrsly, awesome guide mate, lost of tiny bits i wanted to know about macroing stuff :)

Post by Sadinshadow

Seriously, if anything is sticky worthy, it is this, hands down! :D

Post by pelf

These are, of course, suggestions; but, I'm going to phrase them as commands so that I can save on words. This is from the top down, so I'm not going to give much context information.

Mention that /m is an alias for /macro.

You can have up to 36 general macro>s<

right of the window>.<

>colorful< icon

depending >on< the "active" spell

Macro>s< can be up to 255 >characters< long

Don't mention "(but there is a way to bypass this)" unless you're going to explain it. Most stuff that is longer than 255 characters should be an addon anyway.

- >Actions< (Spells)I'd say "action" is a better way to abstract the non-command, non-condition portion of a macro than "parameter".

It start>s< >with< a "/" followed by >a< command, then conditions, >separated< by a "," >in brackets ("")<, then >the< name of the spell.

you separate their conditions/spell >with< a ";".

so if the first set of condition>s< are not true, it will check the >second< set, then third, etc.

Do not add a ";" at the end of the macro, it would just cause bugs.Does it? What bugs?

Might sound complicated, so here are two examples:The first isn't really an example, it's a generic pattern. The second is an example.

Your order example is missing a quote block.

What Macros & Addons >Can't Do<!Macros >can't< play the game for you.I suggest you >< read this thread to know what macros >can't< do.

Toggleable >Abilities<

You have an extra space after the toggleable heading.

to prevent it >from toggling off.<

I would use something like Heroic Strike or Maul as an example for the toggleable ability instead of Ice Block.

You're missing the quote block for the toggleable example.

(will prevent you >from turning< off Ice Block if >it is already active.<)

macro will cast >the< last rank

Spell with "()" in their name require you to add "()" after the name.I would rephrase to: "Spells with parentheses in their name require you to add an empty set of parentheses after the name to auto-select the last rank."

You have a colon after the Scripting heading but not after any of the others.

There are lots of other contractions missing their apostrophe; I won't mention those anymore.

This script will hide your helm if it is displayed, else will make it to show up.Rephrase: This macro will toggle the display of your helm.

#show just shows the icon (if the ? is selected) with the name of the macro as the tooltip. #showtooltip shows the icon and the tooltip.

/assist does the same thing as /target targettarget, as well, which makes a bit more sense if you consider it via UnitIds.

You're often inconsistent with your period usage. Sometimes it's at the end of lines and sometimes it isn't. e.g. "...not after when the last spell was casted." vs. "when you leave combat".

/petaggressive has two Gs.

attack >the< nearest target or stop >attacking<.

make you stop >casting< any spell you were casting.

English uses the gerund form of the verb in that case instead of the infinitive. Not like, "Elle cesse d'attaquer."

I didn't know you could say /targettargettarget target to get your target's target's target. That's very odd. Are you sure?

If you add empty >bracket<, it will make the spell >perform its default action<.

4+ >depends on< your mouse

You can add pet and the pet suffix to your list of UnitIds.

Voila. I got tired of pointing out little stuff, so I missed some of them. I think I caught most of the rest. Your formatting style is not how I would do it, but I didn't make the post, you did :). Also, I agree that you should use the \\ tag.

Post by HighFive

Do not add a ";" at the end of the macro, it would just cause bugs.Does it? What bugs?

I can't think of an example, but the gist of it is, the parser thinks there will be another argument after the semicolon and uses "" as it.

I didn't know you could say /targettargettarget target to get your target's target's target. That's very odd. Are you sure?

Nah, there's just the /target command (and its alias /tar). To target a target's target's target you'd have to use /tar targettargettarget.

Post by pelf

i can't think of an example, but the gist of it is, the parser thinks there will be another argument after the semicolon and uses "" as it.

Ah, that's logical. Cool beans.

Post by Wildhorn

I will finish my supper, watch some TV and fix all the typos/error I made later tonight. Thanks pelf, your inputs are always welcome.

Post by pelf

I will finish my supper, watch some TV and fix all the typos/error I made later tonight. Thanks pelf, your inputs are always welcome.

Thank you for writing it :). Consider the time I spent writing up a wall of critique as a compliment, please ^_^.

Post by Wildhorn

Sorry for the late update, yesterday it was: Headache 1, Wildhorn 0.

I corrected the typos you pointed out and even some you missed for the first post. I will continue to edit after I eat something :)

Here is also some additional points about your "survey":

1) "Your order example is missing a quote block." --- I dont get it. What do you mean?2) "I would use something like Heroic Strike or Maul as an example for the toggleable ability instead of Ice Block." --- Comon, not you... people will have to get this out of their mind. HS and Maul (or any other "on next swing" spell) CANT be turned off no matter what. Once you click it, you cant stop it.3) "(will prevent you >from turning< off Ice Block if >it is already active.<)" --- Thanks alot for this one... i spent a good 20 minutes trying to figure out how to say it with no success :(

Post Reply

You are not logged in. Please log in to post a reply or register if you don't already have an account.