Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local timer = CreateFrame("Frame")
- timer:RegisterEvent("OnUpdate")
- function delayed(delay, func)
- timer.func = func
- timer.delay = delay
- timer:Show()
- end
- timer:SetScript("OnUpdate", function(self, elapsed)
- if running == true then
- timer.delay = timer.delay - elapsed
- if timer.delay <= 0 then
- timer:Hide()
- timer.func(delay, msg1)
- end
- end
- end)
- local count = 0
- local Inactive = { }
- function GatherData(delay, msg1)
- SetGuildRosterShowOffline(true)
- local guildtotal = GetNumGuildMembers()
- local scm = SendChatMessage
- if not index then index = 1 else index = index + 1 end
- if (removing == true) and (count > 0) then
- local inactive = table.concat(Inactive, ", ")
- removed = table.remove(Inactive)
- GuildUninvite(removed)
- count = count - 1
- delayed(20, GatherData)
- else
- if (removing == true) and (count == 0) then
- removing = false
- scm(entries.. " characters removed. Script Completed Successfully.", "PARTY")
- running = false
- index = 0
- else
- delayed(20, GatherData)
- end
- end
- if (index == guildtotal) and (count > 0) then
- entries = #Inactive
- removing = true
- delayed(0, GatherData)
- end
- if (index == guildtotal) and (count == 0) then
- print("no kicks Script Completed Successfully.")
- running = false
- index = 0
- else
- local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(index)
- if (name) then
- if (msg1 == "resetnotes") then
- print(name)
- print(name)
- delayed(1, GatherData)
- end
- if (msg1 == "clean") then
- local yearsOffline, monthsOffline, daysOffline, hoursOffline = GetGuildRosterLastOnline(index);
- if (daysOffline == nil) and (monthsOffline == nil) and (yearsOffline == nil) and (hoursOffline == nil) then
- delayed(0, GatherData)
- end
- if (daysOffline) or (monthsOffline) or (yearsOffline) or (hoursOffline) then
- if (daysOffline >= 2) or (monthsOffline >= 1) or (yearsOffline >= 1) then
- count = count + 1
- table.insert(Inactive, name)
- delayed(0, GatherData)
- else
- delayed(0, GatherData)
- end
- end
- if (count == 0) and (index == guildtotal) then
- print("Nothing Found...")
- end
- end
- if (msg1 == "autob") then
- delay = delay / 60
- print(delayed)
- --SendChatMessage("Don't forget to stay up to date on raid schedules on our website. Site: http://guerrillawarfare.biz |cffff00ffAuto Broadcast.|r( " ..delayed.. " minute delay)", "OFFICER")
- --delayed(5, GatherData)
- end
- end
- end
- end
- SLASH_gi1 = '/gi'
- function SlashCmdList.gi(msg, editbox)
- if (msg ~= "autob") and (msg ~= "clean") and (msg ~= "resetnotes") and (msg ~= string.lower("test")) then
- SendChatMessage("Searching for alts of " ..msg.. " ...", "OFFICER")
- msg1 = string.lower(msg)
- GetAlts(msg, msg1)
- end
- if (msg == string.lower("clean")) or (msg == string.lower("resetnotes")) or (msg == string.lower("autob")) then
- msg1 = string.lower(msg)
- running = true
- delayed(3, GatherData)
- else
- GetAlts(msg)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement