Created
July 8, 2010 22:55
-
-
Save shanesveller/468769 to your computer and use it in GitHub Desktop.
Wherein I suck at using Lua tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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