I'm writing a very small misdirection broadcast addon for my own use, it's working like a charm but i've got one very small issue.
See this code
if MDevent == "SPELL_CAST_SUCCESS" then
if MDspell == "Misdirection" then
if MDsource and MDtarget then
local index = GetChannelName("Blahblahchannel")
if (index~=nil) then
SendChatMessage((MDsource .." cast Misdirection on ".. MDtarget) , "CHANNEL", nil, index);
SendChatMessage(("Misdirection on you"), "WHISPER", GetDefaultLanguage("player"), MDtarget);
My MD macro does the following, MD to my target if i have one, md to my focus if i have none, md to my pet if i have no target and no focus.
It works just fine but when i have no target and no focus it tries to whisper my pet of course and give me the "no player named windserpent is currently playing"
I've tried to replace 'if MDsource and MDtarget' then with something like 'if MDsource and MDtarget and (MDtarget == "player")' but as youc an guess it doesn't work because player = myself.
I've tried to find out on wowwiki looking for UnitID but can't find how are players defined, i mean all the players, not just myself, i'm not sure if i make myself clear :)