Code:
Program WalkFromStartToDwarven;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
label RepeatEverythingFromBurthorpe;
var
WalkToGatePath:TPointArray;
FromLodestoneToMineEntrancePath:TPointArray;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; // Player username
Pass := ''; // Player password
BoxRewards := ['XP', 'ostume', 'mote', 'oins', 'une', 'ssence'];
LampSkill := Skill_Mining;
Active := True;
end;
end;
Procedure StartLogin;
begin
ClearDebug;
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
DeclarePlayers;
LoginPlayer;
end;
Procedure WalkToGate;
begin
SPS_WalkPath(WalkToGatePath);
Writeln('Walked to the gate. Waiting for 4 seconds.');
Wait(4000);
end;
Procedure OpenGate;
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['Open Gate'], [3622483, 3094077], 3)
then
begin
Writeln('Gate found. Clicking.');
ClickMouse(x, y, mouse_Left);
Writeln('OK, clicked on the gate. Waiting for 12 seconds for the process to finish...');
Wait(12000);
end
else Writeln('Gate not found, is it already open? Checking...');
if FindObjCustom(x, y, ['Close Gate'], [3622483, 3094077], 3)
then begin Writeln('Gate is already open! Continuing with walking.')
Exit;
end
else
Writeln('Something might have gone wrong, no gate in sight, neither open or closed. Teleporting back to Burthorpe.');
LodestoneTeleport('Burthorpe');
end;
Procedure HideWheelOfFortune;
begin
MoveMouse(658,285);
ClickMouse(658, 285, mouse_Left);
end;
Procedure TurnToMakeGateOpenScriptWork;
begin
KeyDown(37);
wait(1000);
KeyUp(37);
wait(3000);
end;
Procedure ActivateLodestone;
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['Act', 'Fal'], [7371393], 3) then
begin
Mouse(x,y,2,2,true);
ClickMouse(x, y, mouse_Left);
Wait(20000);
Exit;
end
else begin
Writeln('Oh noes, what happened? No lodestone in sight... Is it already activated?');
//LodestoneTeleport('Burthorpe'); //In case you need one, here is a failsafe you can use.
end;
end;
Procedure FromLodestoneToMineEntrance;
begin
SPS_WalkPath(FromLodestoneToMineEntrancePath);
Writeln('Walked to the mine entrance. Waiting for 15 seconds.');
Wait(15000);
end;
Procedure RadWalkFromGateToLodestone;
begin
RadialWalkTolerance(4612971,0,90,70,1,1,10);
RadialWalkTolerance(4612971,40,90,70,1,1,10);
RadialWalkTolerance(4612971,40,90,70,1,1,10);
RadialWalkTolerance(9589358,0,360,70,1,1,5);
end;
Procedure EnterMine;
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['Cli', 'Lad'], [3630462, 2183788], 10)
then begin Mouse(x,y,2,2,true);
ClickMouse(x, y, mouse_Left);
Wait(10000);
Exit;
end
else begin Writeln('Now where is that ladder? Firing up failsafe!');
LodestoneTeleport('Falador');
end;
end;
Procedure setglobals;
begin
SPS_Setup(RUNESCAPE_SURFACE,['7_5', '7_6', '7_7', '8_5', '8_6', '8_7', '9_6', '9_7']);//SPS Areas
WalkToGatePath := [Point(3380, 2443), Point(3398, 2473), Point(3429, 2472), Point(3477, 2473), Point(3474, 2517), Point(3470, 2565), Point(3468, 2611), Point(3472, 2616), Point(3478, 2624), Point(3481, 2675), Point(3484, 2721), Point(3488, 2758), Point(3486, 2790), Point(3488, 2840), Point(3544, 2841)];
FromLodestoneToMineEntrancePath := [Point(3669, 2960), Point(3694, 2942), Point(3730, 2925), Point(3750, 2896), Point(3770, 2872), Point(3797, 2872), Point(3834, 2863), Point(3859, 2810)];
end;
procedure test;
begin
goto RepeatEverythingFromBurthorpe
end;
begin
SRL_SixHourFix := True;
SetupSRL;
StartLogin;
setglobals;
HideWheelOfFortune;
RepeatEverythingFromBurthorpe:
WalkToGate;
TurnToMakeGateOpenScriptWork;
OpenGate;
RadWalkFromGateToLodestone;
ActivateLodestone;
FromLodestoneToMineEntrance;
EnterMine;
end.