I have a problem regarding loading another path when there are only 3 spaces in bag left.
Following code is within a waypoint
Trigger for mainhands duration is allready set and working like a charm!
I have a problem regarding loading another path when there are only 3 spaces in bag left.
Following code is within a waypoint
Trigger for mainhands duration is allready set and working like a charm!
(..)
if( inventory:getItemCount(0) > 58 ) then
loadPaths("ravenfell_sellnpcl"); end
Isnt it true that inventory:getItemCount(0) returns the value of total items occupied in the bag?
How can i solve my problem?
HI!
You have 2 issues here.... lets analyze!
1. did you test inventory:getItemCount(0) ? try printf(inventory:getItemCount(0));
--> It returns the number of empty spaces, thus it solves your problem!
2. If it returned the number of occupied slot it would work fine if you have a 60 items back, to account for any bagsize you should use a variable that gives you the bag sizea dn decrease it by 3 instead of "58".
if( 4 > inventory:getItemCount(0) ) then
loadPaths("ravenfell_sellnpcl");
end
jduartedj wrote:EDIT: I'm guessing 0 stands for "Empty space" item-ID.
That is correct. getItemCount can accept a name or id but because empties have a '<' symbol in their names ("<EMPTY>") using the name will cause problems so we can just use the empty id, which is "0", instead.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
I didn't know that lua didn't support that symbol because I never used it in lua, yet it seemed logical that if > worked then < would too. But thanks for that!
Hope you have a better botting XP now, Gold!
Thanks for reading!
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Lua supports '<' just fine so you can use them in .lua documents. It is because it is in an .xml document that it causes trouble. It gets interpreted as a beginning of a tag so you get a "malformed tag" error.
There are 2 ways to avoid it.
1. Use CDATA tags eg.