SRL Archive - Test corner

Timers. The Way To Faster And Better Scripts :D


shaunthasheep

2006-05-24 20:06:34

Take A Look, Shows A Good And Useful way To Use Timers In Ur Scripts and make them faster, because u can have like 10 procedure run at once :D its sweet.

there was one of these originally in the test folder, i took a look at it, at saw how this could be used.

this is my example:

shaunthasheep

2006-05-24 20:18:13

srry for double post :S
i though of some more uses
it can also be used too check gas. even tho this kinda falls under the anti-randoms :o

The Un-Named

2006-05-24 20:19:11

Very useful. I'll be sure to use this in the future!

shaunthasheep

2006-05-24 20:25:13

woot. 1 positive feedback. i think this is very seksy. u guys should look in the test folder more often. :D

And if there is a thread about this, im saying i didnt no in advanced :p which i dont think there is.

driger1592

2006-05-24 20:29:26

Thanks dude :p I could never think of a way to loop it! This is very useful :D

shaunthasheep

2006-05-24 20:30:47

well i never though of it, give 50% to kaitnieks for riting it(if u can :P, u have to find here first) and 50% to making it on its way to fame and glory :)

XxKanexX

2006-05-24 20:31:05

We have this in SRL for things that are called every so minutes, Like HoveryEver. I used it in my SendMessageEvery, too. Useful.

Janilabo

2006-05-25 20:48:07

Good job TRsM!

Nice piece of code. :p

Iamadam

2006-05-26 02:50:59

Ohh so we can have Threads in SCAR….yay!

c0de

2006-05-26 13:22:32

Setting timer:

procedure SetTimeout(secs: Cardinal; procname:string): Integer;

Stopping specified timer:

procedure ClearTimeout(s:string);

Stopping all timers:

procedure ClearTimeouts;

devils elbow

2006-05-26 18:04:08

Sweet! Threading!

XxKanexX

2006-05-26 21:16:30


procedure Say1;
begin
Writeln('1');
SetTimeout(1, 'Say1');
end;

procedure Say2;
begin
Writeln('2');
SetTimeout(1, 'Say2');
end;

procedure Say3;
begin
Writeln('3');
SetTimeout(1, 'Say3');
end;

begin
SetTimeout(1, 'Say1');
SetTimeout(1, 'Say2');
SetTimeout(1, 'Say3');
repeat
ClearDebug;
Wait(2000);
until(false);
end.
Example of calling everything at the same time.

shaunthasheep

2006-05-26 21:21:23

rofl thats uber :D

XxKanexX

2006-05-26 21:28:58

The only con is it can't be set in milliseconds.. It has to be in seconds. :(