SRL Archive - Test corner

Multi-Quester


tehq

2012-07-16 01:26:21

An extension to the public version; I will be updating and adding more quests in the Members section only.

To do:
  • Cut down global variables (Done).
  • Finish editing (+/- 400 lines)
  • Compatability with latest Simba/SMART (Done).
  • Testing & more quests

For now,

program TehQuest_BETA;
{ V. BETA }
{$DEFINE SMART} { }
{$DEFINE SRL5}
{$i SRL/srl.simba}
{$i sps/sps.simba}

const
METHOD = 'walking'; { walking or teleport - Only for RuneMysteries }
QUEST = 'RuneMysteries'; { RuneMysteries or RestlessGhost }
SERVER = 0;
LONGDEBUG = true; {true to save log through whole quest, false to constantly update}

var
TeleportDTM, TeleLDTM, DukeDTM, AcceptDTM, ThroughDTM, sx, sy, X, Y,
DoorClosedDTM, DoorOpenDTM, QuestsDTM, HeadWizardDTM, Found,
WizDoor1Open, WizDoor1Closed, WizDoor2Open, WizDoor2Closed,DungeonDTM,
WizStair1DTM, WizDoor3Closed, CertDTM, CoffinClosed, CoffinOpen,OwnerDTM,
SentDTM, OO, WO, FO, AO, GO, GO2, FS, ContinueDTM, YesTeleDTM,
Teh, BobDTM, PickDTM, FatherDTM, Father2DTM, WoodsDoor, FO2, AmmyDTM, GhostDTM,
RocksDTM, SkullDTM, Continue2DTM, BonesDTM, All: integer;

aFound: Extended;
Status: string;

Procedure DeclarePlayers;

begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
BoxRewards := ['amp'];
LampSkill := SKILL_ATTACK;
Pin := '';
Active := True;
end;
end;

Procedure Run;
begin
Smart_Members := True;
Smart_Server := Server; //changing
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Wait(500 + Random(200));
if FindNormalRandoms or FindNonInventoryRandoms then
Exit;
ClickNorth(SRL_ANGLE_HIGH);
SetRun(True);
SPS_Setup(RUNESCAPE_SURFACE, ['10_9','10_8','10_7','11_7','11_9','12_9','11_10','10_10','12_7','11_8']);
end;

Procedure ResetAll;
begin
All := 0;
end;

Procedure IncAll;
begin
Inc(All);
end;

Procedure ToTower;
var
WalkToTower: TPointArray;
begin
WalkToTower := [Point(4664, 3819), Point(4679, 3819), Point(4694, 3801), Point(4695, 3788), Point(4721, 3784), Point(4739, 3783), Point(4774, 3795), Point(4780, 3842), Point(4809, 3888), Point(4793, 3944), Point(4766, 3985), Point(4730, 4035), Point(4670, 4043), Point(4613, 4044), Point(4556, 4042), Point(4511, 4012), Point(4476, 3967), Point(4457, 3920), Point(4424, 3878), Point(4384, 3840), Point(4337, 3813), Point(4292, 3825), Point(4289, 3884), Point(4289, 3941), Point(4271, 3988)];
if SPS_WalkPath(WalkToTower) then
Status := 'Walked to Wizards Tower'
else begin
Status := 'Failed walking to Wizards Tower';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToGrave;
var
Grave1: TPointArray;
Grave2: TPoint;
begin
Grave1 := [Point(4798, 3823), Point(4780, 3825), Point(4780, 3835), Point(4798, 3868), Point(4813, 3880)];
if SPS_WalkPath(Grave1) then
Status := 'Walking to the Grave';
Wait(1000 + RandomRange(-200, 800));
Grave2 := Point(4828, 3888);
if SPS_WalkToPos(Grave2) then
Status := 'Going to exact tile at the Grave';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToMine;
var
WalkMine: TPointArray;
begin
WalkMine := [Point(4815, 3891), Point(4802, 3926), Point(4791, 3980), Point(4782, 4022), Point(4781, 4073)];
if SPS_WalkPath(WalkMine) then
Status := 'Walked to the Mine in the Swamp'
else begin
Status := 'Failed walking to the Mine in the Swamp';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
Wait(1000 + RandomRange(-500, 700));
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToVarrock;
var
WalkToVarrock: TPointArray;
begin
WalkToVarrock := [Point(4723, 3788), Point(4763, 3782), Point(4764, 3738), Point(4764, 3682), Point(4760, 3627), Point(4792, 3570), Point(4789, 3509), Point(4790, 3449), Point(4790, 3393), Point(4796, 3333), Point(4749, 3299), Point(4736, 3241), Point(4707, 3196), Point(4684, 3145), Point(4683, 3095), Point(4734, 3091), Point(4785, 3095), Point(4837, 3090), Point(4846, 3051)];
if SPS_WalkPath(WalkToVarrock) then
Status := 'Walked to Aubury in Varrock'
else begin
Status := 'Failed walking to Aubury in Varrock';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure RocksToGrave;
var
Back2Grave: TPointArray;
Grave2: TPoint;
begin
Back2Grave := [Point(4792, 4059), Point(4796, 4025), Point(4795, 3982), Point(4804, 3936), Point(4813, 3902), Point(4830, 3890)];
if SPS_WalkPath(Back2Grave) then
begin
Status := 'Went back to the Grave';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end else
begin
Status := 'Failed going back to the Grave';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
Wait(1000 + RandomRange(-200, 900));
Grave2 := Point(4828, 3888);
if SPS_WalkToPos(Grave2) then
Status := 'Went to a better position at the Grave'
else begin
Status := 'Failed going to a better position at the Grave';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure BobShop;
var
ToBobs: TPointArray;
IntoBob: TPoint;
begin
ToBobs := [Point(4727, 3784), Point(4775, 3799), Point(4759, 3847)];
if SPS_WalkPath(ToBobs) then
begin
Status := 'Walked to Bob''s shop';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end else
begin
Status := 'Failed walking to the Bob''s shop';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;

Wait(1000 + RandomRange(-250, 1250));
IntoBob := Point(4751, 3848);

if SPS_WalkToPos(IntoBob) then
Status := 'Movied to a better position in Bob''s shop'
else begin
Status := 'Failed walking to a better position in Bob''s shop';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;

if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToChurch;
var
WalkToChurch: TPointArray;
begin
WalkToChurch := [Point(4728, 3786), Point(4745, 3784), Point(4760, 3785), Point(4771, 3794), Point(4775, 3809), Point(4782, 3820), Point(4800, 3822), Point(4808, 3823)];

if SPS_WalkPath(WalkToChurch) then
Status := 'Walked to the Church'
else begin
Status := 'Failed walking to the Church';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;

if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure WalkToHut;
var
ToHut: TPointArray;
InHut: TPoint;
begin
ToHut := [Point(4799, 3824), Point(4777, 3828), Point(4783, 3840), Point(4783, 3852), Point(4800, 3873), Point(4810, 3893), Point(4800, 3924), Point(4790, 3954), Point(4783, 3967), Point(4761, 4006), Point(4724, 4035), Point(4692, 4044), Point(4665, 4050)];

if SPS_WalkPath(ToHut) then
begin
Status := 'Walked to the Hut in the Swamp';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end else
begin
Status := 'Failed walking to the Hut in the Swamp';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;

InHut := Point(4663, 4067);

if SPS_WalkToPos(InHut) then
Status := 'Going to a better location in the Hut';
else begin
Status := 'Failed walking to a better location in the Hut';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;

if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure VarrockToShop;
var
ToShop: TPointArray;
begin
ToShop := [Point(4684, 2951), Point(4678, 3006), Point(4682, 3062), Point(4719, 3090), Point(4766, 3094), Point(4813, 3095), Point(4842, 3082), Point(4847, 3047)];
if SPS_WalkPath(ToShop) then
Status := 'Walked to the Magic Shop in Varrock'
else begin
Status := 'Failed walking to the Magic Shop in Varrock';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure CastleToLumby;
var
CastleToLumb: TPointArray;
begin
CastleToLumb := [Point(4667, 3749), Point(4696, 3766), Point(4734, 3784)];
if SPS_WalkPath(CastleToLumb) then
Status := 'Walked out of Lumbridge Castle'
else begin
Status := 'Failed walking out of Lumbridge Castle';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure FindTeleportVarrock;
var
Time: Integer;
begin
TeleportDTM := DTMFromString('mggAAAHicY2NgYOhjZmCYCMTdzBB2F5TfzsjA0ALF3UDcCcUeVuEMzvauDL9//2ZYv/8xg5N8LBjzA83ChhlxYAgAAPXHD1w=');
MarkTime(Time);
repeat
wait(100);
if not Gametab(tab_Magic) then
FTab(tab_Magic);
until FindDTM(TeleportDTM, sx, sy, MIX1, MIY1, MIX2, MIY2) or (TimeFromMark(Time) > 3000);

if (TimeFromMark(Time) > 3000) then
begin
Status := 'Failed Teleporting to Varrock';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
begin
MMouse(sx, sy, 7, 7);
Case Random(2) of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Cas', 'Cast', 'ast', 'as'], 1000);
end;
end;
Status := 'Teleported to Varrock';
Wait(7000);
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning); //change from static wait
FreeDTM(TeleportDTM);
end;

Procedure FindTeleportLumby;
var
Time: Integer;
begin
TeleLDTM := DTMFromString('mlwAAAHicY2dgYGBjYWDgAGIWKAaxuYCYCYjzGRkYiqA4B4rzoXjfkU8MK/c+BeO/f/+CsY9uGhjzA83FhRnxYCgAAB2VEoQ=');
MarkTime(Time);
repeat
wait(50);
if not Gametab(tab_Magic) then
FTab(tab_Magic);
until FindDTM(TeleLDTM, sx, sy, MIX1, MIY1, MIX2, MIY2) or (TimeFromMark(Time) > 3000);

if (TimeFromMark(Time) > 3000) then
begin
Status := 'Failed Teleporting to Lumbridge';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
begin
MMouse(sx, sy, 7, 7);
Case Random(2) of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Cas', 'Cast', 'ast', 'as'], 1000);
end;
end;
Status := 'Teleported to Lumbridge';
Wait(13000);
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning); //change from static wait
FreeDTM(TeleLDTM);
end;





{-----------------------------------------------------------------RUNE MYSTERIES-------------------------------------------------------}




Procedure TalkDuke;
var
Time: Integer;
begin
DukeDTM := DTMFromString('mQwAAAHicY2ZgYKhjZmCoBOImIM5hZGAoA+JyIHZz1GCwjmpmsAirY+AHqoNhRiQMBAD77AXl');
SetAngle(SRL_ANGLE_HIGH);
MarkTime(Time);
repeat
Wait(1);
FindDTMRotatedSE(DukeDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound);
MMouse(x, y, 10, 10);
until WaitUpTextMulti(['Duk', 'uk', 'uke'], 1000) or (TimeFromMark(Time) > 8000);
if WaitUptextMulti(['Duk', 'uk', 'uke'], 1000) then
begin
case Random(2) of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Tal', 'alk', 'uke', 'Duk'], 1000);
end;
end;
end else
begin
Status := 'Failed talking to the Duke'; //failed status
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
Status := 'Talking to the Duke';
FreeDTM(DukeDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ThroughOptions1;
var
Rand, Time: Integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
QuestsDTM := DTMFromString('mlwAAAHicY2dgYLgCxAGMDAzpQLoFiLuA+A4QswHFSoB0MRSXAXE+EFdAaSEZRYbjQcoMh9xEGfgl5RhOnDgBxkJScgz8QHlcmBEPhgIAo30PAw==');
MarkTime(Time);
repeat
Wait(1);
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 1000) then
begin
Rand := Random(3);
Wait(800 + RandomRange(-150, 500));
if (Rand = 2) then
TypeByte(VK_SPACE) //needs work
else begin
MMouse(x, y, 10, 10);

case Rand of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 1500);
end;
end;
end;
end;
until FindDTM(QuestsDTM, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(Time) > 8000);
if (TimeFromMark(Time) > 8000) then
begin
Status := 'Failed to find option to Continue - 1';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found option to Continue - 1';
FreeDTM(ThroughDTM);
FreeDTM(QuestsDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ThroughOptions4;
var
Rand, Time: Integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
MarkTime(Time);
repeat
Wait(1);
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
begin
Rand := Random(3);
Wait(600 + RandomRange(-150, 500));
if (Rand = 2) then
TypeByte(VK_SPACE)
else begin
MMouse(x, y, 10, 10);

case Rand of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 1500);
end;
end;
end;
end;
until (TimeFromMark(Time) > 8000) or DidRedClick; //needs work
if (TimeFromMark(Time) > 8000) then
begin
Status := 'Failed to find option to Continue - 4';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found option to Continue - 4';
FreeDTM(ThroughDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ThroughOptions2;
var
Rand, Time: Integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
AcceptDTM:= DTMFromString('mbQAAAHicY2VgYPjDzMCwF4gtWBgYfjBD8D1GBoa7QHwHiJ8D8WUg5te1ZMgxF2CoshVg6HEUZriZxc/AD9SPjhmxYDAAALrgDL4=');
MarkTime(Time);
repeat
Wait(1);
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
begin
Rand := Random(3);
Wait(600 + RandomRange(-150, 500));
if (Rand = 2) then
TypeByte(VK_SPACE) //needs work
else begin
MMouse(x, y, 10, 10);

case Rand of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 1500);
end;
end;
end;
end;
until FindDTM(AcceptDTM, x, y, MSX1, MSY1, MSX2, MSY2) or (TimeFromMark(Time) > 8000);
if (TimeFromMark(Time) > 8000) then
begin
Status := 'Failed to find option to Continue - 2';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found option to Continue - 2';
FreeDTM(ThroughDTM);
FreeDTM(AcceptDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ThroughOptions3;
var
Rand, Time: integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
HeadWizardDTM := DTMFromString('mbQAAAHicY2VgYGBjYWBYAsSlzAwM34D4CxBPYWJgmAzFfUA8DYiFZBQZ5rnKgvGJEyfAmB+oHx0zYsFgAACE2Q1X');
MarkTime(Time);
repeat
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
begin
Rand := Random(3);
Wait(600 + RandomRange(-150, 500));
if (Rand = 2) then
TypeByte(VK_SPACE) //needs work
else begin
MMouse(x, y, 10, 10);

case Rand of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 1500);
end;
end;
end;
end;
until FindDTM(HeadWizardDTM, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(Time) > 8000);
if (TimeFromMark(Time) > 8000) then
begin
Status := 'Failed to find option to Continue - 3';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found option to Continue - 3';
FreeDTM(ThroughDTM);
FreeDTM(HeadWizardDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure AnyQuests;
begin
QuestsDTM := DTMFromString('mlwAAAHicY2dgYLgCxAGMDAzpQLoFiLuA+A4QswHFSoB0MRSXAXE+EFdAaSEZRYbjQcoMh9xEGfgl5RhOnDgBxkJScgz8QHlcmBEPhgIAo30PAw==');
if WaitFindDTMEx(QuestsDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 1000) then
begin
Status := 'Found option to Continue - Any Quests';
MMouse(X, Y, 10, 10);
case Random(2) of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 1500);
end;
end;
end else
begin
Status := 'Failed to find option to Continue - Any Quests';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(QuestsDTM);
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;






{-------------------------------------- STOPPED EDITING HERE ------------------------------------}





Procedure AcceptQuest;
begin
AcceptDTM:= DTMFromString('mbQAAAHicY2VgYPjDzMCwF4gtWBgYfjBD8D1GBoa7QHwHiJ8D8WUg5te1ZMgxF2CoshVg6HEUZriZxc/AD9SPjhmxYDAAALrgDL4=');
wait(RandomRange(480,530));
if FindDTM(AcceptDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(X, Y, 5, 5, mouse_left);
Writeln('Accepted Quest');
end;
FreeDTM(AcceptDTM);
writeln('' +TimeRunning);
end;

Procedure OpenDoor;

begin
DoorClosedDTM := DTMFromString('mQwAAAHicY2ZgYHBlYmBwY4LQcxkZGFqBeAMQT6xOZFjRVwDG/EB1MMyIhIEAACytB5g=');
DoorOpenDTM := DTMFromString('mQwAAAHicY2ZgYCgA4kggDgHiGUBcAsTzgbinLJZhWU8+GPMD+TDMiISBAAAypged');
SetAngle(SRL_ANGLE_HIGH);
repeat
Inc(Found);
wait(RandomRange(480,530));
if FindDTMRotatedSE(DoorClosedDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(x, y, 5, 5);
until (IsUpText('pen') or (Found=5));

if IsUpText('pen') then
Mouse(x, y, 1, 1, mouse_left);
WriteLn('Opening door');
Wait(RandomRange(1500,1600));
FreeDTM(DoorClosedDTM);
FreeDTM(DoorOpenDTM);
WriteLn('' +TimeRunning);
end;





{-----------------------------------------------------------begin wizard's tower----------------------------------------------------}




Procedure OpenWizDoor1;

begin
WizDoor1Closed := DTMFromString('mggAAAHicY2NgYNjJzMDwCIhnAPEKIL4AxHuA+AgjA8NBID4AxNeA+BYQ3wPiTH89holTZzBMnjaLoThQmSHfT5GhJdmKgR9oFjbMiANDAADFzxEG');
WizDoor1Open := DTMFromString('mWAAAAHicY2FgYPgAxPeAWI8Rwj4AxJOAeApUPDtAn6Fv4lSGabPmMhSGGjLwA8WQMSMaBgEAi5ELWA==');
SetAngle(SRL_ANGLE_HIGH);
Found := 0;
repeat
Inc(Found);
Wait(RandomRange(480,530));
if FindDTMRotatedSE(WizDoor1Closed, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(x, y, 5, 5);
until (IsUpText('pen') or (Found=5));

if IsUpText('pen') then
begin
ClickMouse2(True);
WriteLn('Opening door');
Wait(RandomRange(1500,1600));
end;

if IsUptext('lose') then
WriteLn('Door opened');
FreeDTM(WizDoor1Closed);
FreeDTM(WizDoor1Open);
WriteLn('' +TimeRunning);
end;

Procedure OpenWizDoor2;

begin
WizDoor2Closed := DTMFromString('mbQAAAHicY2VgYDBmYWDgAuIoIHYCYmUgvs3IwHAAiP8D8VMgPgvEpREmDPMXLQPjwlAjhggndQZ+oH50zIgFgwEANNYMPw==');
WizDoor2Open := DTMFromString('mWAAAAHicY2FgYEhjZGCQAuIYILYF4jlAsXYg3gnEu4C4OFCZYf6iZWBcWJjDwA8UQ8aMaBgEAAv6Cfs=');
setangle(SRL_ANGLE_HIGH);
Found :=0;
repeat
Inc(Found);
wait(RandomRange(480,530));
if FindDTMRotatedSE(WizDoor2Closed, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(x, y, 1, 1);
until (IsUpText('pen') or (Found=5));

if IsUpText('pen') then
begin
ClickMouse2(True);
WriteLn('Opening door');
wait(RandomRange(1500,1600));
end;

if IsUptext('lose') then
WriteLn('Door opened');
FreeDTM(WizDoor2Closed);
FreeDTM(WizDoor2Open);
WriteLn('' +TimeRunning);
end;

Procedure WalkToDoor2;
var
ToDoor2: TPoint;
begin
SetAngle(SRL_ANGLE_HIGH);
Wait(RandomRange(480,530));
ToDoor2 := (Point(4268, 4011));
SPS_WalkToPos(ToDoor2);
WriteLn('' +TimeRunning);
end;

Procedure FindDung;
begin
DungeonDTM:= DTMFromString('mbQAAAHicY2VgYJBhhWB5IBYHYiUgzmJkYCgA4nwgzgHiDCD+oKUFxgcOHADjv67SDPxA/eiYEQsGAwDFzwuG');
if FindDTMRotatedSE(DungeonDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound) then
Mouse(x, y, 5, 5, mouse_left);
FreeDTM(DungeonDTM);
WriteLn('' +TimeRunning);
end;

Procedure FindWizStairsDown;
begin
WizStair1DTM:= DTMFromString('mrAAAAHic42BgYDBiYWCQAGJJIPYB4iAWhFgAiGZiYNAF4j+MDAx/gVgLyGYAYhEo5uPlZQjyd2dIS0tkyMlJZwjwdWWorcwF45rybAZ+oHJ8mJEAhgEAUZ0NZA==');
SetAngle(SRL_ANGLE_HIGH);
repeat
Wait(RandomRange(480,530));
FindDTMRotatedSE(WizStair1DTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound);
MMouse(x, y, 5, 5);
until IsUpText('dder');
ClickMouse2(True);
WriteLn('Going down ladder');
FreeDTM(WizStair1DTM);
WriteLn('' +TimeRunning);
end;

Procedure ToWizDoor;
begin
SetAngle(SRL_ANGLE_HIGH);
Wait(RandomRange(2500,2700));
if RadialWalkTolerance(394227, 110, 170, 40, 0, 0, 15) then
WriteLn('Walked to Wizard''s door');
WriteLn('' +TimeRunning);
end;

Procedure OpenWizDoor3;
begin
WizDoor3Closed := DTMFromString('mlwAAAHicY2dgYLjEzMBwBYgvAPF5KBuErwHxQ0agPBC/BeLPQHwGiF8A8U0gdrBQBmNPR02GkpxIhrl9GQxOVqpgMX6gubgwIx4MBQCOXBJo');
SetAngle(SRL_ANGLE_HIGH);
Found := 0;
repeat
Inc(Found);
wait(RandomRange(480,530));
if FindDTMRotatedSE(WizDoor3Closed, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(x, y, 5, 5);
until (IsUpText('pen') or (Found = 10));

if IsUpText('pen') then
begin
ClickMouse2(True);
Writeln('Opening door');
wait(RandomRange(1500,1600));
end;

if IsUptext('lose') then
WriteLn('Door opened');
FreeDTM(WizDoor3Closed);
WriteLn('' +TimeRunning);
end;

Procedure FindWizard;
var
TPA : TPointArray;
ATPA : T2DPointArray;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
SetAngle(SRL_ANGLE_HIGH);
repeat
repeat
Wait(RandomRange(480,530));
FindColorsTolerance(TPA, 15577418, MSX1, MSY1, MSX2, MSY2, 15);
ATPA := TPAToATPAEx(TPA, 30, 40);
MMouse(x, y, 5, 5);
until IsUpText('edr');
ClickMouse2(True);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Talking to Wizard');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure HeadWizardOption;
begin
HeadWizardDTM:= DTMFromString('mbQAAAHicY2VgYGBjYWBYAsSlzAwM34D4CxBPYWJgmAzFfUA8DYiFZBQZ5rnKgvGJEyfAmB+oHx0zYsFgAACE2Q1X');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(480, 530));
repeat
Wait(1);
if FindDTM(HeadWizardDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
Mouse(X, Y, 5, 5, mouse_left);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Found Head Wizard Option');
FreeDTM(ThroughDTM);
FreeDTM(HeadWizardDTM);
WriteLn('' +TimeRunning);
end;

Procedure WizOptions;
begin
repeat
Inc(WO);
ThroughOptions4;
until (WO = 14);
WriteLn('' +TimeRunning);
end;

Procedure Certain;
begin
CertDTM := DTMFromString('mggAAAHicY2NgYPjAzMBgxsLAsBBIHwTi40AsAuSnMDEwJENxPBSnAbGQjCLDPFdZMD5x4gQc8wPNwoYZcWAIAADWdg+P');
Wait(RandomRange(800, 900));
if FindDTM(CertDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
WriteLn('Found Text Option. Clicking');
Mouse(X, Y, 5, 5, Mouse_left);
Wait(RandomRange(800, 900));
end;
FreeDTM(CertDTM);
WriteLn('' +TimeRunning);
end;




{------------------------------------------------------begin Varrock-------------------------------------------------------------}




Procedure TalkOwner;
{check}
begin
OwnerDTM := DTMFromString('mggAAAHicY2NgYBBkZGDgB2IhKBYBYgEgVoNiFSDWgLJB9PYN6xk2rV4NxjMmTmRYuWghw7plyxhYgWZhw4w4MAQAAKciDUs=');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
SetAngle(SRL_ANGLE_HIGH);

repeat
repeat
Wait(RandomRange(480, 530));
FindDTMRotatedSE(OwnerDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound);
MMouse(x, y, 5, 5);
until IsUpText('ury');
ClickMouse2(True);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Talking to Aubury');
FreeDTM(OwnerDTM);
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure InsideShop;

var
Shop: TPoint;
begin
SetAngle(SRL_ANGLE_HIGH);
Wait(RandomRange(600,700));
Shop := Point(4846, 3049);
SPS_WalkToPos(Shop);
WriteLn('' +TimeRunning);
end;

Procedure SentHere;

begin
SentDTM := DTMFromString('mggAAAHicY2NgYBBiZGCYA8RZQHYkkG4C0h1AfADI3g/Fe4H4EBDvAmIhGUUGLl5eMD5x4gQc8wP1YMOMODAEAACmoQ8B');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');

repeat
Wait(RandomRange(1400,1500));
if FindDTM(SentDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
WriteLn('Found Text. Clicking ahead');
Mouse(X, Y, 5, 5, Mouse_left);
end;
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
FreeDTM(ThroughDTM);
FreeDTM(SentDTM);
WriteLn('' +TimeRunning);
end;

Procedure OwnerOptions;

begin
repeat
inc(OO);
ThroughOptions4;
until (OO = 7);
WriteLn('' +TimeRunning);
end;

Procedure TeleportWiz;
begin
YesTeleDTM := DTMFromString('mlwAAAHicY2dgYLgDxJOB2JSRgeEQkD4GxM+A+D8QyzIisBQUS0D5QlJyDEFO+gx+9noMJ06cQMGsQL24MCMeDAUAQKoRMw==');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');

repeat
Wait(RandomRange(1400, 1500));

if FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
WriteLn('Found Text. Clicking ahead');
Mouse(X, Y, 5, 5, Mouse_left);
end;
until FindDTM(YesTeleDTM, x, y, MCX1, MCY1, MCX2, MCY2);
FreeDTM(ThroughDTM);
FreeDTM(YesTeleDTM);
WriteLn('' +TimeRunning);
end;

Procedure TeleToWizard;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
begin
repeat
FindNPCChatText('es', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
end;
WriteLn('Teleporting to Wizards Tower');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure TeleToEnd;
begin
OpenWizDoor1;
WalkToDoor2;
OpenWizDoor2;
FindDung;
FindWizStairsDown;
ToWizDoor;
OpenWizDoor3;
FindWizard;
repeat
Inc(Teh);
ThroughOptions4;
until (Teh = 27);
end;

Procedure Ending;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY'); {28 options to finish quest}
ContinueDTM:= DTMFromString('mbQAAAHicY2VgYNjHwsDQC8VJQPwAiLcwMTBsBeINQLwJivkM7BgenzkPxqvCxBgWBYgw8AP1o2NGLBgMAPxUDp8=');
Wait(RandomRange(1400, 1500));
repeat

if FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
WriteLn('Found Text. Clicking ahead');
Mouse(X, Y, 5, 5, Mouse_left);
end;
until FindDTM(ContinueDTM, x, y, MSX1, MSY1, MSX2, MSY2);
FreeDTM(ThroughDTM);
FreeDTM(ContinueDTM);
WriteLn('' +TimeRunning);
end;

Procedure FinishQuestRM;
begin
ContinueDTM:= DTMFromString('mbQAAAHicY2VgYNjHwsDQC8VJQPwAiLcwMTBsBeINQLwJivkM7BgenzkPxqvCxBgWBYgw8AP1o2NGLBgMAPxUDp8=');
Wait(RandomRange(480, 530));
if FindDTM(ContinueDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, 5, 5, mouse_left);
FreeDTM(ContinueDTM);
WriteLn('' +TimeRunning);
end;

Procedure FinishQuestRG;
begin
Continue2DTM := DTMFromString('mWAAAAHicY2FgYAhjZGC4D6TvAOkoIM5jYmDIAOIsIE4GYj4DO4ZlEbIMiwJEGB6fOc8AAiJQDAKMaBgEAAajCWU=');
Wait(RandomRange(480, 530));
if FindDTM(Continue2DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, 5, 5, mouse_left);
FreeDTM(Continue2DTM);
WriteLn('' +TimeRunning);
end;

Procedure FindBob;
begin
SetAngle(SRL_ANGLE_HIGH);
BobDTM := DTMFromString('mbQAAAHicY2VgYKhjZmCoAeIGKAaxcxkZGPKAuACIc4A4G4jtbW0YrCzMGdws9RnMTU3BfFagfnTMiAWDAQBfxAg4');
PickDTM := DTMFromString('mlwAAAHicY2dgYNAGYhkgdgNidyjbFIiNgNgDiFOA2ARKg8SjgDgRiD3NFRg0lWUYxIUF4fT//wxgzM+AGzPiwVAAAGnLCeU=');
repeat
repeat
Wait(RandomRange(480, 530));
FindDTMRotatedSE(BobDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound);
MMouse(x, y, 5, 5);
until IsUpText('ob');
ClickMouse2(False);
Wait(RandomRange(480, 530));
ChooseOption('rade');
until FindDTM(PickDTM, x, y, MSX1, MSY1, MSX2, MSY2);
WriteLn('Trading with Bob');
FreeDTM(BobDTM);
FreeDTM(PickDTM);
WriteLn('' +TimeRunning);
end;

Procedure GetPick;
begin
PickDTM := DTMFromString('mlwAAAHicY2dgYNAGYhkgdgNidyjbFIiNgNgDiFOA2ARKg8SjgDgRiD3NFRg0lWUYxIUF4fT//wxgzM+AGzPiwVAAAGnLCeU=');
Wait(RandomRange(1000, 1100));
if FindDTM(PickDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(X, Y, 5, 5, mouse_right);
Wait(RandomRange(480, 530));
ChooseOption('1');
end;
WriteLn('Free pickaxe');
FreeDTM(PickDTM);
WriteLn('' +TimeRunning);
end;


{END EDITS}

{---------------------------------------------------------RESTLESS GHOST------------------------------------------------------------}




Procedure WalkToFather;
var
Father: TPoint;
begin
SetAngle(SRL_ANGLE_HIGH);
Wait(RandomRange(1500, 1600));
Father := Point(4811, 3834);
SPS_WalkToPos(Father);
WriteLn('' +TimeRunning);
end;

Procedure FindFather;
begin
FatherDTM := DTMFromString('mLgAAAHicY2IAAkYI/gCkvgBxTOpSBm0dfQYuIJsLIQ0EAGxHA+s=');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
SetAngle(SRL_ANGLE_HIGH);
repeat
repeat
Wait(RandomRange(480,530));
FindDTMRotatedSE(FatherDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound); //atpa
MMouse(x, y, 5, 5);
until IsUpText('ath');
ClickMouse2(True);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2)
WriteLn('Talking to Father');
FreeDTM(FatherDTM);
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure GhostQuest;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('uest', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Begin quest option');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure FatherOptions;
begin
FO := 0;
repeat
Inc(FO);
ThroughOptions4;
until (FO = 7);
WriteLn('' +TimeRunning);
end;

Procedure HutDoor;
begin
WoodsDoor := DTMFromString('mQwAAAHicY2ZgYPgPxBeAWJORgeEakH4AxI+BOD85lOF+vQ7D1UptBmYgXwSKGZEwEAAAhDEI7g==');
setangle(SRL_ANGLE_HIGH);
Found := 0;
repeat
Inc(Found);
Wait(RandomRange(480, 530));
if FindDTMRotatedSE(WoodsDoor, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(x, y, 5, 5);
until (IsUpText('pen') or (Found=5));

if IsUpText('pen') then
begin
ClickMouse2(True);
WriteLn('Opening door');
Wait(RandomRange(1500,1600));
end;

if IsUptext('lose') then
WriteLn('Door opened');
FreeDTM(WoodsDoor);
WriteLn('' +TimeRunning);
end;

Procedure FindUrh;
begin
Father2DTM := DTMFromString('mbQAAAHicY2VgYFBgZGCQA2IlRgT7H1CcgRGB/wKpnWsXMKxfMp2ht6UKTJ/cs46BFSiOjhmxYDAAAPYeDF0=');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
SetAngle(SRL_ANGLE_HIGH);
repeat
repeat
Wait(RandomRange(480, 530));
FindDTMRotatedSE(Father2DTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound);
MMouse(x, y, 5, 5);
until IsUpText('athe');
ClickMouse2(True);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2)
WriteLn('Talking to Urhney');
FreeDTM(Father2DTM);
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure AboutQuest;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('alk', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('The Father from Lumbridge sent me');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure Ghosts;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('host', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Ghosts are haunting Lumbridge!');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure Father2Options;
begin
FO2 := 0;
repeat
Inc(FO2);
ThroughOptions4;
until (FO2 = 10);
WriteLn('' +TimeRunning);
end;

Procedure Ammy;
begin
AmmyDTM := DTMFromString('mggAAAHicY2NgYMhgYmAoAeI0IC4D4goo+zVQ7hYQ3wHiR1D6DRB3NJYyxDnJMgRaSjJ4GIkxRNnLMGyYVcrAD5RDx1xAzIgDQwAAtEMOMQ==');
repeat
Wait(RandomRange(1000, 1100));
Inc(AO);
until (FindDTM(AmmyDTM, x, y, MIX1, MIY1, MIX2, MIY2) or (AO = 5));

if FindDTM(AmmyDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 1, 1);
if WaitUpText('mul', 600) then
ClickMouse2(true);
Writeln('Amulet on');
WriteLn('' +TimeRunning);
end;
Wait(RandomRange(300, 400));
FreeDTM(AmmyDTM);
end;

Procedure FindCoffin;
begin
CoffinClosed := DTMFromString('mggAAAHicY2NgYNBnZGBwAeIQINYDYj8gtgRiBiBmAeLPQOYXBggfRGuqq4CxgpwMg5qKIoOCtCgYswLlsGFGHBgCAFQVBtw=');
CoffinOpen := DTMFromString('mQwAAAHicY2ZgYLgLxGeA+DAQbwPiHUC8HYjFBDgZ2mqLGdrrSxlYgXwuKGZEwkAAAFy8B9E=');
SetAngle(SRL_ANGLE_HIGH);

repeat
Wait(RandomRange(2000, 2100));
if FindDTMRotatedSE(CoffinClosed, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
Mouse(x, y, 5, 5, mouse_left);

if FindDTMRotatedSE(CoffinOpen, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
Mouse(x, y, 5, 5, mouse_left);
until IsUpText('pen');
Mouse(X, Y, 5, 5, mouse_left);
WriteLn('Found coffin');
FreeDTM(CoffinOpen);
FreeDTM(CoffinClosed);
WriteLn('' +TimeRunning);
end;

Procedure TalkToGhost;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
GhostDTM := DTMFromString('mbQAAAHicY2VgYHgIxU+g+BEQ2wGxCRBbAbEhELsBcXxGKsPStcsY8nOTGCbOmMQQn5rIwAoU50LDjFgwGAAApTMNCQ==');
repeat
Wait(RandomRange(1800,1900));
if FindDTMRotatedSE(GhostDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(X, Y, 5, 5);
until WaitUpText('est', 200);
ClickMouse2(True);
FreeDTM(ThroughDTM);
FreeDTM(GhostDTM);
WriteLn('' +TimeRunning);
end;

Procedure ItWorks;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('mule', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Wow, this amulet works!');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure WhyGhost;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('host', clickleft);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Why are you a ghost?');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure GhostOptions1;
begin
GO := 0;
repeat
Inc(GO);
ThroughOptions4;
until (GO = 4);
WriteLn('' +TimeRunning);
end;

Procedure GhostOptions2;
begin
GO2 := 0;
repeat
inc(GO2);
ThroughOptions4;
until (GO2 = 5);
WriteLn('' +TimeRunning);
end;

Procedure FindRocks;
begin
RocksDTM := DTMFromString('mbQAAAHicY2VgYHBmZGAwAWIdIA4BYh8gzgeKJwFxPRBXA3ECEAcG+DHEx0YxxERHMHh5ujN4uLsysALF0TEjFgwGADVmCFk=');
repeat
Wait(RandomRange(480, 530));
FindDTMRotatedSE(RocksDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound);
MMouse(x, y, 5, 5);
until WaitUpText('ock', 800);
ClickMouse2(True);
Writeln('Found skull');
FreeDTM(RocksDTM);
WriteLn('' +TimeRunning);
end;

Procedure FindSkull;
begin
SkullDTM:= DTMFromString('mQwAAAHicY2ZgYHBhYmCwAWI3IL4H5L8C4rdAvHrRFIaju1YBWUwMXEAShhmRMBAAAEMnB7I=');
FS := 0;
repeat
Gametab(tab_inv);
Wait(RandomRange(1000, 1100));
Inc(FS);
until (FindDTM(SkullDTM, x, y, MIX1, MIY1, MIX2, MIY2) or (FS = 5));

if FindDTM(SkullDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 5, 5);
if WaitUpText('kul', 800) then
ClickMouse2(true);
end;
WriteLn('Found Skull');
WriteLn('' +TimeRunning);
Wait(RandomRange(300, 400));
FreeDTM(SkullDTM);
end;

Procedure EndingRG;
begin
Wait(15000 + (random(1000)));
end;

Procedure BuryBones;
begin
SetAngle(SRL_ANGLE_HIGH);
BonesDTM := DTMFromString('mbQAAAHicY2VgYHBmYmCwBmI7IHYDYh8gfgwUfwTEr4H4LhA/AeIgb3OGvsZ4Bj83E4aybH+GvBQvBmagODpmxILBAAAHVQs5');
AO := 0;
repeat
repeat
Gametab(tab_inv);
Wait(RandomRange(1000, 1100));
Inc(AO);
until (FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2));

if FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 1, 1);
if WaitUpText('one', 600) then
ClickMouse2(true);
end;
WriteLn('Bured a bone');
WriteLn('' +TimeRunning);
Wait(RandomRange(300,400));
until (not(FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2)) or (AO = 5));
FreeDTM(BonesDTM);
end;

{loop}
begin
Run;
begin
Case lowercase(Quest) of
'runemysteries':
begin
Case lowercase(Method) of
'walking':
begin
TalkDuke;
ThroughOptions1;
AnyQuests;
ThroughOptions4;
ThroughOptions4;
ThroughOptions2;
AcceptQuest;
FindTeleportLumby;
CastleToLumby;
ToTower;
OpenWizDoor1;
WalkToDoor2;
OpenWizDoor2;
FindDung;
FindWizStairsDown;
ToWizDoor;
OpenWizDoor3;
FindWizard;
ThroughOptions4;
HeadWizardOption;
WizOptions;
Certain;
ThroughOptions4;
ThroughOptions4;
ThroughOptions4;
FindTeleportLumby;
ToVarrock;
InsideShop;
TalkOwner;
SentHere;
OwnerOptions;
TeleportWiz;
TeleToWizard;
ThroughOptions4;
ToTower;
TeleToEnd;
Ending;
FinishQuestRM;
end;

'teleport':
begin
TalkDuke;
ThroughOptions1;
AnyQuests;
ThroughOptions4;
ThroughOptions4;
ThroughOptions2;
AcceptQuest;
FindTeleportLumby;
CastleToLumby;
ToTower;
OpenWizDoor1;
WalkToDoor2;
OpenWizDoor2;
FindDung;
FindWizStairsDown;
ToWizDoor;
OpenWizDoor3;
FindWizard;
ThroughOptions4;
HeadWizardOption;
WizOptions;
Certain;
ThroughOptions4;
ThroughOptions4;
ThroughOptions4;
FindTeleportVarrock;
VarrockToShop;
InsideShop;
TalkOwner;
SentHere;
OwnerOptions;
TeleportWiz;
TeleToWizard;
ThroughOptions4;
ToTower;
TeleToEnd;
Ending;
FinishQuestRM;
end;
end;
end;

'restlessghost':
begin
FindTeleportLumby;
CastleToLumby;
ToChurch;
WalkToFather;
FindFather;
ThroughOptions4;
GhostQuest;
ThroughOptions2;
AcceptQuest;
FatherOptions;
WalkToHut;
HutDoor;
FindUrh;
ThroughOptions4;
AboutQuest;
ThroughOptions4;
Ghosts;
Father2Options;
Ammy;
FindTeleportLumby;
CastleToLumby;
ToGrave;
FindCoffin;
TalkToGhost;
GhostOptions1;
ItWorks;
ThroughOptions4;
WhyGhost;
GhostOptions2;
ToMine;
FindRocks;
RocksToGrave;
FindCoffin;
FindSkull;
FindCoffin;
EndingRG;
FinishQuestRG;
BuryBones;
end;
end;
end;
{FindTeleportLumby;
CastleToLumby;
Bobshop;
FindBob;
GetPick;}
WriteLn('It took: '+(TimeRunning)+' to finish ' +(Quest));
Wait(RandomRange(4000, 4200));
Logout;
TerminateScript;
end.

Update:

program TehQuest_BETA;
{ V. BETA }
{$DEFINE SMART} { }
{$i SRL/srl.simba}
{$i sps/sps.simba}

const
METHOD = 'walking'; { walking or teleport - Only for RuneMysteries }
QUEST = 'RuneMysteries'; { RuneMysteries or RestlessGhost }
SERVER = 0;
LONGDEBUG = true; { true to save log through whole quest / false to constantly update }

var
AcceptDTM, ThroughDTM, X, Y, QuestsDTM, HeadWizardDTM, Found, ContinueDTM, Teh: integer;
aFound: extended; //remove
Status: string;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
BoxRewards := ['amp', 'XP'];
LampSkill := SKILL_ATTACK;
Pin := '';
Active := True;
end;
end;

Procedure Run;
begin
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Wait(500 + Random(200));
if FindNormalRandoms or FindNonInventoryRandoms then
Exit;
ClickNorth(SRL_ANGLE_HIGH);
SetRun(True);
SPS_Setup(RUNESCAPE_SURFACE, ['10_9', '10_8', '10_7', '11_7', '11_9', '12_9', '11_10', '10_10', '12_7', '11_8']);
end;

Procedure ToTower;
var
WalkToTower: TPointArray;
begin
WalkToTower := [Point(4664, 3819), Point(4679, 3819), Point(4694, 3801), Point(4695, 3788), Point(4721, 3784), Point(4739, 3783), Point(4774, 3795), Point(4780, 3842), Point(4809, 3888), Point(4793, 3944), Point(4766, 3985), Point(4730, 4035), Point(4670, 4043), Point(4613, 4044), Point(4556, 4042), Point(4511, 4012), Point(4476, 3967), Point(4457, 3920), Point(4424, 3878), Point(4384, 3840), Point(4337, 3813), Point(4292, 3825), Point(4289, 3884), Point(4289, 3941), Point(4271, 3988)];
if SPS_WalkPath(WalkToTower) then
Status := 'Walked to Wizards Tower.'
else begin
Status := 'Failed walking to Wizards Tower.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToGrave;
var
Grave1: TPointArray;
Grave2: TPoint;
begin
Grave1 := [Point(4798, 3823), Point(4780, 3825), Point(4780, 3835), Point(4798, 3868), Point(4813, 3880)];
Grave2 := Point(4828, 3888);
if SPS_WalkPath(Grave1) then
Status := 'Walked to the Grave.';
Wait(1000 + RandomRange(-300, 800));
if SPS_WalkToPos(Grave2) then
Status := 'Fixed position at the Grave.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToMine;
var
WalkMine: TPointArray;
begin
WalkMine := [Point(4815, 3891), Point(4802, 3926), Point(4791, 3980), Point(4782, 4022), Point(4781, 4073)];
if SPS_WalkPath(WalkMine) then
Status := 'Walked to the Mine in the Swamp.'
else begin
Status := 'Failed walking to the Mine in the Swamp.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
Wait(1000 + RandomRange(-500, 700));
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToVarrock;
var
WalkToVarrock: TPointArray;
begin
WalkToVarrock := [Point(4723, 3788), Point(4763, 3782), Point(4764, 3738), Point(4764, 3682), Point(4760, 3627), Point(4792, 3570), Point(4789, 3509), Point(4790, 3449), Point(4790, 3393), Point(4796, 3333), Point(4749, 3299), Point(4736, 3241), Point(4707, 3196), Point(4684, 3145), Point(4683, 3095), Point(4734, 3091), Point(4785, 3095), Point(4837, 3090), Point(4846, 3051)];
if SPS_WalkPath(WalkToVarrock) then
Status := 'Walked to Aubury in Varrock.'
else begin
Status := 'Failed walking to Aubury in Varrock.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure RocksToGrave;
var
Back2Grave: TPointArray;
Grave2: TPoint;
begin
Back2Grave := [Point(4792, 4059), Point(4796, 4025), Point(4795, 3982), Point(4804, 3936), Point(4813, 3902), Point(4830, 3890)];
if SPS_WalkPath(Back2Grave) then
begin
Status := 'Went back to the Grave.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end else
begin
Status := 'Failed going back to the Grave.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
Wait(1000 + RandomRange(-200, 900));
Grave2 := Point(4828, 3888);
if SPS_WalkToPos(Grave2) then
Status := 'Went to a better position at the Grave.'
else begin
Status := 'Failed going to a better position at the Grave.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure BobShop;
var
ToBobs: TPointArray;
IntoBob: TPoint;
begin
ToBobs := [Point(4727, 3784), Point(4775, 3799), Point(4759, 3847)];
if SPS_WalkPath(ToBobs) then
begin
Status := 'Walked to Bob''s shop.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end else
begin
Status := 'Failed walking to the Bob''s shop.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
Wait(1000 + RandomRange(-250, 1250));
IntoBob := Point(4751, 3848);
if SPS_WalkToPos(IntoBob) then
Status := 'Fixed position in Bob''s shop.'
else begin
Status := 'Failed fixing position in Bob''s shop.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToChurch;
var
WalkToChurch: TPointArray;
begin
WalkToChurch := [Point(4728, 3786), Point(4745, 3784), Point(4760, 3785), Point(4771, 3794), Point(4775, 3809), Point(4782, 3820), Point(4800, 3822), Point(4808, 3823)];
if SPS_WalkPath(WalkToChurch) then
Status := 'Walked to the Church.'
else begin
Status := 'Failed walking to the Church.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure WalkToHut;
var
ToHut: TPointArray;
InHut: TPoint;
begin
ToHut := [Point(4799, 3824), Point(4777, 3828), Point(4783, 3840), Point(4783, 3852), Point(4800, 3873), Point(4810, 3893), Point(4800, 3924), Point(4790, 3954), Point(4783, 3967), Point(4761, 4006), Point(4724, 4035), Point(4692, 4044), Point(4665, 4050)];
if SPS_WalkPath(ToHut) then
begin
Status := 'Walked to the Hut in the Swamp.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end else
begin
Status := 'Failed walking to the Hut in the Swamp.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
InHut := Point(4663, 4067);
if SPS_WalkToPos(InHut) then
Status := 'Fixed position in the Hut.'
else begin
Status := 'Failed fixing position in the Hut.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure VarrockToShop;
var
ToShop: TPointArray;
begin
ToShop := [Point(4684, 2951), Point(4678, 3006), Point(4682, 3062), Point(4719, 3090), Point(4766, 3094), Point(4813, 3095), Point(4842, 3082), Point(4847, 3047)];
if SPS_WalkPath(ToShop) then
Status := 'Walked to the Magic Shop in Varrock.'
else begin
Status := 'Failed walking to the Magic Shop in Varrock.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure CastleToLumby;
var
CastleToLumb: TPointArray;
begin
CastleToLumb := [Point(4667, 3749), Point(4696, 3766), Point(4734, 3784)];
if SPS_WalkPath(CastleToLumb) then
Status := 'Walked out of Lumbridge Castle.'
else begin
Status := 'Failed walking out of Lumbridge Castle.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure FindTeleportVarrock;
var
Time, TeleportDTM, Sx, Sy: Integer;
begin
TeleportDTM := DTMFromString('mggAAAHicY2NgYOhjZmCYCMTdzBB2F5TfzsjA0ALF3UDcCcUeVuEMzvauDL9//2ZYv/8xg5N8LBjzA83ChhlxYAgAAPXHD1w=');
MarkTime(Time);
repeat
Wait(100);
if not FTab(tab_Magic) then
FTab(tab_Magic);
until FindDTM(TeleportDTM, Sx, Sy, MIX1, MIY1, MIX2, MIY2) or (TimeFromMark(Time) > 3000);
if (TimeFromMark(Time) > 3000) then
begin
Status := 'Failed teleporting to Varrock.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
begin
MMouse(Sx, Sy, 7, 7);
Case Random(10) of
0..8: ClickMouse2(True);
9:
begin
ClickMouse2(False);
WaitOptionMulti(['Cas', 'Cast', 'ast', 'as'], 1000);
end;
end;
Status := 'Teleported to Varrock.';
Wait(7000); //static wait
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
FreeDTM(TeleportDTM);
end;

Procedure FindTeleportLumby;
var
Time, TeleLDTM, Sx, Sy: Integer;
begin
TeleLDTM := DTMFromString('mlwAAAHicY2dgYGBjYWDgAGIWKAaxuYCYCYjzGRkYiqA4B4rzoXjfkU8MK/c+BeO/f/+CsY9uGhjzA83FhRnxYCgAAB2VEoQ=');
MarkTime(Time);
repeat
Wait(100);
if not FTab(tab_Magic) then
FTab(tab_Magic);
until FindDTM(TeleLDTM, Sx, Sy, MIX1, MIY1, MIX2, MIY2) or (TimeFromMark(Time) > 3000);
if (TimeFromMark(Time) > 3000) then
begin
Status := 'Failed teleporting to Lumbridge.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
begin
MMouse(Sx, Sy, 7, 7);
Case Random(10) of
0..8: ClickMouse2(True);
9:
begin
ClickMouse2(False);
WaitOptionMulti(['Cas', 'Cast', 'ast', 'as'], 1000);
end;
end;
Status := 'Teleported to Lumbridge.';
Wait(13000); //static wait
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
FreeDTM(TeleLDTM);
end;




{------------------------------------------------------------ Rune Mysteries -------------------------------------------------------}




Procedure TalkDuke;
var
Time, DukeDTM: Integer;
begin
DukeDTM := DTMFromString('mQwAAAHicY2ZgYKhjZmCoBOImIM5hZGAoA+JyIHZz1GCwjmpmsAirY+AHqoNhRiQMBAD77AXl');
SetAngle(SRL_ANGLE_HIGH);
MarkTime(Time);
repeat
Wait(10);
WaitFindDTMEx(DukeDTM, x, y, MSX1, MSY1, MSX2, MSY2, 100, 3000);
MMouse(x, y, 10, 10);
until WaitUpTextMulti(['Duk', 'uk', 'uke'], 1000) or (TimeFromMark(Time) > 9000);
if WaitUptextMulti(['Duk', 'uk', 'uke'], 1000) then
begin
case Random(10) of
0..8: ClickMouse2(True);
9:
begin
ClickMouse2(False);
WaitOptionMulti(['Tal', 'alk', 'uke', 'Duk'], 1000);
end;
end;
end else
begin
Status := 'Failed talking to the Duke.'; //failed status
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
Status := 'Talking to the Duke.';
FreeDTM(DukeDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ThroughOptions1;
var
Rand, Time: Integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
QuestsDTM := DTMFromString('mlwAAAHicY2dgYLgCxAGMDAzpQLoFiLuA+A4QswHFSoB0MRSXAXE+EFdAaSEZRYbjQcoMh9xEGfgl5RhOnDgBxkJScgz8QHlcmBEPhgIAo30PAw==');
MarkTime(Time);
repeat
Wait(10);
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 3000) then
begin
Rand := Random(3);
Wait(800 + RandomRange(-150, 500));
if (Rand = 2) then
TypeByte(VK_SPACE) //needs work
else begin
MMouse(x, y, 10, 10);

case Random(5) of
0..3: ClickMouse2(True);
4:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 2000);
end;
end;
end;
end;
until FindDTM(QuestsDTM, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(Time) > 9500);
if (TimeFromMark(Time) > 9500) then
begin
Status := 'Failed to find option to Continue - 1.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found option to Continue - 1.';
FreeDTM(ThroughDTM);
FreeDTM(QuestsDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ThroughOptions4;
var
Rand, Time: Integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
MarkTime(Time);
repeat
Wait(10);
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 3000) then
begin
Rand := Random(3);
Wait(600 + RandomRange(-150, 500));
if (Rand = 2) then
TypeByte(VK_SPACE)
else begin
MMouse(x, y, 10, 10);

case Random(5) of
0..3: ClickMouse2(True);
4:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 2000);
end;
end;
end;
end;
until (TimeFromMark(Time) > 8000) or DidRedClick; //needs work
if (TimeFromMark(Time) > 8000) then
begin
Status := 'Failed to find option to Continue - 4.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found option to Continue - 4.';
FreeDTM(ThroughDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ThroughOptions2;
var
Rand, Time: Integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
AcceptDTM:= DTMFromString('mbQAAAHicY2VgYPjDzMCwF4gtWBgYfjBD8D1GBoa7QHwHiJ8D8WUg5te1ZMgxF2CoshVg6HEUZriZxc/AD9SPjhmxYDAAALrgDL4=');
MarkTime(Time);
repeat
Wait(10);
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
begin
Rand := Random(3);
Wait(600 + RandomRange(-150, 500));
if (Rand = 2) then
TypeByte(VK_SPACE) //needs work
else begin
MMouse(x, y, 10, 10);

case Random(5) of
0..3: ClickMouse2(True);
4:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 1500);
end;
end;
end;
end;
until FindDTM(AcceptDTM, x, y, MSX1, MSY1, MSX2, MSY2) or (TimeFromMark(Time) > 9500);
if (TimeFromMark(Time) > 9500) then
begin
Status := 'Failed to find option to Continue - 2.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found option to Continue - 2.';
FreeDTM(ThroughDTM);
FreeDTM(AcceptDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ThroughOptions3;
var
Rand, Time: integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
HeadWizardDTM := DTMFromString('mbQAAAHicY2VgYGBjYWBYAsSlzAwM34D4CxBPYWJgmAzFfUA8DYiFZBQZ5rnKgvGJEyfAmB+oHx0zYsFgAACE2Q1X');
MarkTime(Time);
repeat
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 3000) then
begin
Rand := Random(3);
Wait(600 + RandomRange(-150, 500));
if (Rand = 2) then
TypeByte(VK_SPACE) //needs work
else begin
MMouse(x, y, 10, 10);

case Random(5) of
0..3: ClickMouse2(True);
4:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 1500);
end;
end;
end;
end;
until FindDTM(HeadWizardDTM, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(Time) > 9500);
if (TimeFromMark(Time) > 9500) then
begin
Status := 'Failed to find option to Continue - 3.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found option to Continue - 3.';
FreeDTM(ThroughDTM);
FreeDTM(HeadWizardDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure AnyQuests;
begin
QuestsDTM := DTMFromString('mlwAAAHicY2dgYLgCxAGMDAzpQLoFiLuA+A4QswHFSoB0MRSXAXE+EFdAaSEZRYbjQcoMh9xEGfgl5RhOnDgBxkJScgz8QHlcmBEPhgIAo30PAw==');
if WaitFindDTMEx(QuestsDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
begin
Status := 'Found option to Continue - Any Quests.';
MMouse(x, y, 10, 10);
case Random(5) of
0..3: ClickMouse2(True);
4:
begin
ClickMouse2(False);
WaitOptionMulti(['Cont', 'ntin', 'nue', 'ontin', 'tinu'], 1500);
end;
end;
end else
begin
Status := 'Failed to find option to Continue - Any Quests.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(QuestsDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure AcceptQuest;
begin
AcceptDTM:= DTMFromString('mbQAAAHicY2VgYPjDzMCwF4gtWBgYfjBD8D1GBoa7QHwHiJ8D8WUg5te1ZMgxF2CoshVg6HEUZriZxc/AD9SPjhmxYDAAALrgDL4=');
if WaitFindDTMEx(AcceptDTM, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) then
begin
MMouse(x, y, 10, 10);
Case Random(2) of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Acc'], 1000); //options need work
end;
end;
Status := 'Accepted the quest.';
end else
begin
Status := 'Failed to accept the quest.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(AcceptDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure OpenDoor;
var
DoorClosedDTM, DoorOpenDTM: integer;
begin
DoorClosedDTM := DTMFromString('mQwAAAHicY2ZgYHBlYmBwY4LQcxkZGFqBeAMQT6xOZFjRVwDG/EB1MMyIhIEAACytB5g=');
DoorOpenDTM := DTMFromString('mQwAAAHicY2ZgYCgA4kggDgHiGUBcAsTzgbinLJZhWU8+GPMD+TDMiISBAAAypged');
SetAngle(SRL_ANGLE_HIGH);
repeat
Inc(Found);
if WaitFindDTMEx(DoorClosedDTM, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) or
WaitFindDTMEx(DoorOpenDTM, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) then
MMouse(x, y, 5, 5);
until WaitUpTextMulti(['pen', 'Op', 'Open', 'Clo', 'ose', 'Close'], 800) or (Found = 5);

if IsUpTextMultiCustom(['pen', 'Op', 'Open']) then
begin
Case Random(3) of
0..1: ClickMouse2(True);
2:
begin
ClickMouse2(False);
WaitOptionMulti(['Open', 'pen', 'Op'], 700);
end;
end;
Status := 'Opened the door - Door.';
end else
if IsUpTextMultiCustom(['Clo', 'ose', 'Close']) then
Status := 'The door is already open - Door.'
else begin
Status := 'Failed to open the door - Door.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
Wait(1000 + RandomRange(-500, 600));
FreeDTM(DoorClosedDTM);
FreeDTM(DoorOpenDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;





{----------------------------------------------------------- Wiz Tower ----------------------------------------------------}




Procedure OpenWizDoor1;
var
WizDoor1Open, WizDoor1Closed: integer;
begin
WizDoor1Closed := DTMFromString('mggAAAHicY2NgYNjJzMDwCIhnAPEKIL4AxHuA+AgjA8NBID4AxNeA+BYQ3wPiTH89holTZzBMnjaLoThQmSHfT5GhJdmKgR9oFjbMiANDAADFzxEG');
WizDoor1Open := DTMFromString('mWAAAAHicY2FgYPgAxPeAWI8Rwj4AxJOAeApUPDtAn6Fv4lSGabPmMhSGGjLwA8WQMSMaBgEAi5ELWA==');
SetAngle(SRL_ANGLE_HIGH);
Found := 0;
repeat
Inc(Found);
if WaitFindDTMEx(WizDoor1Closed, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) or
WaitFindDTMEx(WizDoor1Open, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) then
MMouse(x, y, 5, 5);
until WaitUpTextMulti(['pen', 'Op', 'Open', 'Clo', 'ose', 'Close'], 800) or (Found = 5);

if IsUpTextMultiCustom(['pen', 'Op', 'Open']) then
begin
Case Random(3) of
0..1: ClickMouse2(True);
2:
begin
ClickMouse2(False);
WaitOptionMulti(['Open', 'pen', 'Op'], 700);
end;
end;
Status := 'Opened the door - Wiz Door 1.';
end else
if IsUpTextMultiCustom(['Clo', 'ose', 'Close']) then
Status := 'The door is already open - Wiz Door 1.'
else begin
Status := 'Failed to open the door - Wiz Door 1.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(WizDoor1Closed);
FreeDTM(WizDoor1Open);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure OpenWizDoor2;
var
WizDoor2Open, WizDoor2Closed: integer;
begin
WizDoor2Closed := DTMFromString('mbQAAAHicY2VgYDBmYWDgAuIoIHYCYmUgvs3IwHAAiP8D8VMgPgvEpREmDPMXLQPjwlAjhggndQZ+oH50zIgFgwEANNYMPw==');
WizDoor2Open := DTMFromString('mWAAAAHicY2FgYEhjZGCQAuIYILYF4jlAsXYg3gnEu4C4OFCZYf6iZWBcWJjDwA8UQ8aMaBgEAAv6Cfs=');
SetAngle(SRL_ANGLE_HIGH);
Found := 0;
repeat
Inc(Found);
if WaitFindDTMEx(WizDoor2Closed, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) or
WaitFindDTMEx(WizDoor2Open, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) then
MMouse(x, y, 5, 5);
until WaitUpTextMulti(['pen', 'Op', 'Open', 'Clo', 'ose', 'Close'], 800) or (Found = 5);

if IsUpTextMultiCustom(['pen', 'Op', 'Open']) then
begin
Case Random(3) of
0..1: ClickMouse2(True);
2:
begin
ClickMouse2(False);
WaitOptionMulti(['Open', 'pen', 'Op'], 700);
end;
end;
Status := 'Opened the door - Wiz Door 2.';
end else
if IsUpTextMultiCustom(['Clo', 'ose', 'Close']) then
Status := 'The door is already open - Wiz Door 2.'
else begin
Status := 'Failed to open the door - Wiz Door 2.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(WizDoor2Closed);
FreeDTM(WizDoor2Open);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure WalkToDoor2;
var
ToDoor2: TPoint;
begin
SetAngle(SRL_ANGLE_HIGH);
Wait(1000 + RandomRange(-300, 500));
ToDoor2 := Point(4268, 4011);
if SPS_WalkToPos(ToDoor2) then
Status := 'Walked to the door - Door 2.'
else begin
Status := 'Failed to walk to the door - Door 2.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure FindDung;
var
DungeonDTM: integer;
begin
DungeonDTM := DTMFromString('mbQAAAHicY2VgYJBhhWB5IBYHYiUgzmJkYCgA4nwgzgHiDCD+oKUFxgcOHADjv67SDPxA/eiYEQsGAwDFzwuG');
if WaitFindDTMEx(DungeonDTM, x, y, MMX1, MMY1, MMX2, MMY2, 100, 2000) then
begin
Mouse(x, y, 5, 5, mouse_Left);
Status := 'Walked to the dungeon.';
end else
begin
Status := 'Failed walking to the dungeon.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(DungeonDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure FindWizStairsDown;
var
WizStair1DTM, Time: integer;
begin
WizStair1DTM:= DTMFromString('mrAAAAHic42BgYDBiYWCQAGJJIPYB4iAWhFgAiGZiYNAF4j+MDAx/gVgLyGYAYhEo5uPlZQjyd2dIS0tkyMlJZwjwdWWorcwF45rybAZ+oHJ8mJEAhgEAUZ0NZA==');
SetAngle(SRL_ANGLE_HIGH);
MarkTime(Time);
repeat
Wait(10);
if WaitFindDTMEx(WizStair1DTM, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) then
MMouse(x, y, 9, 9);
until WaitUpTextMulti(['dder', 'Ladd'], 800) or (TimeFromMark(Time) > 8000);
if IsUpTextMultiCustom(['down', 'Clim']) then
begin
Case Random(2) of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['down', 'Clim'], 800);
end;
end;
Status := 'Climbed down the ladder - Wiz Stairs Down.'; // stopped edits here!
end else
begin
Status := 'Failed to climb down the stairs - Wiz Stairs Down.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(WizStair1DTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure ToWizDoor;
begin
SetAngle(SRL_ANGLE_HIGH);
Wait(2500 + RandomRange(-300, 500));
if RadialWalkTolerance(394227, 110, 170, 40, 0, 0, 15) then
Status := 'Walked to the door - Wiz Door.'
else begin
Status := 'Failed to walk to the door - Wiz Door.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure OpenWizDoor3;
var
WizDoor3Closed: integer;
begin
WizDoor3Closed := DTMFromString('mlwAAAHicY2dgYLjEzMBwBYgvAPF5KBuErwHxQ0agPBC/BeLPQHwGiF8A8U0gdrBQBmNPR02GkpxIhrl9GQxOVqpgMX6gubgwIx4MBQCOXBJo');
SetAngle(SRL_ANGLE_HIGH);
Found := 0;
repeat
Inc(Found);
if WaitFindDTMEx(WizDoor3Closed, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000) then
MMouse(x, y, 5, 5);
until WaitUpTextMulti(['pen', 'Op', 'Open', 'Clo', 'ose', 'Close'], 800) or (Found = 5)

if IsUpTextMultiCustom(['pen', 'Op', 'Open']) then
begin
Case Random(3) of
0..1: ClickMouse2(True);
2:
begin
ClickMouse2(False);
WaitOptionMulti(['Open', 'pen', 'Op'], 700);
end;
end;
Status := 'Opened the door - Wiz Door 3.';
end else
if IsUpTextMultiCustom(['Clo', 'ose', 'Close']) then
Status := 'The door is already open - Wiz Door 3.'
else begin
Status := 'Failed to open the door - Wiz Door 3.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(WizDoor3Closed);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure FindWizard;
var
TPA: TPointArray;
ATPA: T2DPointArray;
Time: integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
SetAngle(SRL_ANGLE_HIGH);
MarkTime(Time);
repeat
WaitFindColors(TPA, 15577418, MSX1, MSY1, MSX2, MSY2, 15, 1000);
TPAToATPAExWrap(TPA, 30, 40, ATPA);
MMouse(x, y, 5, 5);
if WaitUpTextMulti(['edr'], 800) then //add uptext
begin
case Random(2) of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti([], 500); //add options
end;
end;
end;
until WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 1500) or (TimeFromMark(Time) > 12000);
if (TimeFromMark(Time) > 12000) then
begin
Status := 'Failed to find the wizard - Find Wizard.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Talking to the wizard - Find Wizard.';
FreeDTM(ThroughDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure HeadWizardOption;
var
Time: integer;
begin
HeadWizardDTM:= DTMFromString('mbQAAAHicY2VgYGBjYWBYAsSlzAwM34D4CxBPYWJgmAzFfUA8DYiFZBQZ5rnKgvGJEyfAmB+oHx0zYsFgAACE2Q1X');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
MarkTime(Time);
repeat
Wait(10);
if WaitFindDTMEx(HeadWizardDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
Mouse(x, y, 7, 7, mouse_left);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(Time) > 6200);
if (TimeFromMark(Time) > 6200) then
begin
Status := 'Failed to find the option to Continue - Head Wizard Option.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found the option to continue - Head Wizard Option.';
FreeDTM(ThroughDTM);
FreeDTM(HeadWizardDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure WizOptions;
begin
Teh := 0;
repeat
Inc(Teh);
ThroughOptions4;
until (Teh = 14) or not LoggedIn;
if not LoggedIn then
begin
Status := 'Failed to click through options - Wiz Options.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Clicked through options - Wiz Options.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure Certain;
var
CertDTM: integer;
begin
CertDTM := DTMFromString('mggAAAHicY2NgYPjAzMBgxsLAsBBIHwTi40AsAuSnMDEwJENxPBSnAbGQjCLDPFdZMD5x4gQc8wPNwoYZcWAIAADWdg+P');
if WaitFindDTMEx(CertDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
begin
Status := 'Found the option to Continue - Certain.';
Mouse(x, y, 7, 7, mouse_left);
Wait(1200 + RandomRange(-500, 300));
end else
begin
Status := 'Failed to find the option to Continue - Certain.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(CertDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;




{------------------------------------------------------ Varrock -------------------------------------------------------------}




Procedure TalkOwner;
var
OwnerDTM, Time: integer;
begin
OwnerDTM := DTMFromString('mggAAAHicY2NgYBBkZGDgB2IhKBYBYgEgVoNiFSDWgLJB9PYN6xk2rV4NxjMmTmRYuWghw7plyxhYgWZhw4w4MAQAAKciDUs=');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
SetAngle(SRL_ANGLE_HIGH);
MarkTime(Time);
repeat
if WaitFindDTMEx(OwnerDTM, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2500) then
MMouse(x, y, 5, 5);
until WaitUpTextMulti(['ury', 'Aub', 'Aubury'], 800) or (TimeFromMark(Time) > 7600);
if (TimeFromMark(Time) > 7600) then
begin
Status := 'Failed to talk to the shop owner - Talk Owner.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
begin
case Random(2) of
0: ClickMouse2(True);
1:
begin
ClickMouse2(False);
WaitOptionMulti(['Talk', 'alk', 'Aub'], 800);
end;
end;
Status := 'Talking to the shop owner - Talk Owner.';
end;
FreeDTM(OwnerDTM);
FreeDTM(ThroughDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure InsideShop;
var
Shop: TPoint;
begin
SetAngle(SRL_ANGLE_HIGH);
Wait(1400 + RandomRange(-500, 200));
Shop := Point(4846, 3049);
if SPS_WalkToPos(Shop) then
Status := 'Walked inside Aubury''s shop - Inside Shop.'
else begin
Status := 'Failed to walk inside Aubury''s shop - Inside Shop.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure SentHere;
var
SentDTM, Time: integer;
begin
SentDTM := DTMFromString('mggAAAHicY2NgYBBiZGCYA8RZQHYkkG4C0h1AfADI3g/Fe4H4EBDvAmIhGUUGLl5eMD5x4gQc8wP1YMOMODAEAACmoQ8B');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
MarkTime(Time);
repeat
Wait(10);
if WaitFindDTMEx(SentDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
Mouse(x, y, 5, 5, mouse_left);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(Time) > 8100);
if (TimeFromMark(Time) > 8100) then
begin
Status := 'Failed to find the option to Continue - Sent Here.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found the option to Continue - Sent Here.';
FreeDTM(ThroughDTM);
FreeDTM(SentDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure OwnerOptions;
begin
Teh := 0;
repeat
Inc(Teh);
ThroughOptions4;
until (Teh = 7) or not LoggedIn;
if not LoggedIn then
begin
Status := 'Failed to click through options - Owner Options.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Clicked through options - Owner Options.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure TeleportWiz;
var
YesTeleDTM, Time: integer;
begin
YesTeleDTM := DTMFromString('mlwAAAHicY2dgYLgDxJOB2JSRgeEQkD4GxM+A+D8QyzIisBQUS0D5QlJyDEFO+gx+9noMJ06cQMGsQL24MCMeDAUAQKoRMw==');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
MarkTime(Time);
repeat
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2500) then
Mouse(x, y, 7, 7, Mouse_left);
until FindDTM(YesTeleDTM, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(Time) > 8100);
if (TimeFromMark(Time) > 8100) then
begin
Status := 'Failed to find the option to Continue - Teleport Wizard.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found the option to Continue - Teleport Wizard.';
FreeDTM(ThroughDTM);
FreeDTM(YesTeleDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure TeleToWizard;
var
Time: integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
MarkTime(Time);
repeat
Wait(RandomRange(100, 200));
FindNPCChatText('es', clickLeft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(Time) > 5000);
if (TimeFromMark(Time) > 5000) then
begin
Status := 'Failed to find the option to Continue - Tele To Wizard.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found the option to Continue - Tele To Wizard.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
FreeDTM(ThroughDTM);
end;

Procedure TeleToEnd;
begin
OpenWizDoor1;
WalkToDoor2;
OpenWizDoor2;
FindDung;
FindWizStairsDown;
ToWizDoor;
OpenWizDoor3;
FindWizard;
Teh := 0;
repeat
Inc(Teh);
ThroughOptions4;
until (Teh = 27) or not LoggedIn;
if not LoggedIn then
begin
Status := 'Failed to click through options - Tele To End.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Clicked through options - Tele To End.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure Ending;
var
Time: integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY'); {28 options to finish quest}
ContinueDTM:= DTMFromString('mbQAAAHicY2VgYNjHwsDQC8VJQPwAiLcwMTBsBeINQLwJivkM7BgenzkPxqvCxBgWBYgw8AP1o2NGLBgMAPxUDp8=');
MarkTime(Time);
repeat
if WaitFindDTMEx(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2, 100, 2000) then
Mouse(x, y, 5, 5, Mouse_left);
until FindDTM(ContinueDTM, x, y, MSX1, MSY1, MSX2, MSY2) or (TimeFromMark(Time) > 6200);
if (TimeFromMark(Time) > 6200) then
begin
Status := 'Failed to find the option to Continue - Ending.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
Status := 'Found the option to Continue - Ending.';
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
FreeDTM(ThroughDTM);
FreeDTM(ContinueDTM);
end;

Procedure FinishQuestRM;
begin
ContinueDTM:= DTMFromString('mbQAAAHicY2VgYNjHwsDQC8VJQPwAiLcwMTBsBeINQLwJivkM7BgenzkPxqvCxBgWBYgw8AP1o2NGLBgMAPxUDp8=');
if WaitFindDTMEx(ContinueDTM, x, y, MSX1, MSY1, MSX2, MSY2, 200, 2600) then
begin
Mouse(x, y, 7, 7, mouse_left);
Status := 'Found the option to Continue - Finish Quest RM.';
end else
begin
Status := 'Failed to find the option to Continue - Finish Quest RM.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(ContinueDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure FinishQuestRG;
var
Continue2DTM: integer;
begin
Continue2DTM := DTMFromString('mWAAAAHicY2FgYAhjZGC4D6TvAOkoIM5jYmDIAOIsIE4GYj4DO4ZlEbIMiwJEGB6fOc8AAiJQDAKMaBgEAAajCWU=');
if WaitFindDTMEx(Continue2DTM, x, y, MSX1, MSY1, MSX2, MSY2, 200, 2600) then
begin
Mouse(x, y, 5, 5, mouse_left);
Status := 'Found the option to Continue - Finish Quest RG.';
end else
begin
Status := 'Failed to find the option to Continue - Finish Quest RG.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end;
FreeDTM(Continue2DTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

Procedure FindBob;
var
BobDTM, Time: integer;
begin
SetAngle(SRL_ANGLE_HIGH);
BobDTM := DTMFromString('mbQAAAHicY2VgYKhjZmCoAeIGKAaxcxkZGPKAuACIc4A4G4jtbW0YrCzMGdws9RnMTU3BfFagfnTMiAWDAQBfxAg4');
MarkTime(Time);
repeat
WaitFindDTMEx(BobDTM, x, y, MSX1, MSY1, MSX2, MSY2, 100, 2000);
MMouse(x, y, 5, 5);
until WaitUpTextMulti(['Bob', 'ob', 'Bo'], 700) or (TimeFromMark(Time) > 8100);
if (TimeFromMark(Time) > 6200) then
begin
Status := 'Failed to find the option to Trade - Find Bob.';
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
Logout;
TerminateScript;
end else
begin
Status := 'Found the option to Trade - Find Bob.';
ClickMouse2(False);
WaitOptionMulti(['Trad', 'Trade', 'ade'], 800);
end;
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end;

{Procedure GetPick;
begin
PickDTM := DTMFromString('mlwAAAHicY2dgYNAGYhkgdgNidyjbFIiNgNgDiFOA2ARKg8SjgDgRiD3NFRg0lWUYxIUF4fT//wxgzM+AGzPiwVAAAGnLCeU=');
if WaitFindDTMEx(PickDTM, x, y, MSX1, MSY1, MSX2, MSY2, 200, 2000) then
begin
Mouse(x, y, 5, 5, mouse_right);
WaitOptionMulti(['1'], 1000);
end;
FreeDTM(PickDTM);
if LONGDEBUG = false then
ClearDebug;
WriteLn(Status+ ' @ Time Running: ' +TimeRunning);
end; }




{------------------------------------------------------ Restless Ghost ------------------------------------------------------------}





{ End Edits: 8/25/2012 }



Procedure WalkToFather;
var
Father: TPoint;
begin
SetAngle(SRL_ANGLE_HIGH);
Wait(RandomRange(1500, 1600));
Father := Point(4811, 3834);
SPS_WalkToPos(Father);
WriteLn('' +TimeRunning);
end;

Procedure FindFather;
var
FatherDTM: integer;
begin
FatherDTM := DTMFromString('mLgAAAHicY2IAAkYI/gCkvgBxTOpSBm0dfQYuIJsLIQ0EAGxHA+s=');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
SetAngle(SRL_ANGLE_HIGH);
repeat
repeat
Wait(RandomRange(480,530));
FindDTMRotatedSE(FatherDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound); //atpa
MMouse(x, y, 5, 5);
until IsUpText('ath');
ClickMouse2(True);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2)
WriteLn('Talking to Father');
FreeDTM(FatherDTM);
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure GhostQuest;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('uest', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Begin quest option');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure FatherOptions;
begin
Teh := 0;
repeat
Inc(Teh);
ThroughOptions4;
until (Teh = 7);
WriteLn('' +TimeRunning);
end;

Procedure HutDoor;
var
WoodsDoor: integer;
begin
WoodsDoor := DTMFromString('mQwAAAHicY2ZgYPgPxBeAWJORgeEakH4AxI+BOD85lOF+vQ7D1UptBmYgXwSKGZEwEAAAhDEI7g==');
setangle(SRL_ANGLE_HIGH);
Found := 0;
repeat
Inc(Found);
Wait(RandomRange(480, 530));
if FindDTMRotatedSE(WoodsDoor, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(x, y, 5, 5);
until (IsUpText('pen') or (Found=5));

if IsUpText('pen') then
begin
ClickMouse2(True);
WriteLn('Opening door');
Wait(RandomRange(1500,1600));
end;

if IsUptext('lose') then
WriteLn('Door opened');
FreeDTM(WoodsDoor);
WriteLn('' +TimeRunning);
end;

Procedure FindUrh;
var
Father2DTM: integer;
begin
Father2DTM := DTMFromString('mbQAAAHicY2VgYFBgZGCQA2IlRgT7H1CcgRGB/wKpnWsXMKxfMp2ht6UKTJ/cs46BFSiOjhmxYDAAAPYeDF0=');
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
SetAngle(SRL_ANGLE_HIGH);
repeat
repeat
Wait(RandomRange(480, 530));
FindDTMRotatedSE(Father2DTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound);
MMouse(x, y, 5, 5);
until IsUpText('athe');
ClickMouse2(True);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2)
WriteLn('Talking to Urhney');
FreeDTM(Father2DTM);
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure AboutQuest;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('alk', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('The Father from Lumbridge sent me');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure Ghosts;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('host', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Ghosts are haunting Lumbridge!');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure Father2Options;
begin
Teh := 0;
repeat
Inc(Teh);
ThroughOptions4;
until (Teh = 10);
WriteLn('' +TimeRunning);
end;

Procedure Ammy;
var
AmmyDTM: integer;
begin
AmmyDTM := DTMFromString('mggAAAHicY2NgYMhgYmAoAeI0IC4D4goo+zVQ7hYQ3wHiR1D6DRB3NJYyxDnJMgRaSjJ4GIkxRNnLMGyYVcrAD5RDx1xAzIgDQwAAtEMOMQ==');
Teh := 0;
repeat
Wait(RandomRange(1000, 1100));
Inc(Teh);
until (FindDTM(AmmyDTM, x, y, MIX1, MIY1, MIX2, MIY2) or (Teh = 5));

if FindDTM(AmmyDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 1, 1);
if WaitUpText('mul', 600) then
ClickMouse2(true);
Writeln('Amulet on');
WriteLn('' +TimeRunning);
end;
Wait(RandomRange(300, 400));
FreeDTM(AmmyDTM);
end;

Procedure FindCoffin;
var
CoffinClosed, CoffinOpen: integer;
begin
CoffinClosed := DTMFromString('mggAAAHicY2NgYNBnZGBwAeIQINYDYj8gtgRiBiBmAeLPQOYXBggfRGuqq4CxgpwMg5qKIoOCtCgYswLlsGFGHBgCAFQVBtw=');
CoffinOpen := DTMFromString('mQwAAAHicY2ZgYLgLxGeA+DAQbwPiHUC8HYjFBDgZ2mqLGdrrSxlYgXwuKGZEwkAAAFy8B9E=');
SetAngle(SRL_ANGLE_HIGH);

repeat
Wait(RandomRange(2000, 2100));
if FindDTMRotatedSE(CoffinClosed, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
Mouse(x, y, 5, 5, mouse_left);

if FindDTMRotatedSE(CoffinOpen, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
Mouse(x, y, 5, 5, mouse_left);
until IsUpText('pen');
Mouse(X, Y, 5, 5, mouse_left);
WriteLn('Found coffin');
FreeDTM(CoffinOpen);
FreeDTM(CoffinClosed);
WriteLn('' +TimeRunning);
end;

Procedure TalkToGhost;
var
GhostDTM: integer;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
GhostDTM := DTMFromString('mbQAAAHicY2VgYHgIxU+g+BEQ2wGxCRBbAbEhELsBcXxGKsPStcsY8nOTGCbOmMQQn5rIwAoU50LDjFgwGAAApTMNCQ==');
repeat
Wait(RandomRange(1800,1900));
if FindDTMRotatedSE(GhostDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(X, Y, 5, 5);
until WaitUpText('est', 200);
ClickMouse2(True);
FreeDTM(ThroughDTM);
FreeDTM(GhostDTM);
WriteLn('' +TimeRunning);
end;

Procedure ItWorks;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('mule', clickleft)
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Wow, this amulet works!');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure WhyGhost;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
Wait(RandomRange(1000, 1200));
repeat
FindNPCChatText('host', clickleft);
until FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Why are you a ghost?');
FreeDTM(ThroughDTM);
WriteLn('' +TimeRunning);
end;

Procedure GhostOptions1;
begin
Teh := 0;
repeat
Inc(Teh);
ThroughOptions4;
until (Teh = 4);
WriteLn('' +TimeRunning);
end;

Procedure GhostOptions2;
begin
Teh := 0;
repeat
Inc(Teh);
ThroughOptions4;
until (Teh = 5);
WriteLn('' +TimeRunning);
end;

Procedure FindRocks;
var
RocksDTM: integer;
begin
RocksDTM := DTMFromString('mbQAAAHicY2VgYHBmZGAwAWIdIA4BYh8gzgeKJwFxPRBXA3ECEAcG+DHEx0YxxERHMHh5ujN4uLsysALF0TEjFgwGADVmCFk=');
repeat
Wait(RandomRange(480, 530));
FindDTMRotatedSE(RocksDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound);
MMouse(x, y, 5, 5);
until WaitUpText('ock', 800);
ClickMouse2(True);
Writeln('Found skull');
FreeDTM(RocksDTM);
WriteLn('' +TimeRunning);
end;

Procedure FindSkull;
var
SkullDTM: integer;
begin
SkullDTM:= DTMFromString('mQwAAAHicY2ZgYHBhYmCwAWI3IL4H5L8C4rdAvHrRFIaju1YBWUwMXEAShhmRMBAAAEMnB7I=');
Teh := 0;
repeat
Gametab(tab_inv);
Wait(RandomRange(1000, 1100));
Inc(Teh);
until (FindDTM(SkullDTM, x, y, MIX1, MIY1, MIX2, MIY2) or (Teh = 5));

if FindDTM(SkullDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 5, 5);
if WaitUpText('kul', 800) then
ClickMouse2(true);
end;
WriteLn('Found Skull');
WriteLn('' +TimeRunning);
Wait(RandomRange(300, 400));
FreeDTM(SkullDTM);
end;

Procedure EndingRG;
begin
Wait(15000 + (random(1000)));
end;

Procedure BuryBones;
var
BonesDTM: integer;
begin
SetAngle(SRL_ANGLE_HIGH);
BonesDTM := DTMFromString('mbQAAAHicY2VgYHBmYmCwBmI7IHYDYh8gfgwUfwTEr4H4LhA/AeIgb3OGvsZ4Bj83E4aybH+GvBQvBmagODpmxILBAAAHVQs5');
Teh := 0;
repeat
repeat
Gametab(tab_inv);
Wait(RandomRange(1000, 1100));
Inc(Teh);
until (FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2));

if FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 1, 1);
if WaitUpText('one', 600) then
ClickMouse2(true);
end;
WriteLn('Bured a bone');
WriteLn('' +TimeRunning);
Wait(RandomRange(300,400));
until (not(FindDTM(BonesDTM, x, y, MIX1, MIY1, MIX2, MIY2)) or (Teh = 5));
FreeDTM(BonesDTM);
end;


begin
Run;
begin
Case lowercase(Quest) of
'runemysteries':
begin
Case lowercase(Method) of
'walking':
begin
TalkDuke;
ThroughOptions1;
AnyQuests;
ThroughOptions4;
ThroughOptions4;
ThroughOptions2;
AcceptQuest;
FindTeleportLumby;
CastleToLumby;
ToTower;
OpenWizDoor1;
WalkToDoor2;
OpenWizDoor2;
FindDung;
FindWizStairsDown;
ToWizDoor;
OpenWizDoor3;
FindWizard;
ThroughOptions4;
HeadWizardOption;
WizOptions;
Certain;
ThroughOptions4;
ThroughOptions4;
ThroughOptions4;
FindTeleportLumby;
ToVarrock;
InsideShop;
TalkOwner;
SentHere;
OwnerOptions;
TeleportWiz;
TeleToWizard;
ThroughOptions4;
ToTower;
TeleToEnd;
Ending;
FinishQuestRM;
end;

'teleport':
begin
TalkDuke;
ThroughOptions1;
AnyQuests;
ThroughOptions4;
ThroughOptions4;
ThroughOptions2;
AcceptQuest;
FindTeleportLumby;
CastleToLumby;
ToTower;
OpenWizDoor1;
WalkToDoor2;
OpenWizDoor2;
FindDung;
FindWizStairsDown;
ToWizDoor;
OpenWizDoor3;
FindWizard;
ThroughOptions4;
HeadWizardOption;
WizOptions;
Certain;
ThroughOptions4;
ThroughOptions4;
ThroughOptions4;
FindTeleportVarrock;
VarrockToShop;
InsideShop;
TalkOwner;
SentHere;
OwnerOptions;
TeleportWiz;
TeleToWizard;
ThroughOptions4;
ToTower;
TeleToEnd;
Ending;
FinishQuestRM;
end;
end;
end;

'restlessghost':
begin
FindTeleportLumby;
CastleToLumby;
ToChurch;
WalkToFather;
FindFather;
ThroughOptions4;
GhostQuest;
ThroughOptions2;
AcceptQuest;
FatherOptions;
WalkToHut;
HutDoor;
FindUrh;
ThroughOptions4;
AboutQuest;
ThroughOptions4;
Ghosts;
Father2Options;
Ammy;
FindTeleportLumby;
CastleToLumby;
ToGrave;
FindCoffin;
TalkToGhost;
GhostOptions1;
ItWorks;
ThroughOptions4;
WhyGhost;
GhostOptions2;
ToMine;
FindRocks;
RocksToGrave;
FindCoffin;
FindSkull;
FindCoffin;
EndingRG;
FinishQuestRG;
BuryBones;
end;
end;
end;
{FindTeleportLumby;
CastleToLumby;
Bobshop;
FindBob;
GetPick;}
WriteLn('It took: '+(TimeRunning)+' to finish ' +(Quest));
Wait(RandomRange(4000, 4200));
Logout;
TerminateScript;
end.

Silent

2012-07-16 04:07:16

Looks pretty cool man. Any idea what quest you are going to try and add next? I'll probably use this on two of my accounts once SMART/Simba is all fixed up.

Looking forward to seeing future development. :)

tehq

2012-07-16 10:16:36

From: Silent SPY
Looks pretty cool man. Any idea what quest you are going to try and add next? I'll probably use this on two of my accounts once SMART/Simba is all fixed up.

Looking forward to seeing future development. :)


I was thinking about a few more free quests.. Pirates treasure, Dorics quest, and reasonable requests. I'd love to script some members quests eventually.

Sir Ducksworthy

2012-07-17 02:16:32

Yeah Runeglider is going to do quests as well, maybe you could help, it will use less functions and a Database tho.

J J

2012-07-18 03:52:48

Looks great man :P I was thinking about making a quest script aswell. Maybe a very basic one that lodestone teleports to varrock, walks to the g/e and buys beads. Then lodestone teleports to draynor and walks to the wizard tower and completes the Imp Catcher quest.

tehq

2012-08-25 19:00:43

Almost finished updating this script! I should finish this week. I'll need some feedback when it's all done. (Anybody?)

Jakkle

2012-08-27 09:53:34

From: tehq
Almost finished updating this script! I should finish this week. I'll need some feedback when it's all done. (Anybody?)


I will definitely be testing it out. I have a few accounts to test with.
Much respect going for a questing script, It will be quite tricky with more advanced quest.
:thumbsup: