Created
January 9, 2017 10:49
-
-
Save dkrusky/f2d3e76aa710a18e485ec62b000b7e61 to your computer and use it in GitHub Desktop.
Loop through all items in bags in World of Warcraft
This file contains 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
local function countItem(item) | |
local c | |
for bag=0,NUM_BAG_SLOTS do | |
for slot=1,GetContainerNumSlots(bag) do | |
if item == GetContainerItemID(bag,slot) then | |
c=c+(select(2,GetContainerItemInfo(bag,slot))) | |
end | |
end | |
end | |
return c | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment