SCAR Code:
procedure FindMonk;
// Find the damn monk
begin
if (FindObj(x,y,monstername,ZMonkColour1,10))
or (FindObj(x,y,monstername,ZMonkColour2,10))
or (FindObj(x,y,monstername,ZMonkColour3,10)) then
begin
Curse();
Writeln('Found monk');
MMouse( x,y,5,2);
Mouse(x,y,1,1,true);
Casted:= Casted +1;
end else
// If not found
if (Not(FindObj(x,y,monstername,ZMonkColour1,10)))
or (Not(FindObj(x,y,monstername,ZMonkColour2,10)))
or (Not(FindObj(x,y,monstername,ZMonkColour3,10))) then
begin
i:= 0;
repeat
i:= i +1;
Case random (3) Of
0: Makecompass ('s')
1: Makecompass ('n')
2: Makecompass ('w')
3: Makecompass ('e')
end;
// proud of this! :)
until(i = 15)
writeln('Monk was not found.');
Logout;
end;
end;
Whats with all the white space?. You could use a label instead of doing that loop.
SCAR Code:
procedure FindMonk;
// Find the damn monk
begin
if (FindObj(x,y,monstername,ZMonkColour1,10))
or (FindObj(x,y,monstername,ZMonkColour2,10))
or (FindObj(x,y,monstername,ZMonkColour3,10)) then
begin
Curse();
Writeln('Found monk');
MMouse( x,y,5,2);
Mouse(x,y,1,1,true);
Casted:= Casted +1;
end else
if (Not(FindObj(x,y,monstername,ZMonkColour1,10)))
or (Not(FindObj(x,y,monstername,ZMonkColour2,10)))
or (Not(FindObj(x,y,monstername,ZMonkColour3,10))) then
begin
i:= 0;
repeat
i:= i +1;
Case random (4) Of
0: Makecompass ('s')
1: Makecompass ('n')
2: Makecompass ('w')
3: Makecompass ('e')
end;
// proud of this! :)
until(i = 15)
writeln('Monk was not found.');
Logout;
end;
end;
Corrected, also i fixed your random for compass change. you had Case random (3) Of, which means it returns 0,1,2 but you have 3 in your case.. Use Case random (4) Of