SRL Archive - RS has been updated.

DidRedClick


Justin

2012-02-14 16:21:20

Seems like DidRedClick has been broken, anyone else notice it?

Kyle Undefined

2012-02-14 16:21:57

They shifted the colors for both red click and yellow click.

Justin

2012-02-14 16:26:42

From: Kyle Undefined
They shifted the colors for both red click and yellow click.


Ah ok, thanks!

JN13

2012-02-14 17:16:14

Do u think they are going to do that dynamically now?

Kyle Undefined

2012-02-14 17:26:16

Try this, it's not failing for me, after many client refreshes and browser tests:


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;

Justin

2012-02-14 21:04:18

Currently at work Kyle.
I'll give it a shot (if srl isn't updated) when I get home.