SCAR Code:
//<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>\\
// Varrock East Powerminer & Banker. \\
// \\
// NAME : Varrock East Powerminer & Banker. \\
// WRITER : NinjaTerrorist. \\
// CATEGORY : Powerminer. \\
// DESCRIPTION : Mines and banks ore. \\
// USAGE : 31 - 96 setup. \\
// AUTOCOLOR : Yes \\
// NOTES : Initial release. \\
// CONTACT : [email]NinjaTerrorist@gmail.com[/email] \\
// \\
//<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>\\
program VarrockEastPowerminer;
{.include SRL\SRL.scar}
{.include SRL\SRL\SkILL\Mining.scar}
var
DTMPick, i, sx, sy, Trips, Gases: Integer;
gx, gy, ax, ay, ox, oy, StartTime: Integer;
GC: array [0..3] of Integer;
RespondTxt: array [0..20] of string;
OC: array [0..2] of Integer;
Active: string;
Responded: Integer;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< Setup >}
{< Setup for your needs. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
const
MinAccuracy = 0.4; { Used in FindDeformedSymbol. }
Tol = 10; { Tolerance used for rock finding. }
WaitT = 5; { Waiting time in seconds. }
FailSafe = 10; { Number of times the script can fail finding a rock. }
MaxTime = 15; { Max time in minutes you can take in one load. }
PanicKey = 12; { F panic key, eg 12 = F12, 8 = F8.. }
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< DeclarePlayers; >}
{< Setup your players here.. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure DeclarePlayers;
begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Loc := '';
Players[0].Active := True;
Players[0].Boolean1 := False; { Axe Equiped? }
Players[0].String1 := 'copper'; { Ore? }
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Loc := '';
Players[1].Active := True;
Players[1].Boolean1 := False;
Players[1].String1 := 'copper';
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Loc := '';
Players[2].Active := True;
Players[2].Boolean1 := False;
Players[2].String1 := 'copper';
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Loc := '';
Players[3].Active := True;
Players[3].Boolean1 := False;
Players[3].String1 := 'copper';
WriteLn('We are using: ' + IntToStr(HowManyPlayers) + ' players.');
WriteLn('Current players is: ' + Players[CurrentPlayer].Name);
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< End Setup >}
{< Dont want to be touching anything past here. :P >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< CheckSetup; >}
{< Makes sure setup is correct. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
function CheckSetup: Boolean;
begin
for i := 0 to HowManyPlayers -1 do
if(Players[i].Name = '')or(Players[i].Pass = '')or(Players[i].Nick = '')or(Players[i].String1 = '')then
begin
Result := False;
WriteLn('Setup incorrect.');
end else
begin
Result := True;
Status('Setup looks ok...');
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< ReadyScript; >}
{< Prepares script. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure ReadyScript;
begin
if(not(LoggedIn))then
begin
LoginPlayer;
WriteLn('Logged ' + Players[CurrentPlayer].Name + ' in.');
end
else
begin
Status('Checking setup..');
if(CheckSetup)then
begin
MakeCompass('N');
HighestAngle;
DisguiseSCAR('ZoneAlarm Pro');
WriteLn('Script started at: ' + TheTime);
ChatsOff;
FindPickHeadColor;
SetRun(True);
end;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< LoadDTMs; >}
{< Loads all DTMs used in memory. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure LoadDTMs;
begin
DTMPick := DTMFromString('78DA6314626060606340011616210C3A8C0C0' +
'C40C4F01F0818E5810C7E5435060A0A609A11CA676402121C0C68' +
'8011550DC81E79026A048104337E3500526F05F4');
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< AllFalse; >}
{< Checks if all players are false. ( Based off TOB's AllPlayersInactive; ) >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
function AllFalse: Boolean;
var
i, Count: Integer;
begin
for i := 0 to HowManyPlayers - 1 do
begin
if(Players[i].Active = False)then
begin
Count := Count +1;
end;
if(Count >= HowManyPlayers)then
begin
WriteLn('All players are inactive.');
Result := True;
end else Result := False;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< RespondText; >}
{< Declares text used for Respond; >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure RespondText;
begin
RespondTxt[0] := 'lolz';
RespondTxt[1] := 'lol';
RespondTxt[2] := 'rofl!'; // Respond to common lol, rofl ect..
RespondTxt[3] := 'lmao';
RespondTxt[4] := 'lmfao';
RespondTxt[5] := 'pmsl';
RespondTxt[6] := 'hey';
RespondTxt[7] := 'wasssup?';
RespondTxt[8] := 'howdy'; // Respond to common hi, hey ect..
RespondTxt[9] := 'hi';
RespondTxt[10] := 'what?';
RespondTxt[11] := IntToStr(GetSkillLevel('mining')) + ' my level';
RespondTxt[12] := 'my mining lvl is ' + IntToStr(GetSkillLevel('mining')) + ' ^^'; // Respond to mining lvl?
RespondTxt[13] := 'lolz mine is only ' + IntToStr(GetSkillLevel('mining'));
RespondTxt[14] := IntToStr(GetSkillLevel('mining'));
RespondTxt[15] := IntToStr(GetSkillLevel('mining')) + ' here';
RespondTxt[16] := 'whats your mining lvl?';
RespondTxt[17] := 'nice';
RespondTxt[18] := 'omg someone was ranover outside my house!!'; // Just random chat. ^^
RespondTxt[19] := 'that guy over there is autoing i can tell..';
RespondTxt[20] := 'you like pasta';
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< Respond; >}
{< Responds to common chat messages. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure Respond;
begin
OldLine := TheLine;
TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine := TheLine;
if(OldLine <> NewLine)then
if(pos('yo', TheName) <> 0)or(pos(Players[CurrentPlayer].Nick, TheName) <> 0)then
begin
Wait(2000 + Random(7000));
end else
if(InChatMulti('hey', 'hi', 'wassup'))then
begin
TypeSend(RespondTxt[0 + Random(6)]);
Responded := Responded + 1;
end;
if(InChatMulti('lol', 'lmao', 'rofl'))then
begin
TypeSend(RespondTxt[5 + Random(6)]);
Responded := Responded + 1;
end;
if(InChatMulti('mining lvl', 'mining lvls', 'mine lvls'))then
begin
TypeSend(RespondTxt[10 + Random(6)]);
Responded := Responded + 1;
end;
if(InChatMulti('what', 'wth', 'wtf'))then
begin
TypeSend(RespondTxt[15 + Random(6)]);
Responded := Responded + 1;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< RandomizeClick; >}
{< Randoms between left or right click. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure RandomizeClick(x, y: Integer);
begin
case Random(2) of
0: Mouse(x, y, 1, 1, True);
1: PopUp2(x, y, 1, 1, 'Mine');
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< Randoms; >}
{< Modifyied SRL FindNormalRandoms; >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
function Randoms: Boolean;
begin
if(not(LoggedIn))then Exit;
for i := 0 to 17 do
begin
case i of
0: if FindPick then
Result := True;
1: Respond;
2: if FindTalk then
Result := True;
3: if FindDead then
Result := True;
4: if FindMod then
Result := True;
5: if FindMime then
Result := True;
6: if FindMaze then
Result := True;
7: if FindQuiz then
Result := True;
8: if FindDemon then
Result := True;
9: if FindScapeRune then
Result := True;
10: if FindTalk then
Result := True;
11: if FindLamp(LampSkill) then
Result := True;
12: if (FindNewBox) then
begin
Result := True;
if (UseBoxSolver) then
SolveBox
else
GambleNewBox;
end;
13: if FindTrade then
Result := True;
14: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].Loc := 'No GameTab';
LogOut;
Exit;
end;
end;
15: SaveToChatLog;
16: if RC then
Result := True;
17: CloseWindow;
end;
Wait(1);
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< PickBroke; >}
{< Checks if pickaxe is broken. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
function PickBroke: Boolean;
begin
if(not(LoggedIn))then Exit;
case Players[CurrentPlayer].Boolean1 of
False: GameTab(3);
True : GameTab(4);
end;
if(FindDTM(DTMPick, ax, ay, 564, 212, 726, 454))then
begin
MMouse(ax, ay, 1, 1);
if(IsUpText('roken'))or(IsUpText('andle'))then Result := True;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< CheckGas; >}
{< Finds and handles gas. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
function CheckGas: Boolean;
begin
GC[0] := 11056825;
GC[1] := 9281445;
GC[2] := 8492186;
GC[3] := 7767947;
if(not(LoggedIn))then Exit;
for i := 0 to 3 do
if(FindColorSpiralTolerance(gx, gy, GC[i], 3, 3, 515, 336, 10))then
begin
WriteLn('Gas found!!');
repeat
Mouse(450, 12, 0, 0, True);
FTWait(10 + Random(30));
until(PickBroke)or(not(FindColorSpiralTolerance(gx, gy, GC[i], 3, 3, 515, 336, 10)))
if(not(FindColorSpiralTolerance(gx, gy, GC[i], 3, 3, 515, 336, 10)))then
Result := False; // No gas found..
if(PickBroke)then
begin
WriteLn('Axe has been broken!!');
Result := False;
end else
begin
WriteLn('Gas found and handled.');
Gases := Gases + 1;
Result := True;
end;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< SetColor; >}
{< Setups colors. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure SetColors;
begin
case LowerCase(Players[CurrentPlayer].String1) of
'copper' : begin
OC[0] := 4615059;
OC[1] := 2769242; // Change if needed.
OC[2] := 3956354;
WriteLn('RockColor''s: ' + IntToStr(OC[0]) + ',' + IntToStr(OC[1]) + ',' + IntToStr(OC[2]));
end;
'tin' : begin
OC[0] := 8224392;
OC[1] := 5395032; // Change if needed.
OC[2] := 6579308;
WriteLn('RockColor''s: ' + IntToStr(OC[0]) + ',' + IntToStr(OC[1]) + ',' + IntToStr(OC[2]));
end;
'iron' : begin
OC[0] := 2503250;
OC[1] := 2174538; // Change if needed.
OC[2] := 1449776;
WriteLn('RockColor''s: ' + IntToStr(OC[0]) + ',' + IntToStr(OC[1]) + ',' + IntToStr(OC[2]));
end;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< FindDeformedSymbol; >}
{< Attempts to find covered symbols. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
function FindDeformedSymbol(Symbol: string; MinAcc: Extended): Boolean;
begin
if(not(LoggedIn))then Exit;
if(FindSymbol(sx, sy, LowerCase(Symbol)))then
begin
WriteLn(UpperCase(Symbol) + ' symbol was found at: ' + IntToStr(sx) + ',' + IntToStr(sy));
Result := True; // yay :D
end;
if(not(FindSymbol(sx, sy, LowerCase(Symbol))))then
begin
repeat
SendArrowSilentWait(2, 500 + Random(500));
Wait(5000 + Random(2000));
SymbolAccuracy := SymbolAccuracy - 0.1;
until(FindSymbol(sx, sy, LowerCase(Symbol)))or(SymbolAccuracy >= MinAcc)
if(SymbolAccuracy >= MinAcc)then
begin
WriteLn(UpperCase(Symbol) + ' symbol was not found.');
Result := False; // nay :'(
end else
begin
WriteLn(UpperCase(Symbol) + ' symbol was found at: ' + IntToStr(sx) + ',' + IntToStr(sy));
Result := True; // yay :D
end;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< Report; >}
{< Attempts to find covered symbols. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure Report;
begin
WriteLn('');
WriteLn('{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}');
WriteLn('{< East Varrock Powerminer & Banker >)');
WriteLn('{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}');
WriteLn(' Worked for: ' + TimeRunning );
WriteLn(' Mined: ' + IntToStr(Trips * 28) + ' ore. ');
WriteLn(' Made: ' + IntToStr(Trips) + ' trips. ');
WriteLn(' Avoided gas: ' + IntToStr(Gases) + ' times. ');
WriteLn(' Current Player: ' + Players[CurrentPlayer].Name);
WriteLn(' Mining Level: ' + IntToStr(Players[CurrentPlayer].Level[15]));
WriteLn('{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}');
for i := 0 to HowManyPlayers-1 do
begin
if(Players[i].Active = True)then
begin
Active := 'True'
end else Active := 'False';
WriteLn(IntToStr(i) + ' : ' + Players[i].Name + ' = ' + Active + '. - Lvl : '
+ IntToStr(Players[i].Level[15]) + '. - B :' + IntToStr(Players[i].Banked)
+ ' Times.' + ' - : ' + IntToStr(Players[i].Worked) + ' mins.' + ' - Loc: '
+ Players[i].Loc);
WriteLn('{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}');
WriteLn('');
SRLRandomsReport;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< WalkTo; >}
{< Raidial walks to the mine. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure WalkTo;
begin
if(not(LoggedIn))then Exit;
FindRoadColor;
RadialRoadWalk(TestColor, 6, 70, 70, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, 90, 140, 65, 1, 1);
FindRoadColor; // ;)
RadialRoadWalk(TestColor, 126, 220, 60, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, 139, 200, 57, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, 134, 200, 55, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, 130, 220, 60, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, 155, 220, 40, 1, 1);
if(FindDeformedSymbol('mining spot', MinAccuracy))then
begin
repeat
Mouse(sx, sy, 1, 1, True);
Wait(1000 + Random(5000));
until(not(FlagPresent))
WriteLn('Walking to mine successfull.');
end else
begin
Players[CurrentPlayer].Loc := 'Lost';
WriteLn('Walking to mine unsuccessfull.');
NextPlayer(False);
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< WalkBack; >}
{< Radial walks to bank. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure WalkBack;
begin
if(not(LoggedIn))then Exit;
begin
if(InvEmpty)then
begin
WriteLn('Something has gone wrong during mining.');
NextPlayer(False);
end else
begin
RadialRoadWalk(TestColor, 8, 75, 70, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, -50, 50, 70, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, -50, 50, 70, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, -50, 50, 70, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, -70, -10, 70, 1, 1);
FindRoadColor;
RadialRoadWalk(TestColor, -50, -130, 70, 1, 1);
end;
if(FindDeformedSymbol('bank', 0.4))then
begin
Wait(2000 + Random(3000));
Mouse(sx, sy, 1, 1, True);
WriteLn('Walking back successfull.');
end else
begin
WriteLn('Walking back unsuccessfull.');
NextPlayer(False);
end;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< BankTheGoods; >}
{< Banks ores. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure BankTheGoods;
var
Att: Integer;
begin
if(not(LoggedIn))then Exit;
begin
if(InvCount <> 28)then
begin
WriteLn('Something has gone wrong during mining.');
NextPlayer(False);
end else
begin
repeat
Att := Att + 1;
Wait(2000 + Random(5000));
OpenBank;
until(BankScreen)or(Att >= FailSafe)
case Players[CurrentPlayer].Boolean1 of
False : Deposit(2, 28, 2);
True : Deposit(1, 28, 2);
end;
Trips := Trips + 1;
end;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< MineOre; >}
{< Mines ore. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
procedure MineOre;
var
Att: Integer;
begin
if(not(LoggedIn))then Exit;
begin
Att := 0;
for i := 0 to 2 do
if(FindObjOre(ox, oy, Players[CurrentPlayer].String1, OC[i], Tol, 5))then
begin
MMouse(ox, oy, 1, 1);
if(IsUpText('ine'))then
begin
RandomizeClick(ox, oy);
Wait(WaitT * 6000 + Random(4000));
end else
begin
repeat
Att := Att + 1;
SendArrowSilentWait(2, 500 + Random(500));
Wait(WaitT * 6000 + Random(2000));
until(Att >= FailSafe)or(FindObjOre(ox, oy, Players[CurrentPlayer].String1, OC[i], Tol, 5))
end;
if(Att >= FailSafe)then
begin
WriteLn('Finding of: ' + UpperCase(Players[CurrentPlayer].String1) + ' has failed.');
NextPlayer(False);
end;
if(FindObjOre(ox, oy, Players[CurrentPlayer].String1, OC[i], Tol, 5))then
begin
MMouse(ox, oy, 1, 1);
if(IsUpText('ine'))then
begin
RandomizeClick(ox, oy);
Wait(WaitT * 6000 + Random(4000));
end else
begin
WriteLn('Finding of: ' + UpperCase(Players[CurrentPlayer].String1) + ' has failed.');
end;
end;
end;
end;
end;
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
{< Main Loop >}
{< Core. >}
{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
begin
SetupSRL;
SetupSRLMining;
LoadDTMs;
ReadyScript;
repeat
if(FindDeformedSymbol('bank', MinAccuracy))then
begin
Players[CurrentPlayer].Loc := 'Bank';
end
if(FindDeformedSymbol('mining spot', MinAccuracy))then
begin
Players[CurrentPlayer].Loc := 'Mine';
end;
if(Players[CurrentPlayer].Loc = 'Mine')then
begin
WriteLn('We are already at the mine!');
end;
if(Players[CurrentPlayer].Loc = 'Bank')then
begin
WalkTo;
end else
begin
NextPlayer(False);
begin
MarkTime(StartTime);
repeat
if(not(LoggedIn))then Break;
MineOre;
CheckGas;
Randoms;
RandomMovement;
Report;
until(InvFull)or(TimeFromMark(StartTime * 60000) >= MaxTime * 60000))
WalkBack;
BankTheGoods;
end;
until(AllFalse)or(IsFKeyDown(PanicKey))
end.