SCAR Code:
program TempMiner;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}
var
RockColour: Array[0..5] of integer;
RockColour2: Array[0..2] of Integer;
x, y, CF, t, xp, CP, Loads: integer;
const
FireStaff = 1715413;
LoadsToDo = 20;
RestTime = 30;
SwitchPlayers = True;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := CP;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;
procedure SetupColors;
begin
RockColour[0]:=2832734;
RockColour[1]:=2701146;
RockColour[2]:=2239818;
RockColour[3]:=2898785;
RockColour[4]:=2767197;
RockColour[5]:=3096424;
RockColour2[0]:=2174023;
RockColour2[1]:=4744831;
RockColour2[2]:=1712953;
end;
procedure MineThaRocks;
var
i: integer;
begin
if(not(LoggedIn))then
begin
Writeln('not logged in');
TerminateScript;
end;
if(not(FindColorTolerance(x, y, RockColour[i], MSX1, MSY1, MSX2, MSY2, 5)))then
begin
repeat
FindNormalRandoms;
if(not(FindColorTolerance(x, y, RockColour[i], MSX1, MSY1, MSX2, MSY2, 5)))then
begin
Inc(i);
end;
Wait(200+Random(300));
if(i = 6)then
begin
Writeln('could not find rock colour');
TerminateScript;
end;
until(FindColorTolerance(x, y, RockColour[i], MSX1, MSY1, MSX2, MSY2, 5));
Mouse(x, y, 6, 6, True);
end;
if(FindColorTolerance(x, y, RockColour[i], MSX1, MSY1, MSX2, MSY2, 5))then
begin
i := CF;
FindNormalRandoms;
Mouse(x, y, 6, 6, True);
end;
end;
function NotMining: Boolean;
begin
if(FindColorTolerance(x, y, FireStaff, MSX1, MSY1, MSX2, MSY2, 5))then
begin
Result := True;
end;
end;
procedure DropOres;
var
i: integer;
begin
if(ExistsItem(28))then
begin
if(not(FindColorTolerance(x, y, RockColour2[i], MIX1, MIY1, MIX2, MIY2, 5)))then
begin
if(ExistsItem(28))then
begin
Writeln('cannot find ore');
TerminateScript;
end;
end;
if(FindColortolerance(x, y, RockColour2[i], MIX1, MIY1, MIX2, MIY2, 5))then
begin
repeat
FindNormalRandoms;
FindColorTolerance(x, y, RockColour2[i], MIX1, MIY1, MIX2, MIY2, 5);
Mouse(x, y, 4, 4, False);
Wait(50+Random(100));
ChooseOption('rop');
Wait(100+Random(300));
until(not(FindColorTolerance(x, y, RockColour2[i], MIX1, MIY1, MIX2, MIY2, 5)));
IncEx(xp, 945);
Inc(Loads);
end;
end;
end;
procedure Proggy;
begin
ClearDebug;
Writeln('######################################');
Writeln('#SuperBatmans''s Miner Thing');
Writeln('#Xp gained: '+ inttostr(xp));
Writeln('#Time Running: '+TimeRunning);
end;
procedure PDisguise;
var
d: integer;
begin
case 3 of
0: begin
Disguise('SuperBatman''s Miner');
Inc(d);
end;
1: begin
Disguise(IntToStr(xp)+' XP Gained');
Inc(d);
end;
2: begin
Disguise('Running for '+TimeRunning);
d := 0;
end;
end;
end;
begin
SMARTSetUpEX(55, False, True, False);
SetTargetDC(SMARTGetDC);
SetupSRL;
SetupColors;
DeclarePlayers;
Wait(10000+Random(5000));
SetAudioOff;
Wait(200+Random(300))
LoginPlayer;
GameTab(7);
Wait(200+Random(200));
SetAngle(True);
Wait(200+Random(200));
MakeCompass('n');
Wait(300+Random(300));
GameTab(4);
Disguise('SuperBatman''s Miner');
repeat
PDisguise;
FindNormalRandoms;
if(not(FindColorTolerance(x, y, RockColour[CF], MSX1, MSY1, MSX2, MSY2, 5)))then
begin
repeat
Wait(100+Random(200));
Inc(t);
if(t > 300)then
begin
Writeln('Could not find Rock Colour');
TerminateScript;
end;
until(FindColorTolerance(x, y, RockColour[CF], MSX1, MSY1, MSX2, MSY2, 5));
t := 0;
end;
MineThaRocks;
Wait(500+Random(1000));
repeat
Wait(300+Random(200));
Proggy;
until(NotMining);
DropOres;
until(False);
end.