How would I go about getting a players class from their name, if they are not near me (targetable), in my party, raid, guild, etc (As UnitClass() can only detect under these circumstances.)
I have a solution working, a-la /who: (where arg2= string value of players name)
PHP Code:
SendWho(arg2);
local charname, guildname, level, race, class = GetWhoInfo(1);
if(tostring(class)=="Mage")
...
end
Currently I've hooked the chat frame, and am parsing the arg1 strings of CHAT_MSG_SYSTEM to see if they are for the /who call and just ignore them.. the addon seemingly does this check without you knowing, however I would like another way besides having to do this workaround if possible!
Please let me know if I'm missing something.
Suggestions?