dida1990 51 Posted May 16, 2016 Share Posted May 16, 2016 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? Link to comment https://wrobot.eu/forums/topic/3028-fight-class-check-for-item-in-bag/ Share on other sites More sharing options...
Droidz 2738 Posted May 17, 2016 Share Posted May 17, 2016 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: dida1990 1 Link to comment https://wrobot.eu/forums/topic/3028-fight-class-check-for-item-in-bag/#findComment-14002 Share on other sites More sharing options...
Droidz 2738 Posted May 17, 2016 Share Posted May 17, 2016 You can also use condition "Item Count": dida1990 and BetterSister 2 Link to comment https://wrobot.eu/forums/topic/3028-fight-class-check-for-item-in-bag/#findComment-14003 Share on other sites More sharing options...
dida1990 51 Posted May 17, 2016 Author Share Posted May 17, 2016 ah, nice :) and I did so much work, getting into bag and so on :D But thanks, it is working :) Link to comment https://wrobot.eu/forums/topic/3028-fight-class-check-for-item-in-bag/#findComment-14008 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now