Need help with autoRepair
Need help with autoRepair
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.
<!-- # 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.
But currently im having a problem, when it reaches waypoint 13 the bot stop and receives this problem.
<!-- # 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.
Re: Need help with autoRepair
Code: Select all
if( os.difftime(os.time(), player.free_counter1) > 3600 )
- 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: Need help with autoRepair
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.
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.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Need help with autoRepair
If you reset the counter back to zero when you return, it will go kill another 300 and then go repair again.
Re: Need help with autoRepair
Sorry if its a dumb question but how would I go on about to reset the counter? What command would i have to put?
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Need help with autoRepair
You tell me. I have no idea what you've done so far.
Re: Need help with autoRepair
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>
<!-- # 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>
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Need help with autoRepair
Those are the two variables you're using, so:player.Fights-player.free_counter1
Code: Select all
player.Fights = 0;
player.free_counter1 = 0;
Re: Need help with autoRepair
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>
<!-- # 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>
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Need help with autoRepair
Thanks lets hope it works fine.
Re: Need help with autoRepair
Um... I think this change wasn't necessary. It would have worked the way it was.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>
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
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests