Advertisement
Xzempt

Untitled

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