elseif ( event == "GOSSIP_SHOW" and GetUnitName(self.unit) == "UNIT NAME") then
local f = CreateFrame('frame') f:RegisterEvent('PLAYER_LEVEL_UP') f:RegisterEvent('CHAT_MSG_SYSTEM') f:SetScript('OnEvent', function(self, event, ...) if event == 'PLAYER_LEVEL_UP' then SendChatMessage("I've leveled up!") else local message = ... if message:find('Welcome...") then SendChatMessage('Somebody has whispered me!') end end end)
local f = CreateFrame('frame') f:RegisterEvent('PLAYER_LEVEL_UP') f:RegisterEvent('CHAT_MSG_WHISPER') f:RegisterEvent("PLAYER_TARGET_CHANGED"); f:SetScript('OnEvent', function(self, event, ...) if event == 'PLAYER_LEVEL_UP' then SendChatMessage("I've leveled up!") elseif event == 'CHAT_MSG_WHISPER' then local message = ... if message:find('This is a test') then SendChatMessage('Somebody has whispered me!') end end end)
ChatFrame_MessageEventHandler2 = ChatFrame_MessageEventHandlerfunction ChatFrame_MessageEventHandler(s,e,arg1,...) if arg1 ~= nil then if arg1 ~= "" then if string.find(arg1, "[CU-ADDON]", 1, true) ~= nil then if (arg1 == "[CU-ADDON] OpenMenuFactionChoose") then DestinyFrame_OnEvent(DestinyFrame, 0); end return; elseif string.find(arg1, "CHAOTIC:SCENARIO", 1, true) ~= nil then return; elseif string.find(arg1, "[EoC-Addon]", 1, true) ~= nil then if (arg1 == "[EoC-Addon] HungerGamesOpen") then HungerGames:Show() end return; end end end ChatFrame_MessageEventHandler2(s,e,arg1,...)end