SRL Archive - General Botting Help

Need help using a timer


cynicz

2013-08-19 11:44:43

Ok So basically I have for example 5 procedures and my script looks like

Procedure MainLoop;
Begin
procedure1;
proecedure2;
procedure3;
end;

Begin
Repeat
MainLoop;
until (IsKeyDown(114));
End.

in the last area where it has begin mainloop, I need a timer so every 2 minutes itll call another procedure, then once completed it continues back to the repeat of mainloop, then in another 2minutes it repeats.

I also want to change the until iskeydown 114 (F3) so whenever f3 is pressed it stops the script immidiately where its at.

tealc

2013-08-19 12:09:35

unless you want to use a ttimer try something like below
it won't be exactly two minutes but as long as you don't get stuck in your mainloop it should be close enough


var
time:longint; //global variable

procedure twominproc;
begin
//code
time:=GetSystemTime;//resets your timer
end;

Procedure MainLoop;
Begin
procedure1;
proecedure2;
procedure3;
end;

Begin
time:=GetSystemTime;
Repeat
MainLoop;
if(GetSystemTime-time>120000) then //120000ms=120 seconds=2 minutes
twominproc;
until (IsKeyDown(114));
End.


cynicz

2013-08-19 12:43:21

so I want to honestly make it a 6hour refresh changing the MS to = 6hour wont change anything will it? just change it accordingly. I want 2 mins to test how it refreshes (browser game with 6 hour close) so itll just refresh browser and reclick my world.

Sin

2013-08-19 14:08:50

You could use MarkTime(t:Integer). It basically sets a checkpoint, and you can call TimeFromMark(t:Integer):Boolean, to see when it passes 6 hours.