SRL Archive - SRL Archives

procedure HoldTimer(H, M, S: Integer; OnTimer: procedure);


Daniel

2009-07-19 05:06:16

Place in SRL\SRL\Core\Timing.scar:

procedure HoldTimer(H, M, S: Integer; OnTimer: procedure);
var
MS: Integer;
begin
MS := GetTimeRunning + (H * 60 * 60 * 1000) + (M * 60 * 1000) + (S * 1000);
while (MS > GetTimeRunning) do
OnTimer();
end;

What does this do? Instead of waiting every X milliseconds it can wait hours, minutes and seconds.. Also, while it is stopping the time, you can let it call the procedure OnTimer.

This may or may not be useful, but i made this a while back and found it sitting in my scripts directory :D

Have fun :p

Awkwardsaw

2009-07-19 05:11:28

=p it looks neat.

i smell a farming script?

Daniel

2009-07-19 05:28:54

From: Awkwardsaw
=p it looks neat.

i smell a farming script?


Sorry, not P2P :(

BTW, could this be used in Farming?

Cazax

2009-07-19 05:30:51

You should add a wait in the loop to avoid lagging. At least a Wait(15).

Awkwardsaw

2009-07-19 05:31:44

yes, like after you go through your runs, set the amount of time to wait, and log back in to do it over. :p

Quickmarch

2009-07-19 11:38:30

I would get rid if OnTimer() and put SRL_Procs[srl_AntiBan]()


procedure HoldTimer(H, M, S: Integer);
var
MS: Integer;
begin
MS := GetTimeRunning + (H * 60 * 60 * 1000) + (M * 60 * 1000) + (S * 1000);
while (MS > GetTimeRunning) do
if SRL_Procs[srl_AntiBan] <> nil then
SRL_Procs[srl_AntiBan]();
end;

Daniel

2009-07-19 15:12:25

From: Cazax
You should add a wait in the loop to avoid lagging. At least a Wait(15).

Hasn't lagged for me at all during my testing ;)

From: Awkwardsaw
yes, like after you go through your runs, set the amount of time to wait, and log back in to do it over. :p

Oh kewl.

From: Quickmarch
I would get rid if OnTimer() and put SRL_Procs[srl_AntiBan]()


procedure HoldTimer(H, M, S: Integer);
var
MS: Integer;
begin
MS := GetTimeRunning + (H * 60 * 60 * 1000) + (M * 60 * 1000) + (S * 1000);
while (MS > GetTimeRunning) do
if SRL_Procs[srl_AntiBan] <> nil then
SRL_Procs[srl_AntiBan]();
end;

So you would want it to do AntiBan every single millisecond? For one, i wouldn't like that :(

marpis

2009-07-19 16:35:20

From: Quickmarch
I would get rid if OnTimer() and put SRL_Procs[srl_AntiBan]()


That kinda kills the idea of the procedure. The idea is that the user can choose the procedure, it doesn't always have to be antiban. Besides, everyone makes their own antiban procedures.

Quickmarch

2009-07-19 16:55:52

[QUOTE=Dan's The Man;603784]Hasn't lagged for me at all during my testing ;)


Oh kewl.


So you would want it to do AntiBan every single millisecond? For one, i wouldn't like that :(

You could put a WaitTime parameter and in the loop put Wait(WaitTime); - Just a suggestion. :)

Daniel

2009-07-19 17:06:56

From: Quickmarch
You could put a WaitTime parameter and in the loop put Wait(WaitTime); - Just a suggestion. :)

Meh, the users can do what they want with it if they implement it into their scripts. Or, if the devs can modify it to their hearts content if they do add it to SRL ;)

Awkwardsaw

2009-07-19 18:15:22

i like the wait thing :p

how about a different version of this, but instead of doing a procedure for a set amount of time, make it wait a set amount of time and then do the said procedure