SRL Archive - RS3 Outdated / Broken Scripts

[Color][WorldSwitching] Runite Miner at 'Resource Dungeon'


wasfer

2011-11-18 17:39:06

Mines runite ores in Resource dungeon, switches worlds and banks when inventory full.
Not the best, but it does its job.
Does not have progress report!
All the suggestions on what to implement/fix are welcome!
Quickly made, so dont blame me if it f…s up, it has bugs i know.
Start by the bank, rune pickaxe in inventories first slot or equipped.


program RuniteMiner;
{$DEFINE SMART}
{.include SRL/SRL.scar}
{$i sps/sps.simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
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

end;


const
Bankcolor1=5469842;
Bankcolor2=3233901;
Laddercolor1=4091785;
Laddercolor2=2315631;
Entrancecolor1=4410514;
Entrancecolor2=2898100;
runitecolor1=15919011;
runitecolor2=15787682;
Laddercolor3=4541776;
Laddercolor4=4673362;

Procedure Start;
Begin

If(Not(LoggedIn))then
LogInPlayer;
Writeln('Starting...');
Wait(RandomRange(1000, 1500));
FindNormalRandoms;
SetAngle(true)
end;


var
I: Integer;



Function ChatCheck: Boolean;
var
i, l : Integer;
b : Boolean;
begin
if (Pos('anage', GetBlackChatMessage) > 0)then
begin
Writeln('Mined runite ore!');
Result:=True;
end;
end;



Function MineOre: boolean;
var
x, y : Integer;
begin
if not LoggedIn then Exit;
if FindObjCustom(x, y, ['ine', 'ocks'], [runitecolor1, runitecolor2], 5) then
begin
Writeln('Found Runite ore!');
Mouse(x, y, 0, 0, true);
Result:=True;
Wait(3000 + Random(100));
end else begin
Writeln('Did not find runite ore!');

end;
end;

Procedure MineProcess;
var
x,y: integer;
begin
repeat
Mineore;
wait(3300+RandomRange(20,80))
ChatCheck;
if InvFull=true then break;
if (not(FindObjCustom(x, y, ['ine', 'ocks'], [runitecolor1, runitecolor2], 5))) then break;
until(ChatCheck=true)
end;

Function MineAfterRelog: Boolean;
begin
Mineore;
MineProcess;
wait(2300+RandomRange(20,80))
Mineore;
MineProcess;
SetAngle(false)
Makecompass(60)
wait(2300+RandomRange(20,80))
Mineore;
MineProcess;
SetAngle(true)
wait(2300+RandomRange(20,80))
end;




Procedure Spot3;
var
x, y: Integer;
begin
MakeCompass(30)
If findcolortolerance(x,y,3026728,604 ,111 ,621 ,120, 15)then
begin
Mouse(x,y,1,1,true)
end else begin
Writeln('Did not find spot3!');
end;
end;

Procedure Spot2;
var
x, y: Integer;
begin
If findcolortolerance(x,y,3421497,645 ,87 ,661 ,112, 15)then
begin
Mouse(x,y,1,1,true)
end else begin
Writeln('Did not find spot2!');
end;
end;

procedure Spot;
var
x, y: Integer;
begin
If findcolortolerance(x,y,5796742,626 ,104 ,635 ,117, 15)then
begin
Mouse(x,y,1,1,true)
end else begin
Writeln('Did not find spot!');
end;
end;

Function Pin: Boolean;
begin
if not (BankScreen) then
begin
if PinScreen then
begin
Writeln('Entering Pin...');
repeat
InPin(Players[CurrentPlayer].Pin);
until (BankScreen)
end;
end;
end;


Procedure Bank;
var x,y :Integer;
begin
if FindObjCustom(x, y, ['ank', 'ooth'], [Bankcolor1, Bankcolor2], 5) then
begin
Writeln('Found Bank booth!');
Mouse(x, y, 0, 0, false);
wait(300+RandomRange(20,80))
end;
if ChooseOption('uickly') then
begin
wait(2300+RandomRange(20,80))
Pin;
if (BankScreen) then
begin
wait(1300+RandomRange(20,80))
Deposit(2,28,true);
end else
if not (BankScreen) then
begin
Bank;
end;
end;
end;
Procedure WithdrawPickaxe;
var
x,y: integer;
begin
if FindObjCustom(x, y, ['une', 'ickaxe'], [11706488, 7299914], 5) then
begin
Mouse(x, y, 0, 0, true);
end else begin
Writeln('Found withdraw rune pickaxe!');
CloseBank;
TerminateScript;
end;
end;

Procedure Equip;
begin
InvMouse(1,3);
If WaitUptext('ickaxe', 500) then
begin
InvMouse(1,2);
Writeln('equiping pickaxe!');
ChooseOption('Wield');
end else begin
bank;
WithdrawPickaxe;
Closebank;
end;
end;

Procedure Equiped;
var
x,y : Integer;
Begin

If(Not(LoggedIn))then
LogInPlayer;
FindNormalRandoms;

MouseEquippedItem('weapon', 3);
if WaitUptext('ickaxe', 500) then
Writeln('Pickaxe is in equipment.')
else begin
Writeln('Theres no pickaxe in your equipment, checking inventory.');
Equip;
end;
Wait(RandomRange(1000, 1500));
end;

Procedure Ladder;
var x,y :Integer;
begin
if FindObjCustom(x, y, ['imb-down', 'adder'], [Laddercolor1, Laddercolor2], 15) then
begin
Writeln('Found ladder!');
Mouse(x, y, 0, 0, false);
wait(300+RandomRange(20,80))
end;
if ChooseOption('limb-down') then
begin
wait(1300+RandomRange(20,80))
end;
end;

Procedure MysteriousEntrance;
var x,y :Integer;
begin
if FindObjCustom(x, y, ['ysterio', 'ntrance'], [Entrancecolor1, Entrancecolor2], 15) then
begin
Writeln('Found Mysterious entrance!');
Mouse(x, y, 0, 0, false);
wait(300+RandomRange(20,80))
end;
if ChooseOption('nter') then
begin
wait(1300+RandomRange(20,80))
end;
end;

Procedure MysteriousEntranceExit;
var x,y :Integer;
begin
if FindObjCustom(x, y, ['ysterio', 'ntrance'], [Entrancecolor1, Entrancecolor2], 15) then
begin
Writeln('Found Mysterious entrance!');
Mouse(x, y, 0, 0, false);
wait(300+RandomRange(20,80))
end;
if ChooseOption('xit') then
begin
wait(1300+RandomRange(20,80))
end;
end;

Procedure WalktoLadder;
var
toLadder : TPointArray;
begin
SPS_Debug := true;
SPS_Setup(RUNESCAPE_SURFACE, ['9_7','9_8'])
toLadder := [ Point(3911,3236),Point(3897, 3280) ];
SPS_WalkPath(toLadder);
SPS_GetMyPos();

end;

Procedure WalktoBank;
var
toBank : TPointArray;
begin
SPS_Debug := true;
SPS_Setup(RUNESCAPE_SURFACE, ['9_7','9_8'])
toBank := [ Point(3869, 3211) ];
SPS_WalkPath(toBank);
wait(6000);
SPS_GetMyPos();

end;


Procedure CaveLadder;
var x,y :Integer;
begin
if FindObjCustom(x, y, ['imb-down', 'adder'], [Laddercolor3, Laddercolor4], 15) then
begin
Writeln('Found Cave Ladder!');
Mouse(x, y, 0, 0, false);
wait(300+RandomRange(20,80))
end;
if ChooseOption('limb-up') then
begin
wait(1300+RandomRange(20,80))
end;
end;

Function SwitchWorld1: Boolean;
var
x, y : Integer;
WorldNum: Integer;
begin
FindNormalRandoms;
begin
repeat
WriteLn(I);
Inc(I);
if (I > 130) then
I := 1;
Wait(10);
Writeln('Logging to lobby.');
ExitToLobby;
OpenWorldScreen;
inc(WorldNum);
SelectWorld(I)
LoginPlayer;
SetAngle(True);
MakeCompass(30);
wait(1300+RandomRange(20,80))
if InvFull=true then break;
if FindObjCustom(x, y, ['ine', 'ocks'], [runitecolor1, runitecolor2], 5) then Break;
Until(WorldNum = 139)
end;
end;


Procedure Walkback;
var
x, y: Integer;
begin
MakeCompass(30)
If findcolortolerance(x,y,393964,MMX1 ,MMY1 , MMX2, MMY2, 15)then
begin
Mouse(x,y,1,1,true)
end else begin
Writeln('Did not find start!');
end;
end;
Procedure Mining;
begin
ClickNorth(True)
SetAngle(true)
Spot;
wait(5300+RandomRange(20,80))
MineOre;
MineProcess;
Spot2;
wait(5300+RandomRange(20,80))
MineOre;
MineProcess;
Spot3;
wait(6300+RandomRange(20,80))
MineOre;
MineProcess;
wait(2300+RandomRange(20,80))
end;

Procedure Repeater;
var
WorldNum: Integer;
begin
repeat
bank;
WalktoLadder;
wait(5000+RandomRange(20,80))
Ladder;
wait(5300+RandomRange(20,80))
MysteriousEntrance;
wait(3300+RandomRange(20,80))
repeat
Mining;
SwitchWorld1;
wait(3300+RandomRange(20,80))
Walkback;
wait(3300+RandomRange(20,80))
until(invfull)
wait(3300+RandomRange(20,80))
Walkback;
wait(3300+RandomRange(20,80))
MysteriousEntranceExit;
wait(2300+RandomRange(20,80))
CaveLadder;
wait(4300+RandomRange(20,80))
WalktoBank;
until(false)
end;


begin
Smart_Server := 54;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
start;
equiped;
repeater;

end.

















quazzymodem

2011-11-19 12:38:01

Nice bro, thanks for contributing. I almost have another 85 miner so ill post some proggys once I can.

skumesh

2011-11-19 12:47:14

"Exception in Script: Unable to find file 'SRL/SRL.scar' used from ''"

Awkwardsaw

2011-11-19 14:02:20

Try adding a progress report, and maybe even multi player to the script :)

As for banking, SRL has nice banking functions that do still work. I prefer to use BankNPC since the bankers are usually unique compared to the rest of the colors.

sidishere

2011-11-20 00:44:07

this is just the script i was looking for, but it just stands there for me, doesnt do anything :|

divad82

2011-11-20 08:35:16

[Error] C:\Simba\Includes\sps/sps.simba(34:17): Unknown type 'T4DIntegerArray' at line 33
Compiling failed.


how to fix…

wasfer

2011-11-20 13:14:47

From: sidishere
this is just the script i was looking for, but it just stands there for me, doesnt do anything :|


Cant help u there, works for me.

onilika

2011-11-20 14:16:26

From: divad82
[Error] C:\Simba\Includes\sps/sps.simba(34:17): Unknown type 'T4DIntegerArray' at line 33
Compiling failed.


how to fix…


You might not have correctly installed SPS. Try to re-install it, update version.

sidishere

2011-11-20 16:59:41

I got it working.
Thanks for the script, the hard work you put into it and for sharing!

Couple of bugs:

It doesnt acctually mine the runite. Even if rock is available it switches worlds :S
Sometimes it doesnt click on the ladder successfully to go down to the mine and gets confused.
Sometimes an error on runescape "login limit exceeded too many connections from your address" pops up, and it gets stuck (it requires you to click "back")

magernub573

2011-11-20 17:07:11

From: sidishere
This is all i get:
SRL Compiled in 0 msec
SMART Initialized.
Loaded: Server 54, Members: True, Signed: True, Super Detail: False.

And in the cmd it says "SmartSetup entered"

And the script does nothing, doesnt even log the player in.

Any ideas on what im doing wrong?


make sure your graphics settings are set to lowest and fixed screen.

sidishere

2011-11-20 21:54:56

From: magernub573
make sure your graphics settings are set to lowest and fixed screen.


i figured that out, thanks anyway.
I dont know what the issue is but it just goes:
"Did not find runite ore!"
even where there is some ore right in front of it.

'Toxin

2011-11-21 10:10:54

I believe that you're going to need to add a few more failsafes, such as color detection of the actual rock, you're only using two colors and they seem to change at different angles. Fixing an angle then checking for a color may also work better. I may tinker it myself and let you know if it works any better.

Regards,

Toxin.

Sir R. M8gic1an

2011-11-21 10:13:41

Use ACA2 to figure out the best colour & tolerance. Also, for anyone not finding the rocks you can always use the colour picker to choose a new colour.

-RM

'Toxin

2011-11-21 10:38:32

It seems that picking the colors was not the only thing wrong with the script. Upon world switches, it does not even check for rocks sometimes and it seems as if it is stuck in a switching loop. I'm watching it right now and it's switched 10 worlds so far still nothing in the log stating "rock not found" after I updated the colors.

wasfer

2011-11-21 12:47:20

lol after switching world it checks 2 nearest runite rocks, try to get colors right.

'Toxin

2011-11-21 18:49:59

Will gather colors again I suppose… It's weird though, there's nothing remotely close to the blue of the runite rock around, unless you're wearing a mining cape(t) or someone else is or something, so it shouldn't have a problem finding a tolerance of that blue. Will post back after I tweak it again.

E: Got it workin.

omegaangelz

2011-11-24 20:21:16

You got an MSN?

Nsight

2011-11-26 00:41:00

Nice work, I updated the colors and it works flawlessly for me. congrats : )

PremiumBotter

2011-11-26 00:47:09

Works flawless great work I really appriciate it keep up the great work

omegaangelz

2011-11-30 07:05:22

getting 45 dung in about 20 mins. will be very happy to find out this works still flawlessly

omegaangelz

2011-11-30 07:37:58

does not climb down the ladder, it clicks somewhere inside of the housing surrounding the entrance when running and can barely see the ladder, I will donate 20m if you get this working :)

wasfer

2011-12-01 03:33:40

I dont need anything for script, sadly i dont have time to work on this script, its dead script, would appreciate if mod would remove it, by the way Omegaangelz, u could just modifiy walking by removing SPS and add something simple, like Mouse clicks in minimap if u dont know any other way, then it would walk to right place and keep going :)

Nsight

2011-12-01 11:30:51

The script isnt bad, just pick your own colors people! Works flawless for me. Thanks Wasfer : )

wasfer

2011-12-01 12:02:14

From: Nsight
The script isnt bad, just pick your own colors people! Works flawless for me. Thanks Wasfer : )


oh great, did not know it would still work, its really simple script.

iCURiP

2011-12-04 20:57:47

It stops when it opens the bank, it says something about mod bitmaps, sorry i will get what it actually says later i closed it lol.

If anyone actually knows what im on about i would love some help :d

Aegis

2011-12-04 21:50:11

From: iCURiP
It stops when it opens the bank, it says something about mod bitmaps, sorry i will get what it actually says later i closed it lol.

If anyone actually knows what im on about i would love some help :d


That usually happens if the script is prematurely terminated (as far as I know). It ended directly after opening the bank? Anyways, I plan on using this script in a couple of days and I'll be sure to post my findings/fixings of this script.

iCURiP

2011-12-05 11:17:19

From: Aegis
That usually happens if the script is prematurely terminated (as far as I know). It ended directly after opening the bank? Anyways, I plan on using this script in a couple of days and I'll be sure to post my findings/fixings of this script.


Here you go, this is the log.

Starting…
Pickaxe is in equipment.
Found Bank booth!
Exception in Script: Failed to create new thread, code:8
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]

wasfer

2011-12-05 13:50:10

From: iCURiP
Here you go, this is the log.


Update SRL, might fix it.

JRaymond

2011-12-06 01:42:42

Can't get it to work for some reason. Help? :)

SRL Compiled in 31 msec
SMART Initialized.
Loaded: Server 54, Members: True, Signed: True, Super Detail: False.
Welcome to Runescape.
P********
Starting…
Pickaxe is in equipment.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Exception in Script: Out of memory
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]