SRL Archive - SRL Archives

Procedure Run(min:integer);


Sir R. M8gic1an

2009-04-21 09:08:48


{*******************************************************************************
Procedure Run(min: integer);
By: Rasta Magician
Description: Sets run to true if Run energy is greater or equal to min
*******************************************************************************}
Procedure Run(min: integer);
var color: string;
begin
if GetMMLevels('run', color) >= min then
SetRun(true);
end;

please. Most people end up doing this very same thing in their scripts, would be nice not to have to repeat it every time :p

~RM

Floor66

2009-04-21 09:14:34

I do this every time lol!
THANKS!

Home

2009-04-21 13:30:14

I know that many people do this.. but i still think that this should be left out of srl :/ I doon't know why.. i just feel so (:

~Home

P.S Thanks for posting anyways (:

marpis

2009-04-21 16:01:30

I use this to check if i am currently already running

procedure Run(min: integer);
var
x, y: integer;
s: string;
begin
if (GetMMLevels('run', s) >= min) then
if not FindColorTolerance(x, y, 6871530, 715, 100, 730, 110, 10) then
SetRun(true);
end;

Sir R. M8gic1an

2009-04-21 16:08:35

SetRun already checks if it is running, no need for a second check ;)

~RM

Nava2

2009-04-21 16:10:26

Added.

I agree.

EvilChicken!

2009-04-21 16:25:57

Was just about to commit. =__=

Slight changes;
{*******************************************************************************
function RunEnergy(Min: Integer): Boolean;
By: Rasta Magician
Description: Toggles run if energy is greater or equal to MinEnergy.
*******************************************************************************}

function RunEnergy(Min: Integer): Boolean;
var
Color: string;
begin
Result := (GetMMLevels('run', Color) >= MinEnergy);
if Result then SetRun(True);
end;

lordsaturn

2009-04-22 06:54:03

This is a bit faster
{*******************************************************************************
function RunEnergy(Min: Integer): Boolean;
By: lordsaturn
Description: Toggles run if energy is greater or equal to MinEnergy. Results
true if run was off and toggled.
*******************************************************************************}
function RunEnergy(Min: Integer): Boolean;
var
TPA: TPointArray;
tmp: string;
begin
FindColorsTolerance(TPA, 5753055, 715, 105, 731, 110, 30);
if Length(TPA) < 11 then
if GetMMLevels('run', tmp) >= Min then
begin
Mouse(715, 95, 10, 10, True);
Result := True;
end;
end;