Hello friends wowinterface,
I have an addon and would like to make some changes in his operation.
I would like it to check if I'm in the guild "x" and am in rank "3", if so it executes the code, if not, it does nothing.
You can?
Follow the code
Code:
local nocanal = 0
local strings = {}
strings[1] = "123"
strings[2] = "321"
local function onUpdate(self,elapsed)
nocanal = nocanal + elapsed
if nocanal >= 300 then
local sendToChannel = 2
if GetChannelName(sendToChannel) == 0 then
sendToChannel = 1
end
SendChatMessage(strings[random(1,2)], "CHANNEL", GetDefaultLanguage("player"), sendToChannel);
nocanal = 0
end
end
local f = CreateFrame("frame")
f:SetScript("OnUpdate", onUpdate)
f:SetScript("OnEvent",onEvent)