Sawyer
2013-05-29 22:33:02
All this does is move the mouse at the very top left corner of the screen, so I think my mouse move is moving wrong… I must have it moving to some unassigned variable. Can anyone spot my mistake?
Function FindTree:Boolean;
var
x, y, cts, i:Integer;
TPA, TPA2:Tpointarray;
ATPA:Array of tpointarray;
BOX:Tbox;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.25, 0.66);
If FindColorsSpiralTolerance(x, y, TPA, 4148823, msx1, msy1, msx2, msy2, 7) then
begin
ATPA := SPlitTPAEx(TPA, 5, 5);
SortATPAFrom(ATPA, Point(257, 220));
for i:= 0 to high(ATPA) do
begin
BOX := GetATPABounds(Atpa);
SetColorSpeed2Modifiers(0.29, 00.78);
if FindColorsSpiralTolerance(x, y, TPA2, 2047535, box.x1, box.y1, box.x2, box.y2, 8) then
begin
writeln('Found tree leaves colors.');
HumanMMouse(box.x1+Random(10), box.y1+Random(10), 0, 0);
Result := IsUpText('own Yew');
end;
end;
end else
Result := False;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end; //ENDING