Antibran:
anti:= Random(5); will return a number from 0-4, so you either have to adjust your case or do anti:= Random(5)+1;
WhatOre:
i'd start the if on coal and then work the way down, otherwise you'll be setting string[0] various times and you'll have to read through many if's if the user was lvl 38+
so i'd do it in this order:
coal
iron
tin
copper
oh n btw
If(level >= 38) Then
Begin
Players[CurrentPlayer].Strings[0] := 'Coal';
end;
//this will work the same way:
If(level >= 38) Then
Players[CurrentPlayer].Strings[0] := 'Coal';
when it's only one statement you don't need begin and end.
like in if not loggedin then exit;
checkinv:
If Not(LoggedIn) Then
begin
LoginPlayer;
Exit;
end;
You should never login a player inside a procedure, you should always do it on the mainloop, because otherwise the player will be stuck in a loop where it shouldn't be. for example your in a loop looking for the rocks. you log out and you login the next player. the next player is in the bank, but it's in the looking for rocks loop, which means it won't find any and therefore be put to false. and all the next players will be false too.
Case LowerCase(Players[CurrentPlayer].Strings[0]) Of
'copper': Dropall;
'tin': Dropall;
'iron': Dropall;
'coal': Dropall;
why case it if you're gonna drop all anyway?
FindGass:
if FindGas(x,y)then
begin
RunAwayDirection('N');
Wait(10000 + random(2000));
RunBack;
result:= true;
end;
you shouldn't run away from gas, you should just mine another rock:P
for your mining procedures i'd rather have only one procedure that checked which ore you're supposed to mine and then do it. instead of having four procedures that do the exact same thing, only difference is the color in findcolortolerance.
procedure Drop;
begin
dropall;
end;
you don't need this procedure, you can just use dropall; on it's own.
mainloop:
SetupSRL already gives u a mouse speed.
and again in the mainloop your repeat yourself.
here's what i'd do:
var
SearchColor: integer;
case Players[CurrentPlayer].Strings[0] of
'Copper': SearchColor := CopperRockColor;
'Tin': SearchColor := TinRockColor;
'Iron':SearchColor := IronRockcolor;
'Coal':SearchColor := CoalRockColor;
and then isntead of having 4 mining procedures you could just use
if(FindColorTolerance(x, y, SearchColor, 0, 0, 700, 500, 4))then
also your standards are a little off, and you should have a repeat in your mainloop outside of the if statments.
hope this helps you.
but it is a very good first script :)
~RMagician