Quantcast WoWInterface - View Single Post - Get a Player's Class & Level
View Single Post
02-01-20, 03:19 PM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,447
Say you wanted to find out about someone who whispered you...

These are the values that that event will have in its arguments
https://wow.gamepedia.com/CHAT_MSG_WHISPER
"text", "playerName", "languageName", "channelName", "playerName2", "specialFlags", zoneChannelID, channelIndex, "channelBaseName", unused, lineID, "guid", bnSenderID, isMobile, isSubtitle, hideSenderInLetterbox, supressRaidIcons

The GUID value has it's own set of values if you know how to extract it ..
https://wow.gamepedia.com/GUID


The following is a quick code up and is not necessarily 100% working but should give you an idea of how you can use it.

Lua Code:
  1. function OnChatEvent(self, event, ... )
  2.    local args = { ... }
  3.  
  4.    local localizedClass, englishClass, localizedRace, englishRace, sex, name, realm = GetPlayerInfoByGUID(args[12])
  5.  
  6.   -- Deal with PlayerInfo as needed
  7.  
  8. end
  9.  
  10. local frame = CreateFrame("EventWatcher")
  11. frame:RegisterEvent("CHAT_MSG_WHISPER")
  12. frame:SetScript("OnEvent", OnChatEvent)
__________________

Last edited by Xrystal : 02-01-20 at 03:23 PM.
  Reply With Quote