View Single Post
04-16-11, 10:16 AM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
I think I see what you mean, basically something like this I guess?


It should be possible by pre-hooking SendChatMessage I reckon.

Code:
local orig = SendChatMessage
function SendChatMessage(text, chan, ...)
  if chan ~= "EMOTE" then
    local emote = text:match("*(.+)*")
    if emote then
      text = text:gsub("*(.+)*", "")
      orig(text, chan, ...)
      return DoEmote(emote)
    end
  end
  return orig(text, chan, ...)
end
It's just an example, haven't tested it and there may be an easier way to do this. In short what I tried to do is match the "*string*" remove it from the message then send the message and finally the emote in the ** tags.
  Reply With Quote