Yesterday, I made some functions and they all ready existed and RM showed me them.
I tested them out and they didnt work =/
I edited them and now they work so here they are.
SCAR Code:
{*******************************************************************************
Function WaitColor(x, y, Color, Tol, MaxTime: integer): Boolean;
By: Rasta Magician fixed by TRiLeZ
Description: Waits for a color at (x, y) with tolerance Tol, returns true if found
*******************************************************************************}
Function WaitColor(x, y, Color, Tol, MaxTime: integer): Boolean;
var
Time: integer;
begin
Result := False;
Time := GetSystemTime + MaxTime;
repeat
if SimilarColors(GetColor(x, y), Color, Tol) then
begin
Result := True;
Exit;
end else
Wait(1);
until (Time < GetSystemTime);
end;
{*******************************************************************************
Function WaitFindColor(var x, y: integer; Color, Tol, x1, y1, x2, y2, MaxTime: integer): Boolean;
By: Rasta Magician fixed by TRiLeZ
Description: Waits for a color at (x1, y1, x2, y2) with tolerance Tol, returns true if found, coords returned to (x, y)
*******************************************************************************}
Function WaitFindColor(var x, y: integer; Color, x1, y1, x2, y2, Tol, MaxTime: integer): Boolean;
var
Time: integer;
begin
Result := False;
Time := GetSystemTime + MaxTime;
repeat
if FindColorTolerance(x, y, Color, x1, y1, x2, y2, Tol) then
begin
Result := true;
exit;
end else
Wait(1);
until (GetSystemTime < Time);
end;