Skip to content

Instantly share code, notes, and snippets.

@shanesveller
Created July 8, 2010 22:55
Show Gist options
  • Select an option

  • Save shanesveller/468769 to your computer and use it in GitHub Desktop.

Select an option

Save shanesveller/468769 to your computer and use it in GitHub Desktop.
Wherein I suck at using Lua tables
-- Help me Obi-wan!
-- Also, Notepad++ still sucks, but my Mac Mini is powered off while I get ready to raid tonight
for bagId=1,NUM_BAG_SLOTS do
-- items[bagId] = {}
for slotId=1,GetContainerNumSlots(bagId) do
local link = GetContainerItemLink(bagId, slotId)
if link then
local _, _, quality, itemLevel, _, itemType = GetItemInfo(link)
-- link_FindSearchInTooltip was renamed in a recent push
if (quality == 2 and itemLevel > maxLevel and (itemType == "Armor" or itemType == "Weapon") and ns:FindTextInTooltip(link, ITEM_BIND_ON_EQUIP)) then
self.Print("BOE Green found: " .. link)
-- This is like... 0.01% less ugly. How can I do it better?
items[bagId] = items[bagId] or {}
tinsert(items[bagId], slotId)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment