j311yf1sh

Pull items

Sep 20th, 2012
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.50 KB | None | 0 0
  1. --Spare space start
  2. local CHARACTER_NAME = UnitName("player")
  3.  
  4. --Start
  5.  
  6. --function ContainCheck(table, element)                                                             -- Unused function currently
  7.   --for Value, _ in pairs(table) do
  8.     --if value == element then
  9.       --return true
  10.     --end
  11.   --end
  12.   --return false
  13. --end
  14.  
  15.  
  16. SLASH_GGLYPHS1 = '/gglyphs';                                                                        -- Define the "/" Command.
  17. function SlashCmdList.GGLYPHS(msg, editbox)                                                         -- Handle the "/"
  18.     for GuildTab=1, 3 do                                                                            -- Start loop to iterate over bank tabs 3 = max tab you want to check
  19.         for GuildTabSlot=1, 98 do                                                                   -- Iterate over tab slots
  20.             PlayerAuctionsDB = TSMAPI:GetData("playerauctions", CHARACTER_NAME)                     -- Load Character auctions
  21.             ItemLink = GetGuildBankItemLink(GuildTab, GuildTabSlot)                                 -- Get item in Tab/Spot
  22.             ItemLinkID = TSMAPI:GetItemID(ItemLink, true)                                           -- convert item link into item ID
  23.             print(ItemLinkID)
  24.             for ItemInDB, _ in pairs(PlayerAuctionsDB) do                                           -- Add the key value to ItemInDB
  25.                 print(ItemInDB)                                                                     -- Checking to see if it actually recieved a key, Not needed
  26.                 if ItemInDB ~= ItemLinkID then                                                      -- Comparing if the itemid is in the table
  27.                     print("item "..ItemLinkID.." not found on AH")                                  -- if so print
  28.                     AutoStoreGuildBankItem(GuildTab, GuildTabSlot)                                  -- Grab the item from the guildbank tab / slots
  29.                 else
  30.                     print("Item Not Found")                                                         -- Print if the item is not found
  31.                 end
  32.             end
  33.         end
  34.     end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment