SCAR Code:
program AlKharidPowerMiner;
{.include SRL/SRL.scar}
var
Loads, IronOres, a, b, x, y: Integer;
const
NumLoads = 5; //How many loads to do before switching players.
Ore1 = 2832988; //Set these colors
Ore2 = 1778490; //Set these colors
Ore3 = 2569557; //Set these colors
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //How many players are mining.
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //Which player you are starting with.
Players[0].Name := 'Username'
Players[0].Pass := 'Password';
Players[0].Nick := 'erna'; //3-4 letters of name (not CAPS)
Players[0].Active := True; //Player is going to be mining.
Writeln('There are ' + IntToStr(HowManyPlayers) + 'character(s) mining.');
end;
function FindFastRandoms: Boolean; //by WT-Fawaki
var
i: Integer;
begin
for i := 1 to 9 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
8: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
9: RC;
end;
Wait(1);
end;
end;
procedure Randoms;
begin
FindTalk;
FindNormalRandoms;
FindFastRandoms;
if (FindFight = True) then
begin
RunAwayDirection('S');
wait(1000 + random(5000));
RunBack;
end;
end;
procedure MineThoseOres;
begin
if(not(LoggedIn)) then
Exit;
else if(FindColorTolerance(a, b, Ore1, MSX1, MSY1, MSX2, MSY2, 6) and
FindColorTolerance(a, b, Ore2, MSX1, MSY1, MSX2, MSY2, 6) or
FindColorTolerance(a, b, Ore3, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Status('We''re Mining!');
Mouse(a, b, 2, 2, true)
wait(3000 + random(2000))
Randoms;
end;
end;
procedure Drop;
begin
status('Dropping the ores');
IronOres := DTMFromString('78DA63CC636260E0646440065E3A0A601A26C' +
'A580854F387010D30A2AAC920424D02500D33237E35B140350204' +
'D46401D5881150534E8439554C483CEC6A00B2BD065D');
repeat
if(FindDTM(IronOres, x, y, MIX1, MIY1, MIX2, MIY2)) then
wait(2000 + random(1000));
Mouse(x, y, 3, 3, false);
ChooseOption('rop');
Randoms;
until(not(FindDTM(IronOres, x, y, MIX1, MIY1, MIX2, MIY2)));
Loads := Loads + 1;
end;
procedure IsInvFull;
begin
status('Checking Inventory');
if(InvFull) then
begin
Writeln('Inventory is full, dropping ores.');
Drop;
end;
end;
procedure ProgReport;
begin
ClearDebug;
Writeln('---------- Powerminer by Method ----------');
Writeln('We have mined ' + IntToStr(Loads) + ' loads of iron so far');
Writeln('Thanks for running this, and please post progress reports!');
Writeln('---------- Powerminer by Method ----------');
end;
procedure SetUp;
begin
SetupSRL;
DeclarePlayers;
Loads := 0;
ActivateClient;
end;
begin
SetUp;
repeat
if(not(LoggedIn)) then
LoginPlayer;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, upchars);
if(Players[CurrentPlayer].Active) then
begin
repeat
IsInvFull;
MineThoseOres;
IsInvFull;
ProgReport;
until(Loads = NumLoads);
Logout;
end;
CurrentPlayer := CurrentPlayer + 1;
until(CurrentPlayer = Length(Players));
end.