This is another way:
SCAR Code:
program miner;
{.include SRL/SRL.scar}
var II:integer;
//===========================//Colors//===================================//
const
OreColor= 9145494;// Set the color of the Iron
OreTolerance= 10;//Tolerance of the ore.
//===========================//FindOre//===================================//
function FindOre(var OreX,OreY:integer; OreClr,Tol:integer):Boolean;
var XX,YY:integer;
begin
if FindColorSpiralTolerance(XX,YY,OreClr,MSx1,MSy1,MSx2,MSy2,Tol) then
begin
MMouse(XX,YY,0,0);
wait(200+random(50));
if IsUpText('ine') then
begin
Result:=True;
OreX:=XX;
OreY:=YY;
end
else
begin
WriteLn('Could not find ore, found wrong colour');
end;
end
else
begin
WriteLn('Could not find ore, did not even find colour');
end;
end;
procedure Mine;
begin
wait(50);
if FindOre(x,y,OreColor,OreTolerance) then
begin
Mouse(x,y,0,0,True);
end
else
begin
if II>=3 then
begin
WriteLn('CHANGE ORE COLOUR, CAN NOT FIND ROCK');
WriteLn('SCRIPT TERMINATED!');
TerminateScript;
end;
KeyDown(vk_left);
wait(1000+random(400));
KeyUp(vk_left);
II:=II+1;
end;
end;
begin
SetUpSRL;
II:=0;
repeat
Mine;
{obviously you'll need something here so that you
will wait untill you finish mining the rock}
until(InvFull);//repeats until the inventory is full.
end.
You dont need
because thats already there in SRL, it'll log out if it can't find the rock in 3 attempts. remember this is only to start mining the rock you will need some code to check when it finishes mining:
REMEMBER TO SET UP THE SRL
SCAR Code:
begin
SetUpSRL;//This is to include srl in your script.
II:=0;
repeat
Mine;
{obviously you'll need something here so that you
will wait untill you finish mining the rock}
until(InvFull);//repeats until the inventory is full.
end.
This is a simple mining meathod.