Nothing wrong in using lua, if I get the food in my inventory then Tool.HasItem will find it regardless of the method I'm using to obtain it, and I think it's a very good method to obtain the item. I mean the C# for HasItem is even using lua to return item amount. The problem I'm having has nothing to do with this at all ? the bot is not even approaching the NPC to interact.
The condition for NPC interaction is this:
return Tool.HasItem("Graccu's Mince Meat Fruitcake") < 0;
Naturally, a newly made character will fill this condition as it has none of that food. I don't understand why is the bot not moving to interact with the NPC?
---
itemCount() is my own custom function, it returns how many of particular item I have in my bag. As I said, everything works flawlessly, I am not new to using LUA or making LUA functions for WoW ?
--
I want to clear some confusion, my addon has Nothing to do with WRobot. It just buys me food when I right click (interact) with the NPC, the addon does this regardless whether I have WRobot running or not. It works 100% fine.
All I want WRobot to do, is to right click (interact) with the NPC. When I don't have food in my inventory, which return I am trying to get with Tool.HasItem - that's really all! ?