Advertisement
Xzempt

Untitled

Mar 14th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. if not Looter then
  2.     Looter = CreateFrame("frame")
  3. end
  4.  
  5. LooterLootTable = { "Azshara's Veil", "Cinderbloom", "Heartblossom", "Stormvine", "Twilight Jasmine", "Whiptail", "Embersilk Cloth", "Sealed Crate", "Volatile Fire", "Volatile Earth", "Volatile Water", "Volatile Air", "Volatile Life", "Obsidium Ore", "Heavy Savage Leather", "Elementium Ore", "Pyrite Ore", }
  6. local frame = Looter
  7. frame:RegisterEvent("LOOT_OPENED")
  8. frame:SetScript("OnEvent", function(self, event, ...)
  9. LooterAutoLoot()
  10.  
  11. end)
  12. Looting = { };
  13.  
  14. function LooterAutoLoot()
  15. table.wipe(Looting)
  16. print("Found: " ..GetNumLootItems().. " item(s)")
  17.     for i = 1, GetNumLootItems() do
  18.         link = GetLootSlotLink(i)
  19.         texture, item, quantity, quality, locked = GetLootSlotInfo(i)
  20.         table.insert(Looting, link)
  21.         if (link) and (item) then
  22.             for u,v in ipairs(LooterLootTable) do
  23.                 if (item == LooterLootTable[u]) then
  24.                     table.remove(Looting, 1)
  25.                     LootSlot(i)
  26.                     print("|cffff00ffLooted: |r" ..link.. " |cffff00ffAmount: |r" ..quantity)
  27.                 else
  28.                     --print("Not Looting: " ..link, GetNumLootItems())
  29.                 end
  30.             end
  31.         end
  32.         if (i == GetNumLootItems()) then
  33.             discarded = table.concat(Looting, ", ")
  34.             if (discarded ~= "") then
  35.                 print("The following was discarded: " ..discarded)
  36.             end
  37.             CloseLoot()
  38.         end
  39.     end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement