Does this work?
SCAR Code:
function FindMage: boolean;
begin
ZMageI := Random(3);
if(FindObj3(x, y, 'amora', ZMage[ZMageI], 7)) then
begin
//Exit;
writeln('Found Mage!');
Result := True; //you had a exit before you declared the
end else //result being true.
{begin
Writeln('Finding Mage..');
MakeCompass('E');
Wait(300 + random(300));
HighestAngle; //unblank this whole begin - end if you need this,
end;} //doesnt look like you need this though.
Result := False;
end;
procedure LocateMage;
begin
if (FindMage) then
begin
Writeln('Found Mage!');
Exit;
end else
begin
repeat
Writeln('Trying to Find mage..');
FindMage;
Attemptss := Attemptss + 1;
until(FindMage) or (Attemptss > 10);
if (Attemptss > 10) then
begin
Writeln('Dident find mage!');
NextPlayer(False);
end;
end;
end;