Advertisement
Xzempt

Untitled

Apr 7th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.49 KB | None | 0 0
  1. function GetAlts(msg)
  2. local total = GetNumGuildMembers()
  3. local count = 0
  4. guild = { }
  5. local x = 1
  6. local yearsOffline, monthsOffline, daysOffline, hoursOffline = GetGuildRosterLastOnline(x);
  7. local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(x)
  8. SetGuildRosterShowOffline(true)
  9.         if msg and name then
  10.         table.wipe(guild)
  11.             for x = 1, total do
  12.                 local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(x)
  13.                 if (string.match(string.lower(note), msg)) then
  14.                 table.insert(guild, name)
  15.                     --SendChatMessage("Character Name: |cffff00ff" ..name.. "|r Rank: |cffff00ff" ..rank.. "|r Note: |cffff00ff" ..note.. "|r", "OFFICER")
  16.                     count = count + 1
  17.                 end
  18.                 if (count > 1) and (x == total) then
  19.                     local found = table.concat(guild, ", ")
  20.                     SendChatMessage("Found: " ..#guild.. " entries for \" " ..msg.. "\". Listing...", "OFFICER")
  21.                     SendChatMessage("|cffff00ff" ..found.. " |r", "OFFICER")
  22.                 end
  23.             end
  24.             if (count == 0) and (x == total) then
  25.                 print("Nothing Found.")
  26.             end
  27.         end
  28.     end
  29.     if (msg == "clean") then
  30.         for x = 1, total do
  31.             local yearsOffline, monthsOffline, daysOffline, hoursOffline = GetGuildRosterLastOnline(x);
  32.             local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(x)
  33.             if (daysOffline >= 15) or (monthsOffline >= 1) or (yearsOffline >= 1) and (x ~= total) then  
  34.                 count = 1
  35.                 GuildUninvite(name)
  36.             end
  37.             if (count == 0) and (x == total) then
  38.                 print("Nothing Found...")
  39.             end
  40.         end
  41.     end
  42.     if (msg == "resetnotes") then
  43.         for x = 1, total do
  44.             local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(x)
  45.             table.insert(guild, name)
  46.             if (x == total) then
  47.                 print("Found: " ..#guild.. " entries")
  48.                 for x = 1, total do
  49.                     GuildRosterSetPublicNote(x, guild[x])
  50.                     GuildRosterSetOfficerNote(x, guild[x])
  51.                 end
  52.             end
  53.         end
  54.     end
  55.  
  56. SLASH_gi1 = '/gi'
  57. function SlashCmdList.gi(msg, editbox)
  58. if (msg ~= "clean") and (msg ~= "resetnotes") then
  59.     SendChatMessage("Searching for alts of " ..msg.. " ...", "OFFICER")
  60.     msg = string.lower(msg)
  61.     GetAlts(msg)
  62.     else
  63.         GetAlts(msg)
  64.     end
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement