perhaps use findobj instead of findcolor
you need to add some failsafes into your procedure so if there are no rocks it doesn't just keep looping
here's my mining procedure if you want to take a look at it
it won't compile on your computer as it has lots of custom functions but is a good script example
SCAR Code:
procedure Mine;
begin
repeat
AntiRandoms;
if(Players[CurrentPlayer].Active = False)then
Exit;
P:=0
repeat
P:=P+1
wait(250+random(100));
until(FindObj(x,y,'ine',rockcolour,9))or(FindObj(x,y,'ine',rockcolour1,9))or(FindObj(x,y,'ine',rockcolour2,9))or(P=50)
if(P=50)then
begin
writeln('No Rocks');
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'No Rocks';
Exit;
end;
if(not(P=50))then
begin
MMouse(x,y,2,2);
wait(100+random(50));
if(random(7)=0)then
begin
Mouse(x,y,5,5,False);
wait(25);
ClickOption('ine',1);
end
else
Mouse(x,y,5,5,True)
wait(1150+random(450));
Q:=0
repeat
Q:=Q+1
wait(100+random(100));
until(InChat('cur'))or(InChat('man'))or(Q=20)
wait(500+random(500));
end;
Q:=0
if(random(8)=0)then
begin
antirandoms;
nobans;
end;
antirandoms;
until(InvFull)
i:= i + 1;
l:= l + 1;
DropOres;
end;