Reply
 
Thread Tools Display Modes
Old 08-16-13, 05:22 PM   #1
Gr4vitas
A Defias Bandit
Join Date: Oct 2008
Posts: 2
Get chat text?

I've been trying for a while now to get chat text.

For example, someone whispers you, I want to get that whisper and save it in my saved variables so I can read it out later.

I'm just struggling to find a method that returns a chat message (specifically a whisper).

Is this possible?
Gr4vitas is offline   Reply With Quote
Old 08-16-13, 05:38 PM   #2
p3lim
Mmmrrrggglll
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,167
http://wowprogramming.com/docs/events/CHAT_MSG_WHISPER
p3lim is offline   Reply With Quote
Old 08-16-13, 05:48 PM   #3
Gr4vitas
A Defias Bandit
Join Date: Oct 2008
Posts: 2
Any chance you could give me an example of the format I'd want to use if I wanted to get a chat whisper? I'm a newb to lua still the syntax.
Gr4vitas is offline   Reply With Quote
Old 08-16-13, 06:13 PM   #4
SDPhantom
A Molten Giant
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 941
Lua Code:
  1. local EventFrame=CreateFrame("Frame");--    Create event listener, any frame type will do
  2. EventFrame:RegisterEvent("CHAT_MSG_WHISPER");-- Register event to listen to
  3. EventFrame:SetScript("OnEvent",function(self,message,sender)--  Create and register OnEvent handler
  4. --  Do something here
  5. end);
__________________
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
SDPhantom is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » General Authoring Discussion » Get chat text?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off