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.