Originally Posted by
hectortje3
So if someone could make a code wich does the following: If you have not gained any xp in the last 5 minutes or so, it wil log you out to prevent you from getting banned if you are stuck.
Idk if this is possible but you should be able to add this code to an existent script by yourself.
I really think this is a great idea
Most of the scripts I write have this. It is very simple to do. Basically you declare a timer globally, and each time your script performs an action (in this case mine a rock) you reset the timer back to 0. You check the timer each time it loops:
Simba Code:
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}
var
failTimer: TTimeMarker; // Declare a timer globally
procedure mineRock();
begin
// code to mine a rock ...
if tabBackpack.waitForShift(5000) then
begin // When we mine a rock, start the timer from 0 again
writeLn('We just mined a rock');
failTimer.start();
end;
end;
procedure mainLoop();
begin
// All your mainLoop stuff
if (failTimer.getTime() > 300000) then // Each loop it will check the timer
begin
writeLn('Nothing happened in 5 minutes');
terminateScript();
end;
end;
begin
setupSRL();
failTimer.start(); // Start the timer when the script starts
repeat
mainLoop();
until false;
end.