The current code is this...
Code:
local nocanal = 0
local strings = {}
strings[1] = "<WOW> 123"
strings[2] = "<WOW> 321"
local function onUpdate(self,elapsed)
nocanal = nocanal + elapsed
if nocanal >= 300 then
if not IsInGuild() then return end
local myGuildName = "Guild"
local guildName, guildRankName, guildRankIndex = GetGuildInfo("player")
if not (guildName == myGuildName and guildRankIndex == 1) then return end
local sendToChannel = 2
if GetChannelName(sendToChannel) == 0 then
sendToChannel = 1
end
SendChatMessage(strings[random(1,10)], "CHANNEL", GetDefaultLanguage("player"), sendToChannel);
nocanal = 0
end
end
local f = CreateFrame("frame")
f:SetScript("OnUpdate", onUpdate)
GuildRoster()
He is working perfectly.
I would like to add a function that checks before sending the message, the channel / 2 and / 1 in text search WOW and if found, it resets the "nocanal = 0" so it is no Spamming. understand?
is it possible?