ok i need help with this procedure , i want it to look for nettles 9 times and if it doesn't find them i want it to say 'Tree one' and the result to be 1, if it does i want it to say 'tree two' and result := 2.(dnt worry about the colorsz i have an array at the top etc.) But the problem is that no matter what i do (if(Findobj3(etc)),FindObj3,(If(FindColorTolerance )),Findcolortolerance, it always looks for the nettles more than once for each line.
for example if i put
SCAR Code:
If(FindObj3(etc...blah,blah,blah))then
then it will looks for the nettles continually for that line not just once.
anyways this is the procedure that i came put with 
SCAR Code:
function FTC : integer;
var H : integer;
begin
begin
repeat
for i := 1 to 5 do
If(FindColorTolerance(NettlesCoordx,NettlesCoordy,NettlesColor[I],46,117,394,245,10)then
begin
wait(100);
MMouse(Nettlescoordx,Nettlescoordy,0,0);
If(IsUpText('ick'))then
begin
result := 2;
Writeln (' Tree Number 2 ');
exit;
end;
end;
for i := 1 to 5 do
If(not(FindColorTolerance(NettlesCoordx,NettlesCoordy,NettlesColor[I],46,117,394,245,10)))then
begin
H := H + 1;
end;
until(H = 9);
end;
begin
If (H < 2) then
begin
result := 1;
writeln('Tree number 1 ');
end;
end;
end;
procedure GetTreeNumber;
begin
TreeNumber := FTC;
end;