Quantcast WoWInterface: SVN - AchievementGratz - Rev 2 - /AchievementGratz.lua

WoWInterface SVN AchievementGratz

[/] [AchievementGratz.lua] - Rev 2

Compare with Previous | Blame | View Log

-- function sendWhisper volée dans DBM
local function sendWhisper(target, msg)
        if type(target) == "number" then
                if not BNIsSelf(target) then -- never send BNet whispers to ourselves
                        BNSendWhisper(target, msg)
                        return true
                end
        elseif type(target) == "string" then
                -- whispering to ourselves here is okay and somewhat useful for whisper-warnings
                SendChatMessage(msg, "WHISPER", nil, target)
                return true
        end
end
local EventFrame = CreateFrame("Frame","EventFrame",UIParent)
EventFrame:RegisterEvent("CHAT_MSG_ACHIEVEMENT")
EventFrame:RegisterEvent("CHAT_MSG_GUILD_ACHIEVEMENT")
EventFrame:SetScript("OnEvent", function(self,event,...) 
        local arg1, arg2, arg3, arg4, arg5 = select(1,...);
        if ( event == "CHAT_MSG_ACHIEVEMENT" ) then 
                sendWhisper(arg2, "gg")
        elseif ( event == "CHAT_MSG_GUILD_ACHIEVEMENT" ) then
                sendWhisper(arg2, "gg")
        end
end)

Compare with Previous | Blame