How to switch to path when certain item amount is reached?
How to switch to path when certain item amount is reached?
like topic title explains, how would i switch to a new path file, for when i have collected 100 of a item?
i want to go drop it off, and empty bag and stock up on potions.
any help is appriciated ^^
Botje
i want to go drop it off, and empty bag and stock up on potions.
any help is appriciated ^^
Botje
-
swietlowka
- Posts: 316
- Joined: Wed Jun 16, 2010 8:16 am
Re: How to switch to path when certain item amount is reache
theres a problem with your point of view, when u use this function u can sometimes/all the time reach bull bagg, and dont loot no more untill u have x items, i use diffrent pattern and will share it with u
when using that one when i reach a waypoint with it it check how much space i have in backpack and if more than 35 (example) it runs to the merchant
Code: Select all
occupiedSlots, totalSlots = sendMacro("GetBagCount();");
if( occupiedSlots > 35 ) then
loadPaths("crab_merchant");
endRe: How to switch to path when certain item amount is reache
i see... yes , you have a point there 
thanx, ill give this a shot ^^
Botje
thanx, ill give this a shot ^^
Botje
Re: How to switch to path when certain item amount is reache
Typically you can check a few things when deciding if you want to go to the merchant, eg. if I have 100 items or my backpack is getting too full or my main hand durability is low then go to merchant. It doesn't have to be just 1 check.
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: How to switch to path when certain item amount is reache
ok, cool, what about some examples for that then?

Re: How to switch to path when certain item amount is reache
botje wrote:ok, cool, what about some examples for that then?
Code: Select all
if inventory:itemTotalCount("itemname") > 99 or -- 100 or more items
5 > inventory:itemTotalCount("<EMPTY>") or -- less than 5 spaces left in inventory
50 > inventory:getMainHandDurability() then -- durability less than 50%
loadPaths("crab_merchant");
end
Last edited by rock5 on Wed Nov 03, 2010 3:51 am, edited 1 time in total.
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: How to switch to path when certain item amount is reache
thats so cool
im gonna try it right away ^^
thanx man
Botje
edit:
yeah dont worry, im always updated
im gonna try it right away ^^
thanx man
Botje
edit:
yeah dont worry, im always updated
Re: How to switch to path when certain item amount is reache
seems something is wrong, maybe its me, or maybe its the code i dunno xd
and my waypoint file...
Code: Select all
Wed Nov 03 11:47:49 2010 : ...ents/micromacro/scripts/rom/classes/waypointlist.lua:21: XML Parse Error.
File: ...nts/micromacro/scripts/rom/waypoints/Raven/crabs.xml
Line: 16
Column: 4
Pos: 846
Message: mismatched tag
Wed Nov 03 11:47:49 2010 : Execution error: Runtime error
Wed Nov 03 11:49:42 2010 : Executing script 'bot.lua'
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- # 1 --><waypoint x="9733" z="6716"> </waypoint>
<!-- # 2 --><waypoint x="9997" z="6783"> </waypoint>
<!-- # 3 --><waypoint x="10263" z="6973"> </waypoint>
<!-- # 4 --><waypoint x="10337" z="7205"> </waypoint>
<!-- # 5 --><waypoint x="10348" z="7409"> </waypoint>
<!-- # 6 --><waypoint x="10144" z="7578"> </waypoint>
<!-- # 7 --><waypoint x="9856" z="7627"> </waypoint>
<!-- # 8 --><waypoint x="9607" z="7544"> </waypoint>
<!-- # 9 --><waypoint x="9564" z="7389"> </waypoint>
<!-- # 10 --><waypoint x="9547" z="7106"> </waypoint>
<!-- # 11 --><waypoint x="9572" z="6886">
if inventory:itemTotalCount("Spawn of Earth Shell Crabs") > 99 or -- 100 or more items
5 > inventory:itemTotalCount("<EMPTY>") or -- less than 5 spaces left in inventory
50 > inventory:getMainHandDurability() then -- durability less than 50%
loadPaths("Raven/CrabShop");
end
</waypoint>
<!-- # 12 --><waypoint x="9758" z="6672"> </waypoint>
</waypoints>
Re: How to switch to path when certain item amount is reache
Mismatched tags usually happen when using '<'. The only '<' is in "<EMPTY>". I didn't think it would cause a problem in quotes but obviously it does. You can enclose the lua code in CDATA tags but an easier solution is to just use empty id instead of the name,botje wrote:seems something is wrong, maybe its me, or maybe its the code i dunno xd
Code: Select all
5 > inventory:itemTotalCount(0)- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: How to switch to path when certain item amount is reache
ill try that when the server is back up 
Botje
Botje