PDA

View Full Version : possible to get class info from a whisper?


bnelsonjax
02-06-2006, 10:11 AM
I need to find out the class type of a person that whispers me.

Does anyone know the function or code to do that?

Xinh
02-06-2006, 07:29 PM
Shift click on the person's name to get Class, guild, and location info

bnelsonjax
04-06-2006, 07:37 AM
this is the developers forum, im aware how to shift click on a name.

Im asking for function or code that would lookup the players class if they whisper you.
something like UnitClass...anyone know?

BamED
04-06-2006, 09:11 AM
There is no direct way of doing that. You will probably have to use the functions and events that the "Who"-interface uses. I have never used them myself, so I cannot give much help. There is some documentation here:

http://www.wowwiki.com/World_of_Warcraft_API#Who_Functions

AFAIK, the who-functionality is asynchrone. That means, when you request information from the server, the result is not returned immediately. Instead an event will be fired later when the result is ready for retrieval using other functions. There is also a time limit on how often the client can make a who-request. So you are not guaranteed to always get a result back. Lastly, doing a who-request may open up the Who-dialog or print results to the chat window. It is possible that you could hook into Blizzard's code for the who-dialog to prevent that, though.

In summary, it's not easy and you are never sure to get a result. So don't make you program too dependent on it. :shocked: