SCAR Code:
{*******************************************************************************
function WaitForColor(x, y, Color, TimeOut: Integer): Boolean;
by: TRiLeZ
Description: Waits for a color at a point with a timeout.
*******************************************************************************}
function WaitForColor(x, y, Color, TimeOut: Integer): Boolean;
var
Start: Integer;
begin
MarkTime(Start);
repeat
Wait(1);
if (TimeFromMark(Start) >= TimeOut) then Exit;;
until GetColor(x, y) = Color;
if (TimeFromMark(Start) < Timeout) then Result:= True;
end;
SCAR Code:
{*******************************************************************************
function WaitForColorTol(x, y, Color, TimeOut, Tol: Integer): Boolean;
by: TRiLeZ
Description: Waits for a color at a point with a timeout and tolerance.
*******************************************************************************}
function WaitForColorTol(x, y, Color, TimeOut, Tol: Integer): Boolean;
var
Start, cx, cy: Integer;
begin
MarkTime(Start);
repeat
Wait(1);
if (TimeFromMark(Start) >= TimeOut) then Exit;;
until FindColorTolerance(cx, cy, Color, x, y, x, y, Tol);
if (TimeFromMark(Start) < Timeout) then Result:= True;
end;
SCAR Code:
{*******************************************************************************
function WaitForColorIn(xs, ys, xe, ye, Color, TimeOut: Integer): Boolean;
by: TRiLeZ
Description: Waits for a color in a box with a timeout.
*******************************************************************************}
function WaitForColorIn(xs, ys, xe, ye, Color, TimeOut: Integer): Boolean;
var
Start, cx, cy: Integer;
begin
MarkTime(Start);
repeat
Wait(1);
if (TimeFromMark(Start) >= TimeOut) then Exit;;
until FindColor(cx, cy, Color, xs, ys, xe, ye);
if (TimeFromMark(Start) < Timeout) then Result:= True;
end;
SCAR Code:
{*******************************************************************************
function WaitForColorTolIn(xs, ys, xe, ye, Color, TimeOut, Tol: Integer): Boolean;
by: TRiLeZ
Description: Waits for a color in a box with a timeout and tolerance.
*******************************************************************************}
function WaitForColorTolIn(xs, ys, xe, ye, Color, TimeOut, Tol: Integer): Boolean;
var
Start, cx, cy: Integer;
begin
MarkTime(Start);
repeat
Wait(1);
if (TimeFromMark(Start) >= TimeOut) then Exit;;
until FindColorTolerance(cx, cy, Color, xs, ys, xe, ye, Tol);
if (TimeFromMark(Start) < Timeout) then Result:= True;
end;
Tell me if you like my functions and if they'll be added in SRL.