Need help with autoRepair

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
jason404
Posts: 29
Joined: Fri Feb 19, 2010 10:11 am

Need help with autoRepair

#1 Post by jason404 » Wed Mar 31, 2010 5:00 am

Hello, Im trying to make my script to go back to town by using recall after an hour of playing.
But currently im having a problem, when it reaches waypoint 13 the bot stop and receives this problem.
Image

<!-- # 13 --><waypoint x="-16112" z="-604">
if(player.free_counter1 == 0) then player.free_counter1 = os.time(); end;
if( os.difftime(os.time(), player.free_counter1) > 3600 )
player.free_counter1 = os.time();
player:rest(1);
RoMScript("UseSkill(=);"); --recall
yrest(40000); --wait while load screen
loadPaths("37repair.xml");
end
</waypoint>

This is my first time trying to make a repair waypoint. The repair and return waypoint works fine but only having a problem with the above.

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

Re: Need help with autoRepair

#2 Post by rock5 » Wed Mar 31, 2010 5:05 am

Code: Select all

if( os.difftime(os.time(), player.free_counter1) > 3600 )
You forget the 'then'.
  • 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

jason404
Posts: 29
Joined: Fri Feb 19, 2010 10:11 am

Re: Need help with autoRepair

#3 Post by jason404 » Wed Mar 31, 2010 5:15 am

Thanks so far its solved that problem now, time to test it out to see if the repair works successful.

Edit: Just wondering how do I use weak potions first instead of using the stronger ones.

Do I change the "best" to "worst"?

<option name="USE_HP_POTION" value="best" /> <!-- potion select strategy: best|minstack -->
<option name="USE_MANA_POTION" value="best" /> <!-- potion select strategy: best|minstack -->

Also was wondering i've made my bot to go to the repair point after killing 300 monsters. Does that mean if it kills another 300 monters it will go to the repair point again or would i have to add another script to make it go to the repair point after 600 monsters.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Need help with autoRepair

#4 Post by Administrator » Wed Mar 31, 2010 2:40 pm

If you reset the counter back to zero when you return, it will go kill another 300 and then go repair again.

jason404
Posts: 29
Joined: Fri Feb 19, 2010 10:11 am

Re: Need help with autoRepair

#5 Post by jason404 » Wed Mar 31, 2010 4:26 pm

Sorry if its a dumb question but how would I go on about to reset the counter? What command would i have to put?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Need help with autoRepair

#6 Post by Administrator » Wed Mar 31, 2010 4:47 pm

You tell me. I have no idea what you've done so far.

jason404
Posts: 29
Joined: Fri Feb 19, 2010 10:11 am

Re: Need help with autoRepair

#7 Post by jason404 » Wed Mar 31, 2010 5:05 pm

Well so far i've made it my script so when it reaches 380 kills it loads the repair script and goes back to town and repairs my armor

<!-- # 17 --><waypoint x="-15995" z="-834">
if( player.Fights-player.free_counter1 > 380 ) then
player.free_counter1 = player.Fights;
player:rest(1);
loadPaths("37repair.xml");
end
</waypoint>

It loads this script.

<!-- # 10 --><waypoint x="-13751" z="-349">
player:merchant("Jacques");
player:rest(4);
</waypoint>
<!-- # 11 --><waypoint x="-13793" z="-294"> </waypoint>
<!-- # 28 --><waypoint x="-15534" z="-174">
loadPaths("37.xml");
</waypoint>

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Need help with autoRepair

#8 Post by Administrator » Wed Mar 31, 2010 5:19 pm

player.Fights-player.free_counter1
Those are the two variables you're using, so:

Code: Select all

player.Fights = 0;
player.free_counter1 = 0;

jason404
Posts: 29
Joined: Fri Feb 19, 2010 10:11 am

Re: Need help with autoRepair

#9 Post by jason404 » Wed Mar 31, 2010 6:30 pm

So I would change it like this? Sorry its just im not that experience at using this yet.

<!-- # 17 --><waypoint x="-15995" z="-834">
if( player.Fights-player.free_counter1 > 380 ) then
player.free_counter1 = 0; player.Fights = 0;
player:rest(1);
loadPaths("37repair.xml");
end
</waypoint>

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Need help with autoRepair

#10 Post by Administrator » Wed Mar 31, 2010 7:16 pm

Yes.

jason404
Posts: 29
Joined: Fri Feb 19, 2010 10:11 am

Re: Need help with autoRepair

#11 Post by jason404 » Wed Mar 31, 2010 8:07 pm

Thanks lets hope it works fine.

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

Re: Need help with autoRepair

#12 Post by rock5 » Thu Apr 01, 2010 7:05 am

jason404 wrote:So I would change it like this? Sorry its just im not that experience at using this yet.

<!-- # 17 --><waypoint x="-15995" z="-834">
if( player.Fights-player.free_counter1 > 380 ) then
player.free_counter1 = 0; player.Fights = 0;
player:rest(1);
loadPaths("37repair.xml");
end
</waypoint>
Um... I think this change wasn't necessary. It would have worked the way it was.

Just to help you understand what's happening player.Fights gets incremented after every fight. player.free_counter1 holds the number of fights when you went back for repairs. So to see how many fights you've had since going back for repairs you look at the difference which is player.Fights - player.free_counter1.

Normally you do it this way so you can keep the overall number of fights in player.Fights. But if you are going to reset player.Fights to 0 anyway, you might as well just use that. Like this;

Code: Select all

<!-- # 17 --><waypoint x="-15995" z="-834">	
	if( player.Fights > 380 ) then
		player.Fights = 0;
		player:rest(1);
		loadPaths("37repair.xml");  
	end
</waypoint>
  • 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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests