View Single Post
06-21-09, 11:16 AM   #2
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
This is actually really easy:

Code:
local me = CreateFrame("frame")

me:RegisterEvent("CHAT_MSG_MONSTER_EMOTE")
me:RegisterEvent("CHAT_MSG_MONSTER_SAY")
me:RegisterEvent("CHAT_MSG_MONSTER_WHISPER")
--add any others...that's probably good enough

me.listOfText = {
    "says \"Uggh\"", --note \" for quotes, since a literal " would close the string
    "I don't feel so well",
    "Ooh pretty shinies",
    "etc",
    "and so forth",
}

me.EventHandler(self, event, msg)
      for i = 1, #self.ListOfText do
           if msg:find(self.listOfText[i]) then
                 PlaySound("whateversoundyouwant")
                 RaidWarningFrame:AddMessage("msg")
                 return
           end
      end
end

me:SetScript("OnEvent", me.EventHandler)

Last edited by Akryn : 06-21-09 at 03:08 PM.
  Reply With Quote