Quickmarch
2009-09-30 15:39:28
Much shorter DidClick(…), works exactly the same for me.
Function DidClick(Red: Boolean; Time: integer): boolean;
var
TimeOut, x, y, Trash: integer;
begin
GetMousePos(x, y);
TimeOut := GetSystemTime + Time;
while (GetSystemTime < TimeOut) do
begin
Result := FindColor(Trash, Trash, 255 + (Integer(not(Red))*65280), x - 15, y - 15, x + 15, y + 15);
wait(5);
if (Result) then Break;
end;
end;