Advertisement
Xzempt

Untitled

Apr 16th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.08 KB | None | 0 0
  1. local timer = CreateFrame("Frame")
  2. timer:RegisterEvent("OnUpdate")
  3. function delayed(delay, func)
  4.     timer.func = func
  5.     timer.delay = delay
  6.     timer:Show()
  7. end
  8. timer:SetScript("OnUpdate", function(self, elapsed)
  9.     if running == true then
  10.         timer.delay = timer.delay - elapsed
  11.         if timer.delay <= 0 then
  12.             timer:Hide()
  13.             timer.func(delay, msg1)
  14.         end
  15.     end
  16. end)
  17. local count = 0
  18. local Inactive = { }
  19. function GatherData(delay, msg1)
  20. SetGuildRosterShowOffline(true)
  21. local guildtotal = GetNumGuildMembers()
  22. local scm = SendChatMessage
  23. if not index then index = 1 else index = index + 1 end
  24.     if (removing == true) and (count > 0) then
  25.         local inactive = table.concat(Inactive, ", ")
  26.         removed = table.remove(Inactive)
  27.         GuildUninvite(removed)
  28.         count = count - 1
  29.         delayed(20, GatherData)
  30.     else
  31.         if (removing == true) and (count == 0) then
  32.             removing = false
  33.             scm(entries.. " characters removed. Script Completed Successfully.", "PARTY")
  34.             running = false
  35.             index = 0
  36.         else
  37.             delayed(20, GatherData)
  38.         end
  39.     end
  40.     if (index == guildtotal) and (count > 0) then
  41.     entries = #Inactive
  42.         removing = true
  43.         delayed(0, GatherData)
  44.     end
  45.     if (index == guildtotal) and (count == 0) then
  46.         print("no kicks Script Completed Successfully.")
  47.         running = false
  48.         index = 0
  49.     else
  50.         local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(index)
  51.         if (name) then
  52.             if (msg1 == "resetnotes") then
  53.                 print(name)
  54.                 print(name)
  55.                 delayed(1, GatherData)
  56.             end
  57.             if (msg1 == "clean") then
  58.                 local yearsOffline, monthsOffline, daysOffline, hoursOffline = GetGuildRosterLastOnline(index);
  59.                 if (daysOffline == nil) and (monthsOffline == nil) and (yearsOffline == nil) and (hoursOffline == nil) then
  60.                     delayed(0, GatherData)
  61.                 end
  62.                 if (daysOffline) or (monthsOffline) or (yearsOffline) or (hoursOffline) then
  63.                     if (daysOffline >= 2) or (monthsOffline >= 1) or (yearsOffline >= 1) then
  64.                         count = count + 1
  65.                         table.insert(Inactive, name)
  66.                         delayed(0, GatherData)
  67.                     else
  68.                         delayed(0, GatherData)
  69.                     end
  70.                 end
  71.                 if (count == 0) and (index == guildtotal) then
  72.                     print("Nothing Found...")
  73.                 end
  74.             end
  75.             if (msg1 == "autob") then
  76.                 delay = delay / 60
  77.                 print(delayed)
  78.                 --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")
  79.                 --delayed(5, GatherData)
  80.             end
  81.         end
  82.     end
  83. end
  84.  
  85.    
  86. SLASH_gi1 = '/gi'
  87. function SlashCmdList.gi(msg, editbox)
  88.     if (msg ~= "autob") and (msg ~= "clean") and (msg ~= "resetnotes") and (msg ~= string.lower("test"))  then
  89.         SendChatMessage("Searching for alts of " ..msg.. " ...", "OFFICER")
  90.         msg1 = string.lower(msg)
  91.         GetAlts(msg, msg1)
  92.     end
  93.     if (msg == string.lower("clean")) or (msg == string.lower("resetnotes")) or (msg == string.lower("autob")) then
  94.         msg1 = string.lower(msg)
  95.         running = true
  96.         delayed(3, GatherData)
  97.     else
  98.         GetAlts(msg)
  99.     end
  100. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement