Thread Tools Display Modes
11-15-14, 11:24 AM   #1
sptyi
A Murloc Raider
Join Date: Nov 2014
Posts: 6
Need help with DK Raise Ally macro

I'm using the Clique Addon. What I want to occur is when I mouseover a dead ally in a party/raid/instance, and press a hotkey (set in clique) it will put "Brezzing [target]" in a group appropriate chat, begin to Raise Ally, then whisper to the raised ally to "Rise" after a successful cast.

I am a complete WOW macro noob and have pieced this together from multiple sources, however I am not sure it will work as intended or if there is a more efficient way to complete the task. Thank you for your help beforehand.

Code:
/run local c=IsInGroup(2) and "INSTANCE_CHAT" or IsInRaid() and "RAID" or IsInGroup(1) and "PARTY" if c then SendChatMessage("Brezzing %t",c) end
/cast [@mousover]Raise Ally
/run SendChatMessage ("Rise","WHISPER",nil,GetUnitName("target",1):gsub(" ","",2))

Last edited by sptyi : 11-15-14 at 01:30 PM. Reason: Spelling
  Reply With Quote
11-15-14, 10:47 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
There's no need to call gsub here:

Code:
/run SendChatMessage ("Rise","WHISPER",nil,GetUnitName("target",1):gsub(" ","",2))
I assume this was intended to remove spaces from realm names, but the game hasn't included those for a while now.

Code:
/run SendChatMessage("Rise","WHISPER",nil,GetUnitName("target",1))
However:

Originally Posted by sptyi View Post
... then whisper to the raised ally to "Rise" after a successful cast.
There's no simple way to do this in a macro. Your current macro sends the message immediately. In order to delay the message, and only send it when the cast succeeds, you would need to create a frame and listen for an event. This isn't something you can do in a normal macro (since there isn't enough room) and probably should not be doing even in a Clique macro (which does give you more room).

Also, things like this are pretty annoying to the recipient -- if I'm getting a battle res, I don't need you to whisper me telling me I got a battle res, because I already know I got a battle res because the game already popped up a giant window in the middle of my screen telling me I got a battle res. You're not telling me anything new; you're just cluttering up my chat frame, and wasting my time by asking me to shift my attention to something totally irrelevant before I shift my attention back to the actually relevant giant window.

But if you really want to do it anyway, instead of letting you copy some terrifyingly badly written garbage from ArenaJunkies, here is the right way (or at least as much as there is a right way to do this) to do it:

Code:
/run if not RaiseAllyNotifier then local f, S, T = CreateFrame("Frame", "RaiseAllyNotifier"), GetSpellInfo(61999) f:RegisterUnitEvent("UNIT_SPELLCAST_SENT","player") f:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED","player") f:SetScript("OnEvent", function(_, e, _, n, _, t) if n == S then if type(t) == "string" then T = t else SendChatMessage("Rise", "WHISPER", nil, T) end end end) end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 11-16-14 at 01:01 PM. Reason: Fixed missing end quote tag
  Reply With Quote
11-16-14, 05:47 AM   #3
sptyi
A Murloc Raider
Join Date: Nov 2014
Posts: 6
Okay, I definitely see your point. I'll be sure to leave off the whisper. Thanks for your help.
  Reply With Quote
11-17-14, 08:08 AM   #4
sptyi
A Murloc Raider
Join Date: Nov 2014
Posts: 6
This is what I have ended up with:

Code:
/use [@mouseover,dead]Raise Ally
/focus [@mouseover]
/run local c=IsInGroup(2) and "INSTANCE_CHAT" or IsInRaid() and "RAID" or IsInGroup(1) and "PARTY" if c then SendChatMessage("Brezzing %f",c) end
/clearfocus
  Reply With Quote
11-17-14, 08:16 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
That'll work, though it would probably be better not to have it (temporarily) change your focus, since that will make it unusable with actual focus macros. Just use UnitName("mouseover") to get the name of your current mouseover unit.

Code:
/use [@mouseover,help,dead] Raise Ally
/stopmacro [@mouseover,nohelp][@mouseover,nodead]
/run local c=IsInGroup(2)and "INSTANCE_CHAT" or IsInRaid()and "RAID" or IsInGroup()and "PARTY" if c then SendChatMessage("Brezzing "..UnitName("mouseover"),c)end
I also added checks so it won't try to cast on hostile targets, and won't send a message if your mouseover target is hostile or not dead.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
11-17-14, 09:32 AM   #6
sptyi
A Murloc Raider
Join Date: Nov 2014
Posts: 6
That is perfect, once again, thank you very much for your help!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Need help with DK Raise Ally macro

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off