Simba Code:
Program BasedRuniteMiner;
{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i sps\sps.simba}
Const
{BASED RUNITE MINER by Based Lord}
VERSION = '1.3';
{
1. Fill in the DeclarePlayers/Login
2. Fill in WhatWorlds in the Const Below
3. Move your player to the Mining Guild Resource Dungeon
4. Have a pick in your inventory or equipped
5. Start the Script!
This is my first script and there is still much to do.
I plan to add alot in the future :)
*************************************
SETUP - Please Change what is needed }
WhatWorlds = 'B'; // M for Members only, N for Non-Members Only, B for Both
Var
CheckX, CheckY : Integer;
Attempts, HopsMade : Integer;
OreMined, OrePerHour : Integer;
RandX, RandY : Integer;
AtHome : Boolean;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
End;
Procedure Antiban;
Begin
case Random(1000) of
0: RandomRClick;
1: RandomRClick;
2: HoverSkill('Mining', False);
3: HoverSkill('Random', False);
4: PickUpMouse;
5: RandomRClick;
6: RandomMovement;
7: HoverSkill('Mining', False);
8: ExamineInv;
9: RandomRClick;
10: ExamineInv;
End;
End;
Function RuneChecker : Boolean; // Uses previous mouse coords to check the uptext on the rocks
Begin
if (Not LoggedIn) then Exit;
if (CheckX > 300) then // Top Right Rock Check
Begin
wait(100+Random(200));
MMouse(MSCX, MSCY-20, 0, 0);
End;
if ((CheckY < 200) and (CheckX < 200)) then // Top Left Rock Check
Begin
wait(100+Random(200));
MMouse(MSCX-30, MSCY, 0, 0);
End;
if ((CheckY > 200) and (CheckX < 200)) then // Bottom Left Rock Check
Begin
wait(100+Random(200));
MMouse(MSCX, MSCY+40, 0, 0);
End;
if WaitUptextMulti(['nite','Run'],400) then // Checks if Runite is still on the rock
Begin
wait(100+Random(50));
Result := True;
AntiBan;
End else
Begin
Result := False;
End;
End;
Procedure HomePos; //Moves Character back to a "Home Position" where all 3 Rocks are visable
Var
HomePosition : TPoint;
Begin
if (Not LoggedIn) then Exit;
HomePosition := Point(143,768);
if (AtHome = True) then exit;
SPS_WalkToPos(HomePosition);
AtHome := True;
End;
Function RuneFinder : Boolean; // Finds the Ore and saves the coord
Var
CTS,x,y, I : Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
Begin
if (Not LoggedIn) then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 1.91);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 13222022, MSX1, MSY1, MSX2, MSY2, 10);
Inc(Attempts);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
Begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
GetMousePos(CheckX, CheckY);
if WaitUptextMulti(['nite','Runi'],500) then
Begin
//WriteLn('Found Ore');
Attempts:=0;
Result := True;
Break;
End;
End;
End;
Function isMining: Boolean; // Found this in Flight's Pixelshif Guide
Var // Checks to see if your player is moving (mining)
PBox: TBox;
Begin
if (Not LoggedIn) then Exit;
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 400);
End;
Procedure MineRune; // Clicks on the ore and waits
Var
x, y, PrevInv : Integer;
Begin
if not FindNormalRandoms then
if not LoggedIn then
Exit;
PrevInv := InvCount;
if RuneFinder() then
Begin
GetMousePos(x, y);
Mouse(x,y,0,0,true); // Clicks on ore (Mouse Should already be hovering ore)
wait(1000+random(500));
RandX := (Random(4));
RandY := (Random(4));
Repeat
RuneChecker;
wait(100);
Until (Not RuneChecker) and (Not isMining);
if (PrevInv<InvCount) Then Inc(OreMined);
AtHome := False; // Ore is now gone
End;
End;
Function WorldHop : Boolean;
Var
PreviousWorld, NextWorld : Integer;
RandomNumber : Integer;
Begin
If (Not(FindNormalRandoms)) Then
Begin
ExitToLobby;
OpenWorldScreen;
WS_CurrentWorld(PreviousWorld);
case WhatWorlds of
'B':
Repeat
RandomNumber:=Random(2);
if RandomNumber = 1 then // Couldn't find method to pick from both
Begin
NextWorld := RandomWorld(True,False);
End else
NextWorld := RandomWorld(False,False);
Until (NextWorld <> PreviousWorld);
'M':
Repeat
NextWorld := RandomWorld(True,False);
Until (NextWorld <> PreviousWorld);
'N':
Repeat
NextWorld := RandomWorld(False,False);
Until (NextWorld <> PreviousWorld);
End;
SelectWorld(NextWorld);
Inc(HopsMade);
//WriteLn('Switching to World '+IntToStr(NextWorld));
LoginPlayer;
Attempts := 0;
Result := True;
End;
End;
Procedure ProgressReport;
Begin
ClearDebug;
OrePerHour := Round((OreMined)/(GetTimeRunning / 3600000.0));//<- Got this method from GOOGLE
WriteLn('~~~~~Based Runite Miner~~~~~');
WriteLn(' Version '+VERSION+' By Based Lord');
Writeln('Time Running: ' + TimeRunning);
WriteLn('Ore Mined: ' +IntToStr(OreMined));
WriteLn('Ore Per Hour: ' +IntToStr(OrePerHour));
WriteLn('World Hops: ' +IntToStr(HopsMade));
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
End;
Procedure MainLoop; // Where I will add other things :P in the future
Begin
if (Not FindNormalRandoms) then
if not LoggedIn then
Exit;
Begin
RuneFinder;
MineRune;
HomePos;
AntiBan; //Possible AntiBan between Going to next rock / World Hopping
ProgressReport;
if (Attempts >= 3) then WorldHop; // Hops Worlds
End;
End;
Begin
Smart_Server := 19;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
Attempts := 0;
DeclarePlayers;
LoginPlayer;
SPS_Setup(RUNESCAPE_OTHER,['dwarven_mine']);
FindSpinTicket()
HomePos;
ClickNorth(SRL_ANGLE_HIGH);
Repeat
if (InvFull) then
Begin
Writeln('Ending - Inventory is full');
Logout();
TerminateScript();
End;
MainLoop;
Until (Not Loggedin);
End.