Misdirecting and saying who the MD is to

I searched around the forums but i didnt find exactly what i was looking for and when I tried to edit code myself I failed horribly. So I have the macro

Code:

#showtooltip
/cast [@focus,help][help][@pet,exists] Misdirection

and it works great put what i would like to add to it would be to say who I'm misdirecting to. For example if i have my tank as my focus target it would say in raid 'Misdirecting to Tank', but if tank died it would say 'Misdirecting to Pet'. Is that possible?

Last edited by Treeston; 2012-11-30 at 06:29 AM.
Reason: Added in the "@" signs you couldn't post to avoid confusion.

So when the raid group pulls in a boss I should MD my pet? That doesn't make sense. Its nice to have the macro that i can use for raid and solo, plus it tells me if i forget to put the off tank on focus. If its not going to work I'm not worried.

Originally Posted by Jeremypwnz

There's always the option of JS' Hunter Bar. It has a MD Announce.

Does JS still have the MD Announce as a separate addon?

I would rather not run an addon if a macro would work. The macro Treeston made works perfectly. I was just hoping there was an easy command for my pet name.

Works great. Thank you. I have one more question to ask though. I replaced 'Tank' with %f and that works fine, but when I tried to replace 'Pet' with %p it didn't. Is there another code for pet?

If you want the unit's name, then use this:

Code:

#showtooltip
/cast [@focus,help][help][@pet,exists]Misdirection
/run local s,t=SecureCmdOptionParse("[@focus,help][help][@pet,exists]") if s then t=t or "target" SendChatMessage(("Misdirecting to %s"):format(GetUnitName(t),"RAID") end

I think you could do it with WeakAuras and announcing? Just tested real quick (although with my deterrence macro instead of misdirect) typing in 'Deterrence on %f' with myself as focus and got a chat msg saying 'Deterrence on Rakky' so it should work as long as you make a misdirect aura of your liking.

EDIT: This does NOT cause any chat spam if you happen to be spamming the macro, as the text triggers on aura active in WeakAuras and not when you're pressing the button.