Thread Tools Display Modes
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?
  Reply With Quote
08-16-13, 05:38 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
http://wowprogramming.com/docs/events/CHAT_MSG_WHISPER
  Reply With Quote
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.
  Reply With Quote
08-16-13, 06:13 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
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);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » 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