Thanks, I currently have this code:
SmartDebugImage:
http://puu.sh/1I3nI
procedure WalkToLogs;
var
WillowMMTPA: TPointArray; //TPA var
WillowMMATPA: T2DPointArray; //ATPA var
AllTreesTBox, WillowMMTBox: Tbox; //Tbox's of trees
tmpCTS2: integer; //CTS2 storage var
begin
tmpCTS2 := GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(WillowMMHue, WillowMMSat);
if (FindColorsTolerance(WillowMMTPA,WillowMMCol, MMX1, MMY1, MMX2, MMY2, WillowMMTol)) then
begin
//Smart_DrawDots(WillowMMTPA);
//SMART_DebugTPA(false, WILLOWMMTPA);
SplitTpaExWrap(WillowMMTPA, 20, 20, WillowMMATPA);
SortATPAFromMidPoint(WillowMMATPA, (MiddleTPA(WillowMMTPA)));
WillowMMTBox := GetTPABounds(WillowMMATPA[0]);
AllTreesTBox := GetATPABounds(WillowMMATPA);
{SMART_DRAWBOXex(false, false, WIllowMMTBOX, clgreen);
//SMART_DRAWBOXex(false, false, AllTreesTBox, clpurple);
//MouseTBox(WillowMMTBox, 1);
//Smart_StatusDebug('walking to willow trees', clYellow);
while (FlagPresent) do
begin
Smart_StatusDebug('walking to willow trees', clyellow);
wait(100);
end;
Smart_StatusDebug('Arrived at willow trees', clgreen);
}
end;
SetColorToleranceSpeed(tmpCTS2);
SetToleranceSpeed2Modifiers(0.2, 0.2);
end;
as you can see it does it job fairly well! Altough it encounters a problem when the colors change.
So, I actually understand that SPS maybe simplier. But I want to be able to code a walking method based on TPA's.