May 16, 20169 yr I want to check if an item is in my bag (in this case Soul Chard) and let the variable "ret" be setted to "true". This is the code I come up with: local itemID = 6265 ret = false for i = 0, NUM_BAG_SLOTS do for z = 1, GetContainerNumSlots(i) do if GetContainerItemID(i, z) == itemID then ret = true break end end end In the development tool it returns "true" if i got the item in back and false if I don't (like it should). But when I insert it as a LUA-condition into the fight class it always return false and will not use my spell How do I have to change my code?
May 17, 20169 yr Hello, why not use http://wowwiki.wikia.com/wiki/API_GetItemCount like this: ret = GetItemCount(6265) > 0; You use it like this in your fightclass:
May 17, 20169 yr Author ah, nice :) and I did so much work, getting into bag and so on :D But thanks, it is working :)
Create an account or sign in to comment