Justin
2012-02-14 16:21:20
Seems like DidRedClick has been broken, anyone else notice it?
2012-02-14 16:21:20
2012-02-14 16:21:57
2012-02-14 16:26:42
From: Kyle Undefined
They shifted the colors for both red click and yellow click.
2012-02-14 17:16:14
2012-02-14 17:26:16
function DidClick(Red: Boolean; Time: integer): boolean;
var
TimeOut, x, y, w, h, R, O: integer;
B: TBox;
begin
GetMousePos(x, y);
GetClientDimensions(w, h);
B := IntToBox(x - 20, y - 20, x + 20, y + 20);
if B.x1 < 0 then B.x1 := 0;
if B.y1 < 0 then B.y1 := 0;
if B.x2 > w then B.x2 := w;
if B.y2 > h then B.y2 := h;
TimeOut := GetSystemTime + Time;
while (GetSystemTime < TimeOut) do
begin
R := CountColorTolerance(10915, B.x1, B.y1, B.x2, B.y2, 2);//Red (Orange = 4 to 8)
O := CountColorTolerance(1623784, B.x1, B.y1, B.x2, B.y2, 2);//Orange/Yellow (max red = 52)
if Red then
begin
Result := (R > 32) and (O < 5);
if (O > 8) then
Exit;
end else
begin
Result := (O > 8);
if (R > 52) then
Exit;
end;
if Result then
Exit;
end;
end;
2012-02-14 21:04:18