Psychor is correct.
In your loop, it says:
SCAR Code:
Procedure toWillows;
var
Rx, Ry : Integer;
FoundItGain : Boolean;
begin
FindTree; //loads ddtm to memory
for I := 1 to 10 do
begin
TreeTol := TreeTol+5; //changes tol
TreeArea:= TreeArea+10; //changes area
If FindDTM(TreeDDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
getmousepos(rx, ry);
Writeln('yay found the DDTM lets go');
Mouse(rx, ry, 0, 0, True);
FoundItGain := True;
You never reload the DDTM so it just adds to the tolerance and areasize and does nothing.
Also what you do if you found the DDTM doesn't make sense. If you find it, get where the mouse is now and click there? You'd just click wherever your mouse was when you found the DDTM.
I would write it like this:
SCAR Code:
procedure DDTM;
var
x, y, i, DDTM : Integer;
begin
FindTree;
if not DTMRotated(TreeDDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
for i := 1 to 10 do
begin
FreeDTM(TreeDDTM);
TreeTol := TreeTol + 5;
TreeArea := TreeArea + 5;
FindTree;
if DTMRotated(TreeDDTM, x, y, mmx1, mmy1, mmx2, mmy2) then Break;
end;
end;
Writeln('Found TreeDDTM with a tolerance of ' + IntToStr(TreeTol) + ' and an area of ' + IntToStr(TreeArea) + '.');
Mouse(x, y, 2, 2, true);
end;
I think that'll work. I've never used a DDTM like that since mine have always used colors that are autocolorable.