rj
2013-08-31 20:04:12
So my code is finding the object, hovering the mouse over it but not clicking it for some reason..
It's finding the stall:

It's moving the mouse to the stall:
Here is my code:
I know the length of the green is > 10 because the debug box prints
the function is returning true:
It's finding the stall:

It's moving the mouse to the stall:
MiddleTPAEx(ATPA[i], x, y);
Mouse(x, y, 0, 0, Mouse_left);Here is my code:
function g_find_stall:Boolean;
var
TPA, green_TPA:TPointArray;
ATPA:T2DPointArray;
i, x, y:Integer;
Bounds:TBox;
begin
// if (not g_loggedin) then
//exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.22, 4.57);
FindColorsTolerance(TPA, 2050398, 0, 0, 514, 338, 3);
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
if (Length(TPA) > 0) then
begin
ATPA := TPAToATPAEx(TPA, 22, 22);
FilterTPAsBetween(ATPA, 0, 10);
SortATPAFromFirstpoint(ATPA, Point(259, 172));
if (debug = true) then
DebugATPABounds(ATPA);
for i := 0 to high(ATPA) do
begin
Bounds := GetTPABounds(ATPA[i]);
FindColorsTolerance(Green_TPA, 1747732, Bounds.x1, Bounds.y1, Bounds.x2, Bounds.y2, 21);
if (length(green_TPA) > 10) then
begin
Writeln('Green length: ' + ToStr(length(green_TPA)));
result := true;
MiddleTPAEx(ATPA[i], x, y);
Mouse(x, y, 0, 0, Mouse_left);
exit;
end;
end;
end;
end; I know the length of the green is > 10 because the debug box prints
Green length: 66the function is returning true:
Writeln(g_find_stall);True