Using Macros in RP
Welcome!
A special lil treat this week. I decided to brush up on my WoW macros, and who gets to benefit from this? You do!
If you haven’t ever created any macros before, then I would suggest WoW Wiki’s Beginner’s Guide as a good website to get you started. Also, AfterCast is an addon that helps with a few things on macros. I would suggest getting it from WoW Interface (fan update).
For a quick step by step:
1. Type “/macro”.
2. Click the new button in the window that pops up.
3. Type a name for the Macro in the new window that pops up and then choose an icon for it.
4. Copy and paste a macro from below or make your own. Feel free to customize what I have below.
5. Drag the button from the window onto the bar that you’d like it on.
6. Click button to try it.
I’ll do a macro and then do a few examples with each one so that you can get the hang of it. I am testing all of the macros below before they make it into the below list, so I know all of these work.
Imitating built-in WoW emotes
This macro will use any available channel to mimic the built-in WoW emotes. If you have someone targeted, then it will say something specific to that target, otherwise you will make a generic statement.
This is the layout of the macro. This is what you will paste in your macro box and customize.
/run local name = UnitName(“target”); if UnitExists(“target”) then SendChatMessage(“ENTER SPECIFIC MESSAGE HERE, “..name..”!”, “CHANNEL HERE”) else SendChatMessage(“ENTER GENERIC MESSAGE HERE”, “CHANNEL HERE”) end
You can put any of the following in channel: SAY, YELL, EMOTE, BATTLEGROUND, GUILD, OFFICER, PARTY, RAID, RAID_WARNING, AFK, DND, WHISPER. There are a couple that I want to do specific examples with: SAY, YELL, EMOTE.
This is an example using the say channel. Please note that after “name” there is an exclamation mark. You can change that as well if you don’t want to be loud, so to speak. You can also do emotes, yells, and other things with this emote and I’ll do those as well.
/run local name = UnitName(“target”); if UnitExists(“target”) then SendChatMessage(“You will not defeat me, “..name..”!”, “SAY”) else SendChatMessage(“I will not be defeated!”, “SAY”) end
Using Yell
/run local name = UnitName(“target”); if UnitExists(“target”) then SendChatMessage(“You will not defeat me, “..name..”!”, “YELL”) else SendChatMessage(“I will not be defeated!”, “YELL”) end
Using Emote
/run local name = UnitName(“target”); if UnitExists(“target”) then SendChatMessage(“grumbles at “..name..”.”, “EMOTE”) else SendChatMessage(“grumbles.”, “EMOTE”) end
Using Emote with quotes as the character speaks. Slashes have to be used to let the macro know that it’s not part of what you’re trying to tell it to do, but what you want it to say.
/run local name = UnitName(“target”); if UnitExists(“target”) then SendChatMessage(“grumbles at “..name..”, \”You’re such a pain.\”", “EMOTE”) else SendChatMessage(“grumbles. \”I hate doing this. It’s such a pain.\”", “EMOTE”) end
Whisper is a bit trickier and I’m not covering it in this particular guide. However Battleground, Guild, Officer, Party, Raid, and Raid_Warning should all work just like SAY does.
AFK and DND aren’t real channels, so they don’t work they same way. They’re just used to set your away message.
One more example:
/run local name = UnitName(“target”); if UnitExists(“target”) then SendChatMessage(“Sorry, I was just chatting with “..name..”.”, “SAY”) else SendChatMessage(“I was talking to someone around here, but I don’t know where they went.”, “SAY”) end
Gender Based
Let’s look at if I wanted to use someone’s gender instead of their name. I can also do different things depending on gender. Pretty much the same layout as above. The SendChatMessage function is so flexible that it’s one of the major ones to use if you want to say or emote something.
Using gender instead of name
/run local genderTable = {“unisex”, “male”, “female”}; gender = genderTable[UnitSex("target")]; if UnitExists(“target”) then SendChatMessage(“You will not defeat me, “..gender..”!”, “SAY”) else SendChatMessage(“I will not be defeated!”, “SAY”) end
Using gender instead of targeting (it will default to ‘else’ if you have no target or if it is unisex). We’re also going to assume that something is male if it is actually unisex. You could easily just use “gender=male” if you would prefer to switch that assumption.
I would love to use the below, but you get into complex ones like the below and you go beyond the 255 character limit for macros quickly.
/run local genderTable={“unisex”,”male”,”female”};gender=genderTable[UnitSex("target")]; if gender==female then SendChatMessage(“You are quite lovely, my lady.”,”SAY”) else if gender==male then SendChatMessage(“You look handsome, my lord.”,”SAY”) else SendChatMessage(“You look nice.”, “SAY”) end end
You could do it if you didn’t mind using numbers though.
/run if UnitSex(“target”)==3 then SendChatMessage(“You are quite lovely, my lady.”,”SAY”) else if UnitSex(“target”)==2 then SendChatMessage(“You look handsome, my lord.”,”SAY”) else SendChatMessage(“You look nice.”, “SAY”) end end
Here’s the gender numbers that UnitSex(“target”) can equal.
1 = Neutrum / Unknown
2 = Male
3 = Female
Race Based
Now we’ll do the same thing with race instead of name. Doesn’t work on NPCs unless you’re actively accepting or turning in a quest.
/run local race = UnitRace(“target”); if UnitExists(“target”) then SendChatMessage(“You will not defeat me, “..race..”!”, “SAY”) else SendChatMessage(“I will not be defeated!”, “SAY”) end
Class Based
Now we’ll do the same thing with class instead of name. Returns the name of NPCs from what I found.
/run local class = UnitClass(“target”); if UnitExists(“target”) then SendChatMessage(“You will not defeat me, “..class..”!”, “SAY”) else SendChatMessage(“I will not be defeated!”, “SAY”) end
Combining Action and Speech
Alright, alright. All talk, no action, right? Well, let me just give you a few tips about combining action and speech in your macros.
The most common is wanting to say something after a particular ability. You don’t need the lines with +fail or +interrupt, but you would add one or both of those if you wanted to say something different depending on failure or if your ability is interrupted. Typing aftercast and directly the message you want is the same as +done, so it’s not actually needed. This is what will be spoken after the cast. In the case of the below, “You will feel my wrath!”
/aftercast /s “You will feel my wrath!”
/aftercast +fail /s “You will not escape next time!”
/aftercast +interrupt /s “You have interrupted me for the last time!”
/cast Wrath
There’s one more option to aftercast that I just can’t resist…
/aftercast +start /s “Stay on target… stay on target…”
/aftercast /s “Gotcha!”
/cast Wrath
Also, you can use /s for Say, /p for Party, /r for Raid, and so on. It’s just like you were typing to speak in the different types of chats.
Well, that’s all for now, but if you have an idea for a macro be sure to tell me and I’ll look into it! Or if you have a macro you’d like to share in the comments, please do so. We could all use the information!
Thank you for visiting and hope to see you soon!
September 9th, 2009 at 8:48 am
[...] This post was Twitted by wowcynwise [...]
September 9th, 2009 at 10:07 am
Wow, almost everything in there is new to me. Very nice.
One thing at the end there caught my eye. The /r command is used to reply to a whisper that you’ve received. Will it use that functionality when not in a raid, but announce it to the raid if you are? How would that work?
September 9th, 2009 at 12:31 pm
[...] This post was mentioned on Twitter by Arrens, Arcania, Arcania, Cynwise of Stormwind and others. Arrens said: RT @Arcania Lunch RT: WoW Post! Using Macros in RP: http://tinyurl.com/mofsom [...]
September 15th, 2009 at 11:16 pm
I’m going to try and check this out. I haven’t had time, but I’m curious.
October 8th, 2009 at 9:11 am
[...] Warpriestess – Using Macros in RP [...]