If you change
RColour : array[1..5] of Integer;
GColour : array[1..6] of Integer;
MSymbol : array[0..4] of Integer;
//TO
RColour, GColour, MSymbol: TIntegerArray;
//And load them like this:
RColour := [5279663, 3695995, 5939396, 5147562, 5015461];
Also it's better to use a case in LoadColours. And what if the user enters for example 'iron' or 'RUNITE'? Then it wont load the colors, so use LowerCase(Players[CurrentPlayer].Strings[0]) to make sure you know what the user means.
1: FindNormalRandoms;
2: FindLamp(Players[CurrentPlayer].Strings[1]); //Middle of the script!
If there's a lamp, FindNormalRandoms will solve it first. So the FindLamp is a bit useless like this, either do FindLamp before FNR or just dump it.
If you make the dtms of your axes an array, you can optimize IP_DetectAxe by using a for-to-do loop.
if(IP_DetectAxe='UW') then
begin
DropToPosition(2,28);
LoadsDone:=LoadsDone+1;
OresMined:=OresMined+27;
ReportVars[0]:=ReportVars[0]+1;
ReportVars[1]:=ReportVars[1]+27;
end;
if(not(IP_DetectAxe='UW')) then
begin
DropAll;
LoadsDone:=LoadsDone+1;
OresMined:=OresMined+28;
ReportVars[0]:=ReportVars[0]+1;
ReportVars[1]:=ReportVars[1]+28;
end;
This will call IP_DetectAxe twice, it's better to use
end else here.
{Unsure how to update to SRL[4] Revision #10
procedure GetCompassChange(Angle: String);
begin
case LowerCase(Angle) of
'n' : if(FindCompassAngle=0) then Writeln('Compass Angle is already at specified point.') else MakeCompass('n');
's' : if(FindCompassAngle=180) then Writeln('Compass Angle is already at specified point.') else MakeCompass('s');
'w' : if(FindCompassAngle=90) then Writeln('Compass Angle is already at specified point.') else MakeCompass('w');
'e' : if(FindCompassAngle=270) then Writeln('Compass Angle is already at specified point.') else MakeCompass('e');
end;
end;}
MakeCompass checks if it isn't already on the correct point ;)
function GetActivePlayers: Boolean;
var p: integer;
begin
for p:=0 to HowManyPlayers-1 do
if (Players[p].Active=True) then Exit;
Result := True;
Lil' bit shorter :p
NickNameBMP := CreateBitmapMaskFromText(Players CurrentPlayer].Nick, UpChars)
LoginPlayer (so also NextPlayer) does this for you.
Something about standards:
procedure show;
var //notice the enter after this?
x, y: Integer;
begin
if True then
begin //same startpoint as line above
x := 0;
repeat //same startpoint as line above
y := 0;
until True;
end;
end;