Page 1 of 1
[REQ] occupiedSlots, totalSlots = 60/60 then run Merchantxml
Posted: Tue May 03, 2011 5:26 am
by Ascendency4
i "think" my request is fairly simple but my lack of knowledge regarding syntax for this bot has left me stumped on this one.
i have many many waypoints which run a simple loop out gathering various things far far from a vendor so in the last <waypoint> </waypoint> of each loop i would like to do a bag count check.
all my bots have the normal two bags so it would check if 60/60 slots are full if so. run blahblah_Merchant.xml which would be a waypoint that reverts to the long walk to a vendor, cleans my bags, maybe mails off runes/dailies/mats then walks back.
would someone be so kind as to provide me the proper code to do a bagcheck and revert to another waypoint if the conditions are met?
Re: [REQ] occupiedSlots, totalSlots = 60/60 then run Merchan
Posted: Tue May 03, 2011 8:08 am
by rock5
Yes, pretty simple.
Code: Select all
if inventory:itemTotalCount("<EMPTY>") == 0 then -- 0 empty spaces in bag
loadPathS("blahblah_Merchant.xml")
end
Re: [REQ] occupiedSlots, totalSlots = 60/60 then run Merchan
Posted: Tue May 03, 2011 10:00 am
by Ascendency4
you rock ^_^
(no pun intended)
Re: [REQ] occupiedSlots, totalSlots = 60/60 then run Merchan
Posted: Tue May 03, 2011 11:30 am
by Ascendency4
Code: Select all
if inventory:itemTotalCount("<EMPTY>") == 0 then loadPathS ("Notes_Merchant.xml")
is giving me a " XML Parse "error. it doesnt seem to be capable of compiling the ("<EMPTY>") would simply:
Code: Select all
if inventory:itemTotalCount(0) == 0 then
reach the same effect? or am i missing something?
Re: [REQ] occupiedSlots, totalSlots = 60/60 then run Merchan
Posted: Tue May 03, 2011 11:45 am
by rock5
That's what I usually do but I thought I'd do something different this time. It does work, I tested it. Maybe the capital S in loadPathS is causing the error, sorry. Also, did you include an 'end'?
Re: [REQ] occupiedSlots, totalSlots = 60/60 then run Merchan
Posted: Tue May 03, 2011 12:07 pm
by Ascendency4
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- # 1 --><waypoint x="10274" z="7289" y="-9"> </waypoint>
<!-- # 2 --><waypoint x="10018" z="7556" y="20"> </waypoint>
<!-- # 3 --><waypoint x="9713" z="7597" y="12"> </waypoint>
<!-- # 4 --><waypoint x="9595" z="7414" y="7"> </waypoint>
<!-- # 5 --><waypoint x="9749" z="7088" y="-8"> </waypoint>
<!-- # 6 --><waypoint x="10191" z="7149" y="-3"> if inventory:itemTotalCount("<EMPTY>") == 0 then loadPathS("Earthcrabs_Merchant.xml") end </waypoint>
</waypoints>
no idea where i went wrong. however rombot appears to be upset about the ("<EMPTY>") as my yellow text error message says line: 7 Collumn: 139 Pos: 500 Message: mismatched tag
Re: [REQ] occupiedSlots, totalSlots = 60/60 then run Merchan
Posted: Tue May 03, 2011 12:25 pm
by rock5
Ah yes, the '<' bracket problem. That's probably why I used to use '0' instead. I forgot about that. I tested it with the command line script. That doesn't suffer from that problem. That's why it worked. Yeh, so just use 0.
And don't forget to change the capital 'S' to a small 's'.
Code: Select all
<!-- # 6 --><waypoint x="10191" z="7149" y="-3"> if inventory:itemTotalCount(0) == 0 then loadPaths("Earthcrabs_Merchant.xml") end </waypoint>