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.
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.