SRL Archive - OSR Help

Can anyone spot what I am doing wrong?


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

Flight

2013-05-29 22:45:23

Well let's see… First off, and this is unrelated to your problem, but why use this?:

BOX := GetATPABounds(Atpa);
I would assume you want to move the mouse to each TPA, not the full ATPA, so would you not do this instead?:

BOX := GetTPABounds(Atpa[i]);

That way you move the mouse to each TPA within the ATPA, rather than just 1-time move to the ATPA.

rj

2013-05-29 22:51:42

If it returns true, it never sets your CTS back to normal
 end else
Result := False;

ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);

Are you using SMART? if not, did you drag green arrow to the client? :)

Also,
HumanMMouse(box.x1+Random(10), box.y1+Random(10), 0, 0);
Result := IsUpText('own Yew');

You never gave it time to return true! I'd advise use waituptext

Sawyer

2013-05-29 22:52:20

From: Flight
Well let's see… First off, and this is unrelated to your problem, but why use this?:

BOX := GetATPABounds(Atpa);
I would assume you want to move the mouse to each TPA, not the full ATPA, so would you not do this instead?:

BOX := GetTPABounds(Atpa[i]);

That way you move the mouse to each TPA within the ATPA, rather than just 1-time move to the ATPA.


Oops…