How to switch to path when certain item amount is reached?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

How to switch to path when certain item amount is reached?

#1 Post by botje »

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
swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: How to switch to path when certain item amount is reache

#2 Post by swietlowka »

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 :)

Code: Select all

occupiedSlots, totalSlots = sendMacro("GetBagCount();");
	if( occupiedSlots > 35 ) then
   loadPaths("crab_merchant");
end
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
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: How to switch to path when certain item amount is reache

#3 Post by botje »

i see... yes , you have a point there :)

thanx, ill give this a shot ^^

Botje
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How to switch to path when certain item amount is reache

#4 Post by rock5 »

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
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: How to switch to path when certain item amount is reache

#5 Post by botje »

ok, cool, what about some examples for that then?

:)
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How to switch to path when certain item amount is reache

#6 Post by rock5 »

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
BTW. I added being able to count empties recently. I think it was in rev 513.
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
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: How to switch to path when certain item amount is reache

#7 Post by botje »

thats so cool :D

im gonna try it right away ^^

thanx man :)

Botje

edit:

yeah dont worry, im always updated :)
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: How to switch to path when certain item amount is reache

#8 Post by botje »

seems something is wrong, maybe its me, or maybe its the code i dunno xd

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'
and my waypoint file...

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>
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How to switch to path when certain item amount is reache

#9 Post by rock5 »

botje wrote:seems something is wrong, maybe its me, or maybe its the code i dunno xd
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,

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
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: How to switch to path when certain item amount is reache

#10 Post by botje »

ill try that when the server is back up :)

Botje
Post Reply