Simba Code:
program ArdyMiner;
// Includes...
{$i srl/srl/misc/smart.simba}
{$loadlib sps}
{$i srl/srl.simba}
{$i sps/sps.simba}
const
SRLStats_User = ''; // Your SRL Stats ID (If you dont have one then just leave it as it is)
SRLStats_Password = ''; // Your SRL Stats Password (If you dont have one then just leave it as it is)
Var
X, Y, T, W, Flax, Breaks, Loads: Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players, for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // Don't touch
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
Players[0].Integers[1] := 200;//# of loads to do.
Players[0].Integers[2] := 720; // Time before breaking ( In minutes)
end;
procedure SetupLogin;
begin
ClearDebug;
// Setting up SMART;
Smart_Server := 9;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
SetupSRLStats(295, SRLStats_User, SRLStats_Password);
DeclarePlayers;
LoginPlayer; // Logging in...
end;
procedure BreakTime;
var
s, i: Integer;
begin
if (s = 0) then
s := Players[0].Integers[2] * 60000; //+ RandomRange(300000, 600000);
if T = 1 then
begin
W:= GetTimeRunning;
if (W > s) then
begin
Logout;
i:= RandomRange(10, 15);
Writeln('Taking a break for ' + IntToStr(i) + ' minutes');
i:= i * 60000;
Wait(i);
T := 0;
s:= W + s;
Inc(Breaks);
LoginPlayer;
end;
end else
if T = 0 then
begin
T := T + 1;
end;
end;
procedure SetupSps;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['6_8']);
SPS_Continue := false;
end;
procedure Antiban; //idea taken from Coh3n's tutorial.
begin
if not (LoggedIn) then
Exit;
begin
case Random(100) of // Random(100) generates a random integer from 0 to 59
10: RandomRClick;
30: HoverSkill('Mining', False);
40: PickUpMouse;
50: RandomMovement;
70: BoredHuman;
89: ExamineInv;
end;
end;
end;
procedure RestUp;
begin
if not (LoggedIn) then
Exit;
begin
SetRest;
while not RunEnergy(95) do
begin
Antiban;
Wait(Random(1000));
end;
end;
end;
function DepositAllCus: Boolean; //Credit to Kyle Undefined for the fix
var
T, X, Y: Integer;
BScreen, DScreen: Boolean;
begin
Result := false;
BScreen := BankScreen;
if (not(BScreen)) then
DScreen := DepositScreen;
if (BScreen) or (DScreen) then
if (InvCount > 0) or (FindColor(X, Y, srl_outline_black, 98, 68, 436, 257) and (DSCreen)) then
begin
Mouse(360 - 50 * Integer(DScreen), 305 - 30 * Integer(DScreen), 15, 10, True);
Wait(200 + Random(300));
T := GetSystemTime;
while (InvCount > 0) or (FindColor(X, Y, srl_outline_black, 98, 68, 436, 257) and (DSCreen)) and (GetSystemTime - T < 2000) do
Wait(100);
Result := (InvEmpty) or (not(FindColor(X, Y, srl_outline_black, 98, 68, 436, 257)) and (DScreen));
end else begin
srl_Warn('DepositAll', 'No items to deposit ', warn_AllVersions);
result := true;
end;
end;
function Banking: Boolean;
var
p, t: Integer;
begin
if not (LoggedIn) then
Exit;
if (InvCount < 1) then
Exit;
while (IsMoving) do
begin
Wait(RandomRange(900, 1200));
end;
t := 0; //Tries starts at zero
repeat
Inc(t);
Writeln('Trying to open the bank, this is the ' + IntToStr(t) + ' try out of 5');
MakeCompass('n');
Wait(RandomRange(700, 1000));
if not(OpenBankNPC) then
OpenBank('clt', True, True);
until BankScreen or PinScreen or (t = 5);
if PinScreen then
begin
p := 0;
repeat
InPin(Players[0].Pin);
Inc(p)
until BankScreen or (p > 0) or not (LoggedIn);
end;
if BankScreen then
begin
Writeln('Opened the bank...');
if not DepositAllCus then
DepositAll;
Wait(RandomRange(500, 1500));
CloseBank;
end;
if (t = 5) then
begin
Writeln('failed to find bank.');
Writeln('Terminating...');
TerminateScript;
end;
end;
function Walking(Color, Tolerance: Integer; SortFrom: tpoint): Boolean;// credit to Camaro' for the tutorial and function!
var
i, x, y, rx, ry: Integer;
TPA: TPointArray;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, Tolerance);
SortTPAFrom(TPA, SortFrom);
for i := 0 to High(TPA) do
begin
x := TPA[i].x;
y := TPA[i].y;
rx := RandomRange(-6, 6);
ry := RandomRange(-6, 6);
if (not rs_OnMinimap(x + rx, y + ry)) then
Continue;
Mouse(x + rx, y + ry, 0, 0, true);
FFlag(0);
Wait(200 + Random(500));
Result := True;
Break;
end;
end;
procedure WalkToOre;
var
BankToOre: TPointArray;
begin
if not (LoggedIn) then
Exit;
if not FindNormalRandoms then
begin
if not RunEnergy(25) then
RestUp;
MakeCompass('n');
Writeln('Going to Ore');
Wait(Random(1000));
BankToOre :=[Point(2448, 3525), Point(2424, 3525), Point(2406, 3519), Point(2414, 3496), Point(2433, 3485), Point(2451, 3472), Point(2466, 3466), Point(2487, 3458), Point(2502, 3450), Point(2523, 3439), Point(2553, 3439), Point(2577, 3435), Point(2600, 3425), Point(2609, 3400), Point(2619, 3382), Point(2630, 3361), Point(2629, 3340)];
if SPS_WalkPath(BankToOre) then
Writeln('Near the Ore');
Wait(RandomRange(1200, 1500));
end;
end;
procedure GetOre;
var x, y: integer;
begin
repeat
SetAngle(SRL_ANGLE_HIGH);
if FindObj(x, y, 'ine', 16709107, 35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('ine');
end;
repeat
wait(1000+random(1000));
AntiBan;
Until not IsUpText('mine') or (InvFull);
until(InvFull);
end;
procedure WalkToBank;
var
FlaxToBank: TPointArray;
begin
if not (LoggedIn) then
Exit;
if not FindNormalRandoms then
begin
if not RunEnergy(25) then
RestUp;
MakeCompass('E');
Writeln('Walking to Bank...');
Wait(Random(1000));
FlaxToBank :=[Point(2636, 3336), Point(2629, 3375), Point(2614, 3399), Point(2603, 3423), Point(2574, 3453), Point(2538, 3479), Point(2525, 3506), Point(2488, 3524), Point(2462, 3552), Point(2417, 3555), Point(2405, 3535), Point(2455, 3526)];
if SPS_WalkPath(FlaxToBank) then
Writeln('Banking Your Ore!! You Didnt Get Killed?..');
Wait(RandomRange(200, 400));
end;
end;
procedure MainLoop;
begin
SetupLogin;
SetupSps;
T := 0;
for Loads := 0 to Players[0].Integers[1] do
begin
if not (LoggedIn) then
Break;
BreakTime;
Banking;
WalkToFlax;
GetOre;
WalkToBank;
end;
end;
begin
MainLoop;
end.