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: PainThis 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 PolymorphNote: 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:
/p Sheeping %t! You break it, you tank it!
/aftercast /p Click the portal to get %t's lazy butt over here
/cast Ritual of Summoning
[ Post edited by Cogwheel ]