Yeah I get what Blumblebee means, what you want is to do something like this:
SCAR Code:
function CutYew: Boolean;
var
x, y: integer;
TPA: TpointArray;
ATPA: T2DPointArray;
i : integer;
Colors: TIntegerArray;
begin
if(InFight) then Exit;
Result := False;
Colors := [2054219, 2582619, 4289678, 1660232, 1188897, 1660233, 2973012, 4621945];
for i := 0 to 8 do
begin
[line35] FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[i], MSX1, MSY1, MSX2, MSY2, 7);
if Length(TPA) = 0 then Continue;
ATPA := SplitTPA(TPA, 44);
for i := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
SWait;
MMouse(x, y, 3, 3);
Result := IsUpText('ew') then //can't use capital letters for IsUpText btw
If Result then
break; //breaks out of the loop here
If Result then
begin
GetMousePos(x,y);
Mouse(x, y, 4, 4, True);
SWait;
WriteLn('Cutting Yew');
end;
If not(Result) then
WriteLN('Couldn'#39#' find the tree');
end;
end;
end;
So that it will break out of the to do loop if the uptext is what you require.