Basically trying to teach myself how to write addons, and the current task at hand is to cycle through all the items in my bags, and get the item level.
The problem I have is when I call "GetContainerItemID", it just returns nil for every combination of bag and slot, even though I expect at least 5 of those slots, not to return nil
local eventFrame = CreateFrame("FRAME");
eventFrame:RegisterEvent("BAG_UPDATE");
local function listBagItems ()
for intBag=0,NUM_BAG_SLOTS do
for intSlot=1, GetContainerNumSlots(intBag) do
local intItem = GetContainerItemID(intBag, intSlot)
print(intItem, intBag, intSlot)
end
end
end
local function eventHandler (self, event, arg)
print ("Event Caught", event)
if event == "BAG_UPDATE" then
listBagItems()
end
end
eventFrame:SetScript("OnEvent", eventHandler);
Hopefully someone can point me in the right direction, or at least point out my mistake?
Tx in advance.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Disclaimer: Brand new to writing WoW addons.
Basically trying to teach myself how to write addons, and the current task at hand is to cycle through all the items in my bags, and get the item level.
The problem I have is when I call "GetContainerItemID", it just returns nil for every combination of bag and slot, even though I expect at least 5 of those slots, not to return nil
Hopefully someone can point me in the right direction, or at least point out my mistake?
Tx in advance.