Simba Code:
program Walker;
{$DEFINE SMART}
{$i SRL/srl.simba}
{$i sps/sps.simba}
{$I SRL/SRL/Skill/magic.simba}
{$i ObjectDTM/ObjDTMInclude.simba}
const
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
{@@@@@@@@@@@@@@@@@@@@@@@@@ Smart Setup Constants @@@@@@@@@@@@@@@@@@@@@@@@@@@}
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
Server = 34; // enter "0" to pick a Random server.
Members = False; // is this player a member
NumbOfPlayers = 1; // how many players should be active
StartPlayer = 0; // the player who should be first used
LoadsToDo = 73; // Set how many repetitions to do of a certain Activity
PowerMine = False; // True Or False For Drop Ore
Debug = True; // Enable or Disable Debug Of Script
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
{@@@@@@@@@@@@@@@@@@@@@@@@@ Script Setup Settings @@@@@@@@@@@@@@@@@@@@@@@@@@@}
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
OreChoice = 5; // Valid Mining Choices
// 0 --- Copper
// 1 --- Clay
// 2 --- Gold
// 3 --- Iron
// 4 --- Tin
// 5 --- Silver
// 6 --- Coal
{If You Want To Mine COAL, It Can Only Be Done In The Wildy, Make Sure You
Have Good Armor And A Relatively High Combat Level, Otherwise You Will Die
A Lot And Loose Your Items. ******* BE WARNED ******* }
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
{@@@@@@@@@@@@@@@@@@@@@@@@@ Break Settings @@@@@@@@@@@@@@@@@@@@@@@@@@@}
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
TakeBreaks = False; // Take breaks?
HoursToBreak = 2; // How often to break in minutes
HoursToPlay = 18; // Added randomness to how often you break
NumOfBreaks = 6; // How Many Times Should We Break
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
{@@@@@@@@@@@@@@@@@@@@@@@@@ Mining Location @@@@@@@@@@@@@@@@@@@@@@@@@@@}
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
Location = 1; // Valid Mining Locations
// 0 --- Rimmington
// 1 --- Varrock West
// 2 --- Wildy Scorpions
// 3 --- Wildy Skeletons
// 4 --- Varrock East
var
Path:TPointArray;
OreSpot, ABoxLH, ABoxRL, DP:Tpoint;
Info:String;
Start_Time, End_Time, TotalTime, TripStart, TripEnd, TripTotal,TotalLoads, BreakTimes, TotalBTime, TotalPTime,
DTM_TelePort, DTM_LodeStone,
DTM_GateRoom: Integer;
MineFirstRun, LostMyWay:Boolean;
procedure DeclarePlayers;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;
with Players[0] do
begin
Name:='';
Pass:='';
BoxRewards:=['xp','xp','lamp'];
LampSkill:=SKILL_ATTACK;
Pin:='';
Active:=true;
end;
end;
function InArea(Pt1, Pt2:TPoint): Boolean; // Look If In Specific Area
var // Credits to Mat's InArea function
Loc: TPoint;
Box: TBox;
Begin
Loc := SPS_GetMyPos;
Box := PointToBox(Pt1, Pt2);
If (PointInBox(Loc, Box)) then
Begin
Result := True
End else
Begin
Result := False;
End;
If Debug then
WriteLn(Result);
End;
procedure Compass; // Set The Compass To North
Begin
ClickNorth(SRL_ANGLE_NONE);
End;
procedure Antiban; // Antiban Procedure
Begin
Case Random(400) of
20: Begin RandomRClick; End;
40: Begin Wait(2500 + Random(4500)) End;
60: Begin PickUpMouse; End;
80: Begin HoverSkill('Mining', False); End;
100: Begin Boredhuman; End;
120: Begin RandomMovement; End;
140: Begin ExamineInv; End;
160: Begin HoverSkill('Random', False); End;
End;
End;
procedure LoadDTM(Choice:Integer); // Load The Dtms According To The Location (Hogs Memory)
Begin
Case Choice of
0: Begin // Rimmington Area Coordinates
DTM_TelePort := DTMFromString('mlwAAAHicY2dgYOBhZGCQBNISQHwQyF4ExOVAdi+Qfg2k44F0NpBuAuJoIDsMSIcC8YHJTQwnN81m2LmoC0w/ubiLQUxBlUFcUZXBiAFiJjbMiAdDAQBpJhHL');
DTM_LodeStone := DTMFromString('m1gAAAHic42JgYLBlYmAwBWIzILYGYjsgdgNidyB2RhKTYGRgEANiKSCWB2IFIJYGYnEgFgBifiDmA2I5GX2Gtjk3CGIuoN3EYEYiMQIAAFl2Fho=');
DTM_GateRoom := DTMFromString('mrAAAAHic42BgYBBmZGDgBGJZIJYGYi4g5oayQXKaQKwIxcZAbAKVA2EZEJaWYzh55RYYr95xiGHz/hMM8o49DLwmGQzXtnAyiADt4MKDGQlgGAAAh0IPAA==');
If Debug then
WriteLn('Selecting Rimminton Area For Mining operation');
End;
1: Begin // Varrock Area Coordinates
DTM_TelePort := DTMFromString('mlwAAAHicY2dgYOBhZGCQBNISQHwQyF4ExOVAdi+Qfg2k44F0NpBuAuJoIDsMSIcC8YHJTQwnN81m2LmoC0w/ubiLQUxBlUFcUZXBiAFiJjbMiAdDAQBpJhHL');
DTM_LodeStone := DTMFromString('m1gAAAHic42JgYLBlYmAwBWIzILYGYjsgdgNidyB2RhKTYGRgEANiKSCWB2IFIJYGYnEgFgBifiDmA2I5GX2Gtjk3CGIuoN3EYEYiMQIAAFl2Fho=');
DTM_GateRoom := DTMFromString('mggAAAHicY2NgYIhkZGDwA+IUIE4C4kAgjgDiJ0C5G1D8BojfAfEXIHZ3c2doiTZlmJtpzjC/2ILhULkZw9m1PgwiQDkuLJgRB4YAAOmlD3U=');
Path := [Point(196, 221), Point(190, 274), Point(174, 314), Point(174, 375), Point(132, 402), Point(130, 421)];
If Debug then
WriteLn('Selecting Varrock Area For Mining operation');
End;
4: Begin // Varrock Area Coordinates
DTM_TelePort := DTMFromString('mlwAAAHicY2dgYOBhZGCQBNISQHwQyF4ExOVAdi+Qfg2k44F0NpBuAuJoIDsMSIcC8YHJTQwnN81m2LmoC0w/ubiLQUxBlUFcUZXBiAFiJjbMiAdDAQBpJhHL');
DTM_LodeStone := DTMFromString('m1gAAAHic42JgYLBlYmAwBWIzILYGYjsgdgNidyB2RhKTYGRgEANiKSCWB2IFIJYGYnEgFgBifiDmA2I5GX2Gtjk3CGIuoN3EYEYiMQIAAFl2Fho=');
DTM_GateRoom := DTMFromString('mggAAAHicY2NgYIhkZGDwA+IUIE4C4kAgjgDiJ0C5G1D8BojfAfEXIHZ3c2doiTZlmJtpzjC/2ILhULkZw9m1PgwiQDkuLJgRB4YAAOmlD3U=');
Path := [Point(196, 221), Point(190, 274), Point(174, 314), Point(174, 375), Point(132, 402), Point(130, 421)];
If Debug then
WriteLn('Selecting Varrock Area For Mining operation');
End;
End;
End;
procedure ReleaseDTM; // Free The Dtms According To The Location (Free Memory)
Begin
FreeDTM(DTM_TelePort);
FreeDTM(DTM_LodeStone);
FreeDTM(DTM_GateRoom);
If Debug then
WriteLn('Freeing DTM`s From The Memory');
End;
Procedure UniversalWalker(Choice:Integer;Walk:String);
Begin
Case Choice of
0: Begin // Rimmington Area Coordinates
If Debug then
WriteLn('Selecting Rimminton Area For Mining operation');
Case LowerCase(Walk) of
'gateroom':
Begin
Info := 'Arriving At Port Sarim Gate Room, Walking To Rimmington Mine';
If Debug then
WriteLn('Selecting Rimminton Mining Path');
ABoxLH := Point(260, 260); // Left Top Coordinates For TPoint
ABoxRL := Point(300, 300); // Right Lower Coordinates For TPoint
end;
'bank':
Begin
Info := 'Walking To Port Sarim Deposito Box';
If Debug then
WriteLn('Selecting Port Sarim Deposito Box Path');
Path := [Point(286, 277), Point(332, 274), Point(331, 218), Point(378, 205), Point(407, 205)];
ABoxLH := Point(382, 186);
ABoxRL := Point(427, 210);
DP := Point(407, 205); // Destination Point - Failsafe For SPS Blindwalk
If Debug then
WriteLn('Comming From Gate Room, On Our Way To The Deposito Box');
end;
'mining':
Begin
Info := 'Walking From Port Sarim Gate Room To Rimmington Mining Area';
If Debug then
WriteLn('Selecting Rimminton Mining Path');
Path := [Point(277, 287), Point(222, 267), Point(169, 248), Point(115, 247), Point(122, 192)];
ABoxLH := Point(73, 152);
ABoxRL := Point(164, 234);
DP := Point(122, 192);
If Debug then
WriteLn('Walking From Port Sarim Gate Room To Rimmington Mining Area');
end;
End;
End;
1: Begin // Varrock West Area Coordinates
If Debug then
WriteLn('Selecting Varrock West Area For Mining operation');
Case lowercase(Walk) of
'gateroom':
Begin
Info := 'Arriving At Varrock Gate Room, Walking To Varrock West Mine';
If Debug then
WriteLn('Arriving At Varrock ,Going To The Mining Location Varrock West');
ABoxLH := Point(151, 351);
ABoxRL := Point(188, 383);
end;
'bank':
Begin
Info := 'Walking From Varrock West Mine To Varrock East Bank';
Path := [Point(43, 413), Point(64, 398), Point(91, 390), Point(117, 382), Point(140, 379), Point(163, 364), Point(170, 338), Point(176, 319), Point(198, 318), Point(219, 317), Point(243, 316), Point(260, 303), Point(264, 280), Point(285, 274), Point(291, 251), Point(294, 229), Point(293, 208), Point(289, 190), Point(292, 170), Point(312, 168), Point(329, 174), Point(329, 197)];
WriteLn(Path);
ABoxLH := Point(299, 165);
ABoxRL := Point(360, 230);
DP := Point(329, 197);
If Debug then
WriteLn('Comming From Varrock West Mine,Making A Deposit At The East Bank');
end;
'mining':
Begin
Info := 'Walking From Varrock East Bank to Varrock West Mine';
Path := [Point(174, 375), Point(123, 383), Point(78, 402), Point(51, 405)];
ABoxLH := Point(2, 356);
ABoxRL := Point(74, 437);
DP := Point(51, 405);
If Debug then
WriteLn('Comming From Varrock East Bank, On Our Way To Varrock West Mine');
end;
End;
End;
4: Begin // Varrock East Area Coordinates
Path := [Point(173,378),Point(199,377),Point(224,375),Point(254,377),Point(275,386),Point(303,396),Point(328,403),Point(359,410),Point(387,411),Point(416,406),Point(442,399),Point(460,405),Point(463,427)];
If Debug then
WriteLn('Selecting Warrock East Area For Mining operation');
Case lowercase(Walk) of
'gateroom':
Begin
Info := 'Arriving At Varrock Gate Room, Walking To Varrock East Mine';
If Debug then
WriteLn('Arriving At Varrock ,Going To The Mining Location Varrock East');
ABoxLH := Point(151, 351);
ABoxRL := Point(188, 283);
end;
'bank':
Begin
Info := 'Walking From Varrock West Mine To Varrock East Bank';
Path := [Point(463, 431), Point(459, 415), Point(473, 403), Point(487, 387), Point(492, 365), Point(491, 343), Point(490, 318), Point(491, 293), Point(493, 268), Point(485, 250), Point(471, 235), Point(471, 213), Point(468, 191), Point(454, 174), Point(433, 165), Point(417, 166), Point(399, 166), Point(373, 167), Point(355, 167), Point(329, 169), Point(329, 199)];
ABoxLH := Point(299, 165);
ABoxRL := Point(360, 230);
DP := Point(329, 199);
If Debug then
WriteLn('Comming From Varrock West Mine,Making A Deposit At The East Bank');
end;
'mining':
Begin
Info := 'Walking From The Gate Room To Varrock East Mine';
Path := [Point(180, 373), Point(199, 374), Point(221, 369), Point(242, 368), Point(262, 375), Point(282, 386), Point(303, 390), Point(322, 393), Point(345, 396), Point(368, 399), Point(389, 401), Point(410, 401), Point(434, 397), Point(454, 402), Point(462, 429)];
ABoxLH := Point(424, 397);
ABoxRL := Point(497, 474);
DP := Point(462, 429);
If Debug then
WriteLn('Comming From Varrock East Bank, On Our Way To Varrock East Mine');
end;
End;
End;
End;
End;
procedure PathWalker; // Universal SPS Path Walker
var
FailSafeTime: Integer;
Begin
If(not(loggedin))then
Exit;
Disguise(Info);
If Debug then
WriteLn(Info);
If not FindNormalRandoms then
Begin
If Not LoggedIn Then
Begin
Writeln('Found unsolvable random');
NextPlayer(False);
End;
End;
Compass; // Set Compass North For Walking
FFlag(10); // Flag Distance
Writeln('going for a walk now');
writeln(path);
MarkTime(FailSafeTime); // Setting Failsafe Timer
// First Walk Procedure With First Failsafe from MarkedTime
If not(InArea(ABoxLH,ABoxRL))then // Check If We Are In The Correct Area
Begin
SPS_WalkPath(Path); // If Not, Walk The Path To The Correct Area
While not(InArea(ABoxLH,ABoxRL)) do // Lets Do Something While We Wait To Finish Our Walk
Begin
Antiban; // Nice Antiban
Wait(1000); // Static Timer For Antiban
If TimeFromMark(FailsafeTime) > 50000 then // Break Our Of The Infinite Loop If We Are Not At Our Destination Within The Given Time
Begin
Break;
End;
End;
End;
// Second Walk Procedure With Second Failsafe from MarkedTime
If not(InArea(ABoxLH,ABoxRL)) then // Lets Do Our Failsafe Walk If We Are Not In The Correct Area
Begin
Wait(1000);
MarkTime(FailSafeTime);
SPS_BlindWalk(DP); // Lets Go Blindwalking
End;
While not(InArea(ABoxLH,ABoxRL)) do
Begin
If TimeFromMark(FailsafeTime) > 35000 then // Break Out Of Loop If We Are Stuck After A Period Of Time
Begin
If Debug then
WriteLn('We Are Lost Time Ran Out,Resetting Bot From Walking From The Gate Room');
End_Time := GetTimeRunning;
// Lost;
Exit;
End;
End;
End_Time := GetTimeRunning; // How Long Did It Take Us
TotalTime := (End_Time - Start_Time)/1000;
WriteLn(Info + IntToStr(TotalTime) + ' Seconds To Complete');
End;
procedure RimMine; // Walk To Rimmington Mine
Begin
UniversalWalker(Location,'mining'); // Get Coordinates Where We Are Supposed To Go
WriteLn(Path);
Writeln('Going to Rimmington Mine');
PathWalker; // Lets Do The Walking
End;
procedure RimDepBox; // Walk To Port Sarim's Deposito Box
Begin
UniversalWalker(Location,'bank');
WriteLn(Path);
Writeln('Going to Port Sarim Deposito Box');
PathWalker;
End;
procedure VarWMine; // Walk To Varrock East Mine
Begin
UniversalWalker(Location,'mining');
WriteLn(Path);
Writeln('Going to Varrock West Mine');
PathWalker;
End;
procedure VarEBank; // Walk To Varrock East Bank
Begin
UniversalWalker(Location,'bank');
WriteLn(Path);
Writeln('From Varrock Mine To Bank');
PathWalker;
End;
procedure VarEMine; // Walk To Varrock West Mine
Begin
UniversalWalker(Location,'mining');
WriteLn(Path);
Writeln('Going to Varrock East Mine');
PathWalker;
End;
procedure GateRoom; // Off World Activities
var
x, y, TempTime:Integer;
Begin
Disguise('Going To The Gate Room');
Start_Time := GetTimeRunning;
UniversalWalker(Location,'gateroom');
LoadDTM(Location);
If not(InArea(ABoxLH,ABoxRL))then
Begin
FTab(tab_Magic);
While not(FindDTM(DTM_TelePort, x, y, MSX1, MSY1, MSX2, MSY2)) do
Begin
If FindDTM(DTM_LodeStone, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
Mouse(x, y, 1, 1, mouse_left);
Wait(Randomrange(700, 1000));
End;
End;
While FindDTM(DTM_TelePort, x, y, MSX1, MSY1, MSX2, MSY2) do
Begin
If FindDTM(DTM_GateRoom, x, y, MSX1, MSY1, MSX2, MSY2) then
Begin
Mouse(x, y, 1, 1, mouse_left);
Wait(Randomrange(700, 1000));
End;
End;
ReleaseDTM;
End;
While Not(InArea(ABoxLH,ABoxRL)) do
Begin
Wait(100);
If (TimeFromMark(TempTime) > 50000) Then
Begin
If FindSymbol(x, y, 'portal') then
Begin
Exit;
end else
Begin
// Lost;
Exit;
End;
End;
End;
End;
procedure MainLoop; // Here Is Where It All Are Called Into The Light
var
I: Integer;
Param: TVariantArray;
ArrayOfActivity: TStringArray;
ArrayOfChoices: TVariantArray;
Begin
Case Location of
0: Begin // Rimmington
ArrayOfActivity := ['RimMine', 'GateRoom', 'RimDepBox', 'GateRoom'];
If Debug then
WriteLn('Excecuting Rimmington Mining operation');
End;
1: Begin // Varrock West
ArrayOfActivity := ['VarWMine', 'VarEBank', 'GateRoom'];
If Debug then
WriteLn('Excecuting Varrock Mining operation');
End;
4: Begin // Varrock East
ArrayOfActivity := ['VarEMine', 'VarEBank', 'GateRoom'];
If Debug then
WriteLn('Excecuting Varrock East Mining operation');
End;
End;
SetLength(ArrayOfChoices, Length(ArrayOfActivity)); // Load Procedures
If (TotalLoads = LoadsToDo) Then // Check If We Have Reached Our Target
Begin
If not FindNormalRandoms then
Begin
If Not LoggedIn Then
Begin
If Debug then
Writeln('Found unsolvable random');
NextPlayer(False); // If Target Reached Exit Script
End;
End;
GateRoom;
LogOut;
TerminateScript;
End else
Begin
TripStart := GetTimeRunning;
For I := 0 To High(ArrayOfActivity) Do // Call Each Procedure That Must Be Done From The Proc Array
Begin
If LostMyWay then // If We Are Lost, Break Out Of The Loop
Begin
TripEnd := GetTimeRunning;
TripTotal := (TripEnd - TripStart);
If Debug then
WriteLn('Mining Ore And Banking It Took ' + IntToStr(TripTotal) + ' To Complete');
Exit;
End;
ArrayOfChoices[I] := CallProc(ArrayOfActivity[I], Param); // Lets Call The Procedure
End;
TripEnd := GetTimeRunning;
TripTotal := (TripEnd - TripStart);
If Debug then
WriteLn('Mining Ore And Banking It Took ' + IntToStr(TripTotal) + ' To Complete');
End;
End;
procedure SetupClient; // Setup Client For Run
Begin
If Debug then
WriteLn('Start Bot Client');
SRL_SIXHOURFIX := True;
SMART_FIXSPEED := True;
Setupsrl;
SRL_EnableNavBar;
Objdtm_Setup;
DeclarePlayers;
If not (loggedin) then
Begin
LoginPlayertoLob;
OpenWorldScreen;
SelectWorld(Server);
LoginPlayer;
Wait(4000+Random(400));
End;
Case Location of // Which Map Should We Use To Walk?
0: Begin // Rimmington Area Coordinates
SPS_Setup(RUNESCAPE_OTHER,['rimmington']);
If Debug then
WriteLn('Selecting Rimminton Area For Mining operation');
End;
1: Begin // Varrock West Area Coordinates
SPS_Setup(RUNESCAPE_OTHER,['varrockmining']);
If Debug then
WriteLn('Selecting Varrock Area For Mining operation');
End;
4: Begin // Varrock East Area Coordinates
SPS_Setup(RUNESCAPE_OTHER,['varrockmining']);
If Debug then
WriteLn('Selecting Varrock Area For Mining operation');
End;
End;
End;
Begin // Begin Main Loop
SetupClient;
Compass;
SetAngle(srl_angle_high);
TotalBTime := (HoursToBreak * 60000); // Set Timers For Breaks
TotalPTime := (HoursToPlay * 60000);
BreakTimes := TotalPTime / (HoursToBreak * 60000);
WriteLn(BreakTimes);
ToggleXPBar(True);
MineFirstRun := True; // This Is The First Run For The Mining
GateRoom; // Teleport In To Mining Area
Repeat
LostMyWay := False; // Set Failsafe Lost As False
MainLoop; // Main Loop
Until allplayersinactive;
End.