I am trying to make an addon that does a simple checking for achievement in guild and then spits out a chat message.
So far this is what I have come up with:
Code:
local frame = CreateFrame("Frame")
frame:RegisterEvent("CHAT_MSG_GUILD_ACHIEVEMENT")
frame:SetScript("OnEvent",
function(self, event)
SendChatMessage("oh wow grats","GUILD")
end)
Not sure what I am missing here, but this isn't working for me. Also I am trying to come up with a way to make it only do this every X seconds (so it doesnt spam after 20 people get an achievement for example). Any suggestions? Appreciate any help.