d003232 wrote:Try:
Code: Select all
<!-- #16 --><waypoint x="-12364" z="10939">
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();
load_paths("5-7_bugs_repair.xml");
end
</waypoint>
If it's not working, just add your own 'printf' commands to set the content of your fields:
Code: Select all
<!-- #16 --><waypoint x="-12364" z="10939">
if(player.free_counter1 == 0) then player.free_counter1 = os.time(); end;
printf("counter: %s\n", player.free_counter1);
printf("diff: %s\n", os.difftime(os.time(), player.free_counter1));
if( os.difftime(os.time(), player.free_counter1) > 3600 )
player.free_counter1 = os.time();
load_paths("5-7_bugs_repair.xml");
end
</waypoint>
And you need to come 2x to that waypoint to have loaded the new path. Because at the first time you reach that wp the difference would be 0.
need some guidance on repair with time, i tried to use this code :
Code: Select all
<waypoints>
<!-- # 1 --><waypoint x="360" z="8870">
if( os.difftime(os.time(), player.BotStartTime) > 3660 ) then
yrest(5000);
keyboardPress(key.VK_9);
player.BotStartTime = 0;
yrest(20000);
loadPaths("Repair 17-18 Silverspring 38,23.xml");
</waypoint>
problem while using the code above : the timer wont reset, so after the bot press key 9 (recall button) and load the repair path, and back to grinding path, after the bot arrive on waypoint 1 (inside grinding path) , the timer is more than 3660 (1 hour and 1 minute) so the bot tried to use the recall button, which is on cooldown, so it run straight line to waypoint 2 to on my repair path which is quite far away from the original grinding spot
question : is there any other way/code to reset the timer ?
tried to use another code like the sample above, and inserting the recall code
Code: Select all
<waypoints>
<!-- # 1 --><waypoint x="360" z="8870">
if(player.free_counter1 == 0) then player.free_counter1 = os.time(); end;
if( os.difftime(os.time(), player.free_counter1) > 10 )
player.free_counter1 = os.time();
yrest(5000);
keyboardPress(key.VK_9);
player.BotStartTime = 0;
yrest(20000);
load_paths("Repair 17-18 Silverspring 38,23.xml");
end
</waypoint>
problem while using the code above :