SRL Archive - First Scripts

Based Runite Miner - Mining Guild Resource Dungeon


Based Lord

2012-06-05 02:50:59

~Based Runite Miner~
by: Based Lord
Last Updated: 6/6/12 Version 1.3


Status: Mines Runite Ore in the Mining Guild Resource Dungeon and World Hops if no ore is found.
Will logout once inventory is full.

Requirements:
  • 45 Dungeonering
  • 85 Mining
  • Mining Pickaxe
  • Insane Luck

Instructions:
1. Fill in the DeclarePlayers/Login
2. Fill in WhatWorlds (In Const)
3. Move your player to the Mining Guild Resource Dungeon
4. Have a pick in your inventory or equipped
5. Start the Script!



Plans:
1. World Hopping - Completed V1.1
2. Antibans/Randoms - Completed V1.3 | Not sure if Randoms are Right Please Help
3. Dropping (lol)
4. MultiPlayer
5. Banking (Private :p)
6. Fail Proof



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.


Changes
Version 1: No Changes First Version
Version 1.1: Added World Hopping and Improved some minor things
Version 1.2: Added ProgressReport and Improved Standards
Version 1.3: Added AntiBan and FindingRandoms *Help on Randoms*



Please feel free to leave feedback about my first script and point out
anything that is incorrect or inefficient.
Ideas are also welcome :)

Gala

2012-06-05 05:53:19

Gratz for your first script.

First of all, this makes no sense to me:

const
PlayerX = MSCX;
PlayerY = MSCY;

Keep up the work and post some updates :)

Based Lord

2012-06-05 12:24:21

From: Gala
Gratz for your first script.

First of all, this makes no sense to me:

const
PlayerX = MSCX;
PlayerY = MSCY;

Keep up the work and post some updates :)


Yeah originally i had the actual MSCX and MSCY numbers there because I fail and forgot the values were already saved. :p
Took out the useless constants

Based Lord

2012-06-05 18:58:28

Updated the script and added worldhop
Can be used to get a full inventory of Runite now :)

Gucci

2012-06-05 19:38:54

Nice first script, your standards are off in the sense of tabbing and the spacing withing procedures is also excessive

Based Lord

2012-06-05 20:00:13

From: Gucci
Nice first script, your standards are off in the sense of tabbing and the spacing withing procedures is also excessive

Thanks for the feedback, I will try to fix it in the next update :)

Based Lord

2012-06-06 12:15:54

~~~~~Based Runite Miner~~~~~
Version 1.3 By Based Lord
Time Running: 11 Minutes and 20 Seconds
Ore Mined: 4
Ore Per Hour: 21
World Hops: 14
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

New Update :)

chief herb

2012-06-06 15:18:58

going to test this right now, thanks for the release!

Based Lord

2012-06-06 21:38:01

From: chief herb
going to test this right now, thanks for the release!

Yeah, No Problem! :)
Please let me know how it works for you.

Freezer

2012-06-09 17:02:51

~~~~~Based Runite Miner~~~~~
Version 1.3 By Based Lord
Time Running: 5 Hours, 30 Minutes and 39 Seconds
Ore Mined: 44
Ore Per Hour: 8
World Hops: 405

it's about 90k/h gp :) you should add bank function :)

(s)okkr7

2012-06-10 02:47:59

Thinking about releasing my runite miner script.. mind it has banking ofc.

Based Lord

2012-06-10 21:21:18

I wouldn't, I have a banking option I have added but will not be releasing it.
The location is just too populated atm

(s)okkr7

2012-06-10 21:23:42

Well that's fine. I just don't see the point in releasing a Runite miner without banking. Sure, you're trying to help people "learn." But this is one of the most common bots out there. But if you want i'll keep it private.

Based Lord

2012-06-10 22:02:42

From: Sokkr7
Well that's fine. I just don't see the point in releasing a Runite miner without banking. Sure, you're trying to help people "learn." But this is one of the most common bots out there. But if you want i'll keep it private.

This was my first script and I learned a lot from it which was the purpose of the script. Honestly, considering the amount of time it takes to gain a full inventory of Runite Ore with how many people are camping the location, You can just run it and leave it for 1-2 hours and just bank yourself. Releasing a flawless banking method would just add on to the number of people camping the spawns and possibly drop the price of ore. Just my thoughts :)

(s)okkr7

2012-06-10 22:11:16

As I said, you aren't the only one with this bot. Powerbot has a free one that banks. I'm not going to argue. It's YOUR script. And if you haven't noticed, prices are already dropping..

Based Lord

2012-06-10 22:15:55

From: Sokkr7
As I said, you aren't the only one with this bot. Powerbot has a free one that banks. I'm not going to argue. It's YOUR script. And if you haven't noticed, prices are already dropping..

In about a month PB will be dead for a good while :P

Reamt

2012-06-11 05:10:25

From: Based Lord
In about a month PB will be dead for a good while :P


Lets hope so.

Based Lord

2012-06-14 00:13:52

~~~~~Based Runite Miner~~~~~
Version 2.0 By Based Lord
Time Running: 22 Minutes and 53 Seconds
Ore Mined: 15
Ore Per Hour: 39
World Hops: 18
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

10800 X 39 = 421200 K/H on F2P only
RS Updates FTW

litoris

2012-06-14 02:41:55

From: Based Lord
~~~~~Based Runite Miner~~~~~
Version 2.0 By Based Lord
Time Running: 22 Minutes and 53 Seconds
Ore Mined: 15
Ore Per Hour: 39
World Hops: 18
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

10800 X 39 = 421200 K/H on F2P only
RS Updates FTW


;_; Last time I used this after an update, only got 5 ores/hr.

BGXD

2012-08-20 15:09:32

Nice script man !