SRL Archive - Outdated Tutorials

[#36] Timing.scar


Sir R. M8gic1an

2009-06-22 18:56:55

A lot of new functions have been added to Timing.scar


// * Function WaitOptionMulti(S: TStringArray; Time: Integer): Boolean; // By Marpis & N1ke! & Rasta Magician
// * Function WaitOption(S: String; Time: Integer): Boolean; // By Marpis edited by N1ke!
// * Function WaitUptextMulti(S: TStringArray; Time: integer): Boolean; // By Marpis & N1ke!
// * Function WaitUptext(S: String; Time: Integer): Boolean; // By Marpis edited by N1ke!
// * Function WaitColor(x, y, Color, Tol, MaxTime: integer): Boolean; // By Rasta Magician
// * Function WaitFindColor(var x, y: integer; x1, y1, x2, y2, Color, Tol, MaxTime: integer): boolean; // By Rasta Magician
// * Function WaitColorCount(x1, y1, x2, y2, Color, Tol, MinCount, MaxCount, MaxTime: integer):boolean; // By Rasta Magician

All of these are designed to make your scripts more efficient and here is how they would be used:


{this is how it is done at the present time}
MMouse(x, y, 3, 3);
wait(300);
if IsUpText('ank') then
begin
//...
end;

{here is how you would do it now}
MMouse(x, y, 3, 3);
if WaitUpText('ank', 300) then
begin
//...
end;

What it does is wait in cycles until the Uptext is found rather than waiting a set amount of time. It exits after MaxTime.

So usually, you would wait 300 ms for the uptext.
By using this new function, it will wait in cycles, and you would end up perhaps only waiting 180 or 120 ms, making it less detectable as a player wouldn't really wait for the uptext and making your script faster because it waits around less.

Lots o' Love
SRL Development Team

ShowerThoughts

2009-06-22 22:16:29

We actually fail hard, those are so regular functions which everyone uses; a lot.

Thank you!

Infantry001

2009-07-01 19:37:57

Sorry to ask, but when is Rev. 36 coming out?

Rich

2009-07-01 20:37:00

From: Infintry001
Sorry to ask, but when is Rev. 36 coming out?


Not sure, but if you're after it for these functions, then get the Dev Rev, which has them in it.

Infantry001

2009-07-01 20:48:01

From: R1ch
Not sure, but if you're after it for these functions, then get the Dev Rev, which has them in it.


Do I have to sign up or something?

Sorry, I haven't been around in a while XD All these new things happened while I was gone haha

Rich

2009-07-01 22:21:01

Do you have Tortoise SvN?

Naike

2009-07-01 23:16:41

From: Infintry001
Do I have to sign up or something?

Sorry, I haven't been around in a while XD All these new things happened while I was gone haha


http://www.villavu.com/repositories/srl-opendev/

have fun.