Fixed it up a bit, compare the two scripts now, take a look at what I did.
SCAR Code:
program PowerMiner;
{.include SRL/SRL.scar}
//var x,y : integer; <- Don't use globals for x and y.
Loads : integer;
const
rock1color=2964577;
procedure MineThatOre; //<- Notice the capitals?
var X, Y : Integer;
begin
//if FindObj(x, y, 'ine', Rock1Color, 30) then <- Instead, you can use FindObjCustom, it rocks.
if (FindObjCustom(X, Y, ['ine', 'ock', 'Min', 'Roc'], [Rock1Colors], 3) // <- 3 tolerance should do.
begin
Mouse(x, y, 3, 3, True); //<- Added randomness in, changed to Mouse instead of MMouse.
// if ChooseOption('ine') then <- What are you doing here? You can't chooseoption unless you R-Clicked.
Wait(2000 + Random(2000)); // <- Forgot the semicolon, otherwise good.
end;
end;
procedure AntiRandom; //<- All good, just standardized it a bit.
begin
FindTalk;
FindNormalRandoms;
FindLamp('mining');
if FindFight then
begin
RunAwayDirection('n'); //runs north (s, w, e)
Wait(10000 + Random(2000));
RunBack;
end;
end;
procedure Drop; //<- Standardized it.
begin
if (InvCount=28) then
begin
DropAll;
Loads:=Loads+1;
end;
end;
procedure ProgressReport; //Good work, cleaned it up a little :)
begin
ClearDebug;
Writeln('[]========================================[]');
Writeln('---------------->ProgressReport!?<----------------');
Writeln(' did ' + IntToStr(Loads) + ' Loads' + ' ');
Writeln('---------------------------------------------');
Writeln('[]========================================[]');
end;
begin
SetupSRL;
ActivateClient; //Always remember to do this, otherwise your script wont work.
Wait(1000);
repeat
MineThatOre;
AntiRandom;
Drop;
until(false);
end.