I was wondering how you make a procedure for sleeping, as in my script I have the option of every 50 mins sleep.
Thanks
DR
I was wondering how you make a procedure for sleeping, as in my script I have the option of every 50 mins sleep.
Thanks
DR
Well depends on what do you mean by sleeping?
But if you want to logout and wait and login every 50mins, make a proc like
SCAR Code:Procedure Sleeper;
Begin
Logout;
Wait(1000 + Random(5000));
LoginPlayer;
SetTimeOut(3000, 'Sleeper');
End;
and in the beginning of your script have "SetTimeout(3000, 'Sleeper');"
I know how to do that much, but I want to know how to get to log out after 50 mins of running, then 1hr 40 etc.
The only way I've done it so far is by it does 1 loads of long(u) (its a fletcher) and wait 50 mins it logs out.
You can make a short procedure like this:
Then just decalre runTime as an integer at the beginning and call the procedure somewhere in the mainloop (best if at a good point - like after dropping a load for a powerminer/wc'er or after banking for a wc'er and banker etc.).SCAR Code:Procedure CheckTime;
Begin
If(runTime = 0) Then
MarkTime(runTime)
Else If(TimeFromMark(runTime)>=(3000000)) Then
Begin
Logout;
NextPlayer(True);
MarkTime(runTime);
End;
End;
The procedure just sets runTime as the current system time (using MarkTime) then if the difference between runTime and the current system time is bigger than 3000000 (1000*60*50 = 50 minutes) and if it is, then it logs out the current user then switches to the next user, keeping the previous as true (as nothing stopped it from running - the time limit was just surpassed).
Thanks for this, now my script can have a sleep time![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)