SRL Archive - Test corner

Fume


MylesMadness

2008-11-21 20:41:36

Well, bobobo left, and there is no way I will have time to finish this, so I am going to release what I got, if anyone wants to work on it feel free, just give some credit to me and bobobo.
//{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/skill/mining.scar}
{.include srl/srl/misc/Users.scar}
{.include SRL/SRL/Reflection/Reflection.scar}
var
x, y, Item, Coal, Mith, Iron, Tin, Clay, Copper, Gold, Silver, NotminingTime, OreDTM: Integer;
BMP_PickAxe: array[0..5] of Integer;
EndForm: Boolean;
Form1: TForm;
GroupBox1, GroupBox3, GroupBox4: TGroupBox;
Label1, Label3, Label4, Label5: TLabel;
ComboBox2, ComboBox3: TComboBox;
Button2, Button3: TButton;
Walk:TpointArray;
const
WallColour = 15594735;
{procedure OnClose(Sender : TObject; var Action : TCloseAction);
begin
if (not(form1.ModalResult = 1)) then
End' + edFormProc.Text + ' := True;');
end;}

procedure Click(Sender: TObject);
begin
case Sender of
Button2: SRLPlayerForm(True, [], ['Loads', 'Pin'], [], []);
Button3: form1.ModalResult := mrOk;
end;
end;

procedure Update(Sender: TObject);
begin
ComboBox3.Clear;
case ComboBox2.Text of
'Mining Guild': begin
ComboBox3.Text := 'Coal';
ComboBox3.Items.add('Coal');
ComboBox3.Items.add('Mith');
end;
'VEM': begin
ComboBox3.Text := 'Iron';
ComboBox3.Items.add('Iron');
ComboBox3.Items.add('Tin');
ComboBox3.Items.add('Copper');
end;
'VWM': begin
ComboBox3.Text := 'Silver';
ComboBox3.Items.add('Silver');
ComboBox3.Items.add('Iron');
ComboBox3.Items.add('Tin');
ComboBox3.Items.add('Clay');
end;
'Rimmington':begin
ComboBox3.Text := 'Iron';
ComboBox3.Items.add('Iron');
ComboBox3.Items.add('Copper');
ComboBox3.Items.add('Clay');
ComboBox3.Items.add('Gold');
ComboBox3.Items.add('Tin');
end;
'Al Kharid':begin
ComboBox3.Text := 'Iron';
ComboBox3.Items.add('Iron');
ComboBox3.Items.add('Coal');
ComboBox3.Items.add('Adamantite');
ComboBox3.Items.add('Tin');
ComboBox3.Items.add('Copper');
ComboBox3.Items.add('Gold');
ComboBox3.Items.add('Mithril');
ComboBox3.Items.add('Silver');
end;
'PowerMine':begin
ComboBox3.Text := 'Gold';
ComboBox3.Items.add('Gold');
ComboBox3.Items.add('Clay');
ComboBox3.Items.add('Silver');
ComboBox3.Items.add('Iron');
ComboBox3.Items.add('Tin');
ComboBox3.Items.add('Copper');
ComboBox3.Items.add('Coal');
ComboBox3.Items.add('Mith');
end;
end;
end;

procedure Form;
begin
Form1 := CreateForm;
with Form1 do
begin
Position := poScreenCenter;
BorderStyle := bsSingle;
BorderIcons := [biMinimize, biSystemMenu];
ClientWidth := 274;
ClientHeight := 206;
Caption := 'FUME';
Color := cl3DDkShadow;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'Tahoma';
Font.Style := [];
PixelsPerInch := 96;
end;
GroupBox1 := TGroupBox.Create(Form1);
with GroupBox1 do
begin
Parent := Form1;
Left := 3;
Top := 0;
Width := 268;
Height := 113;
Caption := 'Instructions';
TabOrder := 0;
end;
Label1 := TLabel.Create(GroupBox1);
with Label1 do
begin
Parent := GroupBox1;
Left := 4;
Top := 16;
Width := 225;
Height := 19;
Caption := 'First, pick the location you want';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'Tahoma';
Font.Style := [];
end;
Label3 := TLabel.Create(GroupBox1);
with Label3 do
begin
Parent := GroupBox1;
Left := 4;
Top := 40;
Width := 260;
Height := 19;
Caption := 'Second, select the ore type you want';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'Tahoma';
Font.Style := [];
end;
Label4 := TLabel.Create(GroupBox1);
with Label4 do
begin
Parent := GroupBox1;
Left := 4;
Top := 64;
Width := 178;
Height := 19;
Caption := 'Third, press Player Setup';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'Tahoma';
Font.Style := [];
end;
Label5 := TLabel.Create(GroupBox1);
with Label5 do
begin
Parent := GroupBox1;
Left := 4;
Top := 88;
Width := 134;
Height := 19;
Caption := 'Finally, press Start!';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'Tahoma';
Font.Style := [];
end;
GroupBox3 := TGroupBox.Create(Form1);
with GroupBox3 do
begin
Parent := Form1;
Left := 8;
Top := 120;
Width := 110;
Height := 38;
Caption := 'Step 1';
TabOrder := 1;
end;
ComboBox2 := TComboBox.Create(GroupBox3);
with ComboBox2 do
begin
Parent := GroupBox3;
Left := 8;
Top := 12;
Width := 97;
Height := 21;
ItemHeight := 13;
TabOrder := 0;
OnChange := @Update;
Text := 'Mining Guild';
with ComboBox2.Items do
begin
Add('Mining Guild');
Add('VEM');
Add('VWM');
Add('Crafting Guild');
Add('Rimmington');
Add('Al Kharid');
Add('PowerMine');
end;
end;
GroupBox4 := TGroupBox.Create(Form1);
with GroupBox4 do
begin
Parent := Form1;
Left := 8;
Top := 160;
Width := 113;
Height := 41;
Caption := 'Step 2';
TabOrder := 2;
end;
ComboBox3 := TComboBox.Create(GroupBox4);
with ComboBox3 do
begin
Parent := GroupBox4;
Left := 8;
Top := 12;
Width := 97;
Height := 21;
ItemHeight := 13;
TabOrder := 0;
Text := 'Coal';
Items.add('Coal');
Items.add('Mith');
Items.add('Both');
end;
Button2 := TButton.Create(Form1);
with Button2 do
begin
Parent := Form1;
Left := 128;
Top := 120;
Width := 145;
Height := 41;
Caption := 'Player Setup';
TabOrder := 3;
Onclick := @Click;
end;
Button3 := TButton.Create(Form1);
with Button3 do
begin
Parent := Form1;
Left := 128;
Top := 168;
Width := 145;
Height := 33;
Caption := 'Start';
TabOrder := 4;
Onclick := @Click;
end;
end;

procedure SafeForm;
var
V: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('Form', V);
end;

procedure ShowFormModal;
begin
Form1.ShowModal;
end;

procedure SafeShowFormModal;
var
V: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowFormModal', V);
end;

procedure MainForm;
begin
try
SafeForm;
SafeShowFormModal;
except
WriteLn('An error seems to have occurred in: Form');
end;
end;

procedure FormIt;
begin
ClearDebug;
GetSelf.WindowState := wsMinimized;
MainForm;
GetSelf.WindowState := wsNormal;
if (EndForm) then
TerminateScript;
end;

procedure Intro;
var
I: integer;
begin
Cleardebug;
repeat
Wait(25)
Writeln(' ______')
Writeln('(______)')
Writeln('(_)__')
Writeln('(____)ast')
Writeln('(_)')
Writeln('(_)')
wait(25)
Inc(I)
Cleardebug;
until (I = 20)
I := 0;
repeat
Wait(25)
Writeln(' _ _')
Writeln('(_) (_)')
Writeln('(_) (_)')
Writeln('(_) (_)niversal')
Writeln('(_)___(_)')
Writeln(' (_____)')
wait(25)
Inc(I)
Cleardebug;
until (I = 20)
I := 0;
repeat
Wait(25)
Writeln(' __ __')
Writeln(' (__)_(__)')
Writeln('(_) (_) (_)')
Writeln('(_) (_) (_)ining')
Writeln('(_) (_)')
Writeln('(_) (_)')
wait(25)
ClearDebug;
Inc(I)
until (I = 20)
I := 0;
repeat
Wait(25)
Writeln(' ______')
Writeln('(______)')
Writeln('(_)__')
Writeln('(____)xpress')
Writeln('(_)____')
Writeln('(______)')
wait(25)
Cleardebug;
Inc(i)
until (I = 20)
I := 0;
repeat
ClearDebug;
wait(200)
Writeln(' ______ _ _ __ __ ______')
Writeln('(______)(_) (_) (__)_(__) (______)')
Writeln('(_)__ (_) (_)(_) (_) (_)(_)__')
Writeln('(____) (_) (_)(_) (_) (_)(____)')
Writeln('(_) (_)___(_)(_) (_)(_)____')
Writeln('(_) (_____) (_) (_)(______)')
wait(200)
Inc(I)
until (I = 4)
Cleardebug;
end;

Procedure LoadDTMs;
begin
//Ore dtm need to be in here
end;

function FindWatercolorBH: Integer; //Fix from SRL's Broken Water Colour.
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P: array of Tpoint;
begin
GC := 10324605;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
l := GetArrayLength(P);
for a := 0 to l - 1 do
begin
if rs_OnMinimap(P[a].x, P[a].y) then
begin
TestColor := GetColor(P[a].x, P[a].y);
if SimilarColors(TestColor, GC, 50) then
begin
ColorToRGB(TestColor, Red, Green, Blue);
if InRange(Blue - Green, -11, 49) then
if InRange(Green - Red, -17, 43) then
if InRange(Blue - Red, 2, 62) then
if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
if GetColor(P[a].x, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 2, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y) = TestColor then
if GetColor(P[a].x + 2, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 2) = TestColor then
begin
Result := TestColor;
WaterColor := TestColor;
WriteLn('WaterColor = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Water Color!');
Result := 0;
end;

function FindVarrockDirt: Integer;
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P: array of Tpoint;
begin
GC := 5602694;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
l := GetArrayLength(P);
for a := 0 to l - 1 do
begin
if rs_OnMinimap(P[a].x, P[a].y) then
begin
TestColor := GetColor(P[a].x, P[a].y);
if SimilarColors(TestColor, GC, 10) then
begin
ColorToRGB(TestColor, Red, Green, Blue);
if InRange(Blue - Green, -60, -20) then
if InRange(Green - Red, -29, 11) then
if InRange(Blue - Red, -69, -29) then
if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
if GetColor(P[a].x, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 2, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y) = TestColor then
if GetColor(P[a].x + 2, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 2) = TestColor then
begin
Result := TestColor;
WaterColor := TestColor;
WriteLn('Varrock Dirt = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Varrock Dirt Color!');
Result := 0;
end;



function FindGuildNormalRockColour: Integer; //Finds the normal Type rocks in Mining guild (coal,mith).
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P: array of Tpoint;
begin
GC := 4539216;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
l := GetArrayLength(P);
for a := 0 to l - 1 do
begin
if rs_OnMinimap(P[a].x, P[a].y) then
begin
TestColor := GetColor(P[a].x, P[a].y);
if SimilarColors(TestColor, GC, 50) then
begin
ColorToRGB(TestColor, Red, Green, Blue);
if InRange(Blue - Green, -28, 32) then
if InRange(Green - Red, -43, 17) then
if InRange(Blue - Red, -41, 19) then
if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
if GetColor(P[a].x, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 2, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y) = TestColor then
if GetColor(P[a].x + 2, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 2) = TestColor then
begin
Result := TestColor;
WaterColor := TestColor;
WriteLn('Guild Normal Rock Colour = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Normal Rock Colour!');
Result := 0;
end;

function PadEx(S: string; I: Integer): string;
var
II: Integer;
begin
for II := 1 to I do
Result := Result + S;
end;

procedure Proggy;
begin
Writeln('<==============Fume==============>')
Writeln('<================================>')
Writeln('<=Time Running:' + TimeRunning)
Writeln('<================================>')
Writeln('<=By:BobboHobbo and Mylesmadness=>')
if Coal > 0 then
Writeln('<=Coal Mined :' + IntToStr(Coal) + PadEx('=', 18 - Length(IntToStr(Coal))) + '>');
if Mith > 0 then
Writeln('<=Mith Mined :' + IntToStr(Mith) + PadEx('=', 18 - Length(IntToStr(Mith))) + '>');
if Iron > 0 then
Writeln('<=Iron Mined :' + IntToStr(Iron) + PadEx('=', 18 - Length(IntToStr(Iron))) + '>');
if Tin > 0 then
Writeln('<=Tin Mined :' + IntToStr(Tin) + PadEx('=', 18 - Length(IntToStr(Tin))) + '>');
if Clay > 0 then
Writeln('<=Clay Mined :' + IntToStr(Clay) + PadEx('=', 18 - Length(IntToStr(Clay))) + '>');
if Gold > 0 then
Writeln('<=Gold Mined :' + IntToStr(Gold) + PadEx('=', 18 - Length(IntToStr(Gold))) + '>');
if Silver > 0 then
Writeln('<=Silver Mined:' + IntToStr(Silver) + PadEx('=', 18 - Length(IntToStr(Silver))) + '>');
if Copper > 0 then
Writeln('<=Copper Mined:' + IntToStr(Copper) + PadEx('=', 18 - Length(IntToStr(Copper))) + '>');
Writeln('<================================>')
end;

procedure RespondBack(Find, Say: TStringArray);
var
I, R: Integer;
begin
for I := 0 to High(Find) do
if InChat(Find[I]) then
begin
Writeln('Found Text:' + Find[I]);
R := Random(High(say) + 1);
Typesend(Say[R]);
Writeln('Responded:' + Say[R]);
exit;
end;
end;

procedure DoResponding;
begin
if (not (LoggedIn)) then Exit;
RespondBack(['hello', 'hi', 'yo', 'Hey'], ['hello', 'hi', 'yo', 'Hey']);
RespondBack(['mining lvls', 'mine lvls'], ['Im ' + IntToStr(Players[CurrentPlayer].level[15]), 'Im ' + IntToStr(Players[CurrentPlayer].level[15]) + '. You?', IntToStr(Players[CurrentPlayer].level[15])]);
RespondBack(['respond', 'talk'], ['what?', 'no', 'why?']);
end;

function ToTab: Integer;
begin
Result := 4;
if GetCurrentTab = 4 then
Result := 5;
end;

function GotPickInInvent: Boolean;
var
I: integer;
begin
for I := 1 to 28 do
if not ExistsItem(I) then
begin
Result := False;
end;
end;

procedure LoadAll_BMP_PickAxes;
begin
BMP_PickAxe[0] := srl_GetBitmap(66); //Rune PickAxe.
BMP_PickAxe[1] := srl_GetBitmap(65); //Adamant PickAxe.
BMP_PickAxe[2] := srl_GetBitmap(64); //Mithral PickAx.
BMP_PickAxe[3] := srl_GetBitmap(63); //Steel PickAxe.
BMP_PickAxe[4] := srl_GetBitmap(62); //Iron PickAxe.
BMP_PickAxe[5] := srl_GetBitmap(61); //Bronze PickAxe.
end;
Function RVar:Integer;
begin
Case ComboBox3.Text of
'Coal':result:=2;//Not real but srl is down
end;
end;

{Function Bank(WhatBank:string; BrokenPick:boolean):boolean;
var
BankTimes, I:integer;
begin
repeat
OpenBankFast(WhatBank);
BankTimes := BankTimes + 1;
Until((BankScreen) or (PinScreen) or (BankTimes = 2));
if (PinScreen) then
begin
InPin(IntToStr(Players[CurrentPlayer].Integers[1]));
Wait(500 + Random(500));
end;
If (BrokenPick) then
begin
if (BankScreen) Then
begin
LoadAll_BMP_PickAxes;
For I := 1 to 6 do
if FindBitMapToleranceIn(BMP_PickAxe[I], X, Y, MIX1, MIY1, MIX2, MIY2, 0) then
Begin
Mouse(x, y, 1, 1, true);
Writeln('Banked the Broken PickAxe.');
wait(1000 + random(100));
end;
For I := 1 to 6 do
if FindBitMapToleranceIn(BMP_PickAxe[I], X, Y, MSX1, MSY1, MSX2, MSY2, 0) then
Begin
Mouse(x, y, 1, 1, true);
Writeln('Took the BEST possible pick out of bank.');
wait(1000 + random(100));
CloseBank;
srl_FreeBitmaps;
Exit;
end else
Writeln('Cannot find a PickAxe - Logging Out!');
Logout;
srl_FreeBitmaps;
Exit;
end;
end;
If (BankScreen) Then
begin
ReportVars[RVar]:=CountItemDTM(Ore)
If Not GotPickInInvent then
Begin
end;
end;
end;}

function LoadAllDTMWalks(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
1: begin //Walk To mine Begins
dtmMainPoint.x := 919;
dtmMainPoint.y := 294;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 919;
dtmSubPoints[0].y := 294;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 921;
dtmSubPoints[1].y := 301;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindFallyRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 907;
dtmSubPoints[2].y := 292;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindFallyRoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 915;
dtmSubPoints[3].y := 287;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindFallyRoadColor;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 930;
dtmSubPoints[4].y := 301;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindFallyRoadColor; ;
dtmSubPoints[4].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
2: begin //Clicks straight road towards the Guild.
dtmMainPoint.x := 948;
dtmMainPoint.y := 238;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 948;
dtmSubPoints[0].y := 238;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 944;
dtmSubPoints[1].y := 247;
dtmSubPoints[1].AreaSize := 2;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindFallyRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 938;
dtmSubPoints[2].y := 245;
dtmSubPoints[2].AreaSize := 2;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindFallyRoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 946;
dtmSubPoints[3].y := 229;
dtmSubPoints[3].AreaSize := 2;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindFallyRoadColor;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 951;
dtmSubPoints[4].y := 222;
dtmSubPoints[4].AreaSize := 2;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindFallyRoadColor;
dtmSubPoints[4].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
3: begin //Clicks in the mining guild area.
dtmMainPoint.x := 1000;
dtmMainPoint.y := 275;
dtmMainPoint.AreaSize := 5;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 1000;
dtmSubPoints[0].y := 275;
dtmSubPoints[0].AreaSize := 5;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 999;
dtmSubPoints[1].y := 282;
dtmSubPoints[1].AreaSize := 5;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindFallyRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 1000;
dtmSubPoints[2].y := 264;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindFallyRoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 1007;
dtmSubPoints[3].y := 281;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindFallyRoadColor; ;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 995;
dtmSubPoints[4].y := 264;
dtmSubPoints[4].AreaSize := 1;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindFallyRoadColor;
dtmSubPoints[4].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
4: begin //Walk to Bank Begins from guild.
dtmMainPoint.x := 920;
dtmMainPoint.y := 307;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 920;
dtmSubPoints[0].y := 307;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 921;
dtmSubPoints[1].y := 283;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindFallyRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 922;
dtmSubPoints[2].y := 298;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindFallyRoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 917;
dtmSubPoints[3].y := 293;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindFallyRoadColor;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 921;
dtmSubPoints[4].y := 315;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindFallyRoadColor;
dtmSubPoints[4].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
5: begin
dtmMainPoint.x := 984;
dtmMainPoint.y := 334;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 984;
dtmSubPoints[0].y := 334;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 983;
dtmSubPoints[1].y := 326;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindFallyRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 991;
dtmSubPoints[2].y := 338;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindFallyRoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 973;
dtmSubPoints[3].y := 330;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindFallyRoadColor;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 966;
dtmSubPoints[4].y := 330;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindFallyRoadColor;
dtmSubPoints[4].Tolerance := 0;
end;
6: begin //Start Of VARROCK WEST MINE WALKING
dtmMainPoint.x := 980;
dtmMainPoint.y := 231;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindVarrockRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 980;
dtmSubPoints[0].y := 231;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindVarrockRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 989;
dtmSubPoints[1].y := 222;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindVarrockRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 965;
dtmSubPoints[2].y := 235;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindVarrockRoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 994;
dtmSubPoints[3].y := 231;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindVarrockRoadColor;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 959;
dtmSubPoints[4].y := 233;
dtmSubPoints[4].AreaSize := 4;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindVarrockRoadColor;
dtmSubPoints[4].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
end;

function FindGuildRockColour: Integer; //Finds the bolders near the front of Guild Exit.
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P: array of Tpoint;
begin
GC := 1850493;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
l := GetArrayLength(P);
for a := 0 to l - 1 do
begin
if rs_OnMinimap(P[a].x, P[a].y) then
begin
TestColor := GetColor(P[a].x, P[a].y);
if SimilarColors(TestColor, GC, 50) then
begin
ColorToRGB(TestColor, Red, Green, Blue);
if InRange(Blue - Green, -62, -2) then
if InRange(Green - Red, -95, -35) then
if InRange(Blue - Red, -127, -67) then
if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
if GetColor(P[a].x, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 2, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y) = TestColor then
if GetColor(P[a].x + 2, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 2) = TestColor then
begin
Result := TestColor;
WaterColor := TestColor;
WriteLn('Guild Rock Colour = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Rock0 Colour!');
Result := 0;
end;

function GuildRockDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 966;
dtmMainPoint.y := 243;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindGuildRockColour;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 966;
dtmSubPoints[0].y := 243;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 1850493;
dtmSubPoints[0].Tolerance := 50;

dtmSubPoints[1].x := 962;
dtmSubPoints[1].y := 241;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 1323373;
dtmSubPoints[1].Tolerance := 50;

dtmSubPoints[2].x := 963;
dtmSubPoints[2].y := 238;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 927321;
dtmSubPoints[2].Tolerance := 50;

dtmSubPoints[3].x := 967;
dtmSubPoints[3].y := 241;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 1323373;
dtmSubPoints[3].Tolerance := 50;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 966;
dtmMainPoint.y := 243;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 1850493;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 966;
dtmSubPoints[0].y := 243;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 1850493;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 962;
dtmSubPoints[1].y := 241;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 1323373;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 963;
dtmSubPoints[2].y := 238;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 927321;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 967;
dtmSubPoints[3].y := 241;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 1323373;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

function NormGuildRockDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 933;
dtmMainPoint.y := 265;
dtmMainPoint.AreaSize := 2;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindGuildNormalRockColour;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 933;
dtmSubPoints[0].y := 265;
dtmSubPoints[0].AreaSize := 2;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindGuildNormalRockColour;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 939;
dtmSubPoints[1].y := 264;
dtmSubPoints[1].AreaSize := 2;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindGuildNormalRockColour;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 924;
dtmSubPoints[2].y := 273;
dtmSubPoints[2].AreaSize := 2;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindGuildNormalRockColour;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 927;
dtmSubPoints[3].y := 266;
dtmSubPoints[3].AreaSize := 2;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindGuildNormalRockColour;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

function ExitGuildMine: boolean;
var
d: integer;
begin
MakeCompass('s');
repeat
D := d + 1;
if FindDTM(GuildRockDDTM, X, Y, MMx1, MMy1, MMx2, MMy2) then
begin
Mouse(X, Y, 10, 10, True);
WriteLn('Walk Main 1. - Complete.');
FFlag(0);
Result := True;
Break;
Exit;
end;
Mouse(674, 97, 15, 15, true);
FFlag(2);
if FindColor(x, y, FindLadderColor, MMx1, MMy1, MMx2, MMy2) then
begin
Mouse(x, y, 5, 5, true);
FFlag(0);
end;
until ((Result = true) or (d = 3));
end;

Procedure WalkToMiningSpot;
var
RockType: string;
begin
RockType := Combobox3.Text;
case RockType of
'Coal': begin
Mouse(583, 74, 15, 15, true);
FFlag(random(3));
end;
'Mith', 'Both':
begin
Mouse(583, 74, 8, 8, true);
FFlag(random(3));
Mouse(580, 87, 6, 6, true);
FFlag(random(3));
Mouse(604, 70, 10, 10, true);
FFlag(random(3));
end;
end;
end;

function WalkToBankFromGuild: boolean;
var
WalkDTM, BankDTMFally, xdx: integer;
begin
MakeCompass('S');
Repeat
Wait(1000+random(1000));
xdx := xdx + 1;
Until(FindColor(x,y,FindFallyRoadColor,MMx1,Mmy1,MMx2,MMy2) or (xdx = 5));
If (xdx = 5) then
begin
Writeln('Couldnt get out of the Guild');
Logout;
end;
WalkDTM := LoadAllDTMWalks(4);
if FindDTM(WalkDTM, X, Y, 552, 52, 608, 120) then
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Walk Main 1. - Complete.');
FFlag(0);
Result := True;
end else
if RadialWalk(FindFallyRoadColor, 281, 237, 77, 1, 1) then
begin
Writeln(' Walk Backup 1. - Complete.');
Result := True;
end else
begin
Result := False;
Writeln(' Walk Backup 1. - Failed. Logging Out.');
FreeDTM(WalkDTM);
if not (Result) then
begin
Logout;
end;
end;
WalkDTM := LoadAllDTMWalks(5);
if FindDTM(WalkDTM, X, Y, 618, 88, 674, 166) then
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Walk Main 1. - Complete.');
FFlag(0);
Result := True;
end else
if RadialWalk(FindFallyRoadColor, 109, 179, 64, 1, 1) then
begin
Writeln(' Walk Backup 1. - Complete.');
Result := True;
end else
begin
Result := False;
Writeln(' Walk Backup 1. - Failed. Logging Out.');
FreeDTM(WalkDTM);
if not (Result) then
begin
Logout;
end;
end;
BankDTMFally := DTMFromString('78DA639CC2C4C060C700064C108AE1CF1F260' +
'65620CD08C4FF8180713E7E3520C0B898B01A0012EB0C9C');
if FindDTM(BankDTMFally, X, Y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y + 5, 6, 2, true);
Writeln('Found Bank DTM');
FFlag(0);
wait(100);
OpenBankFast('feb');
Deposit(2, 28, true);
CloseBank;
end;
end;

function WalkToGuild: Boolean;
var
WalkDTM: integer;
begin
MakeCompass('S');
WalkDTM := LoadAllDTMWalks(1);
if FindDTM(WalkDTM, X, Y, 552, 52, 608, 120) then
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Walk Main 1. - Complete.');
FFlag(0);
Result := True;
end else
if RadialWalk(FindFallyRoadColor, 300, 220, 55, 1, 1) then
begin
Writeln(' Walk Backup 1. - Complete.');
Result := True;
end else
begin
Result := False;
Writeln(' Walk Backup 1. - Failed. Logging Out.');
FreeDTM(WalkDTM);
if not (Result) then
begin
Logout;
end;
end;
WalkDTM := LoadAllDTMWalks(2);
if FindDTM(WalkDTM, X, Y, 593, 6, 630, 55) then
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Walk Main 2. - Complete.');
FFlag(0);
Result := True;
end else
if RadialWalk(FindFallyRoadColor, 311, 372, 65, 1, 1) then
begin
Writeln(' Walk Backup 2. - Complete.');
Result := True;
end else
begin
Result := False;
Writeln(' Walk Backup 2. - Failed. Logging Out.');
FreeDTM(WalkDTM);
if not (Result) then
begin
Logout;
end;
end;

WalkDTM := LoadAllDTMWalks(3);
if FindDTM(WalkDTM, X, Y, 649, 7, 703, 115) then
begin
Mouse(X + 4, Y, 8, 8, True);
WriteLn('Walk Main 3. - Complete.');
FFlag(0);
Result := True;
end else
begin
Result := False;
Writeln(' Walk Backup 3. - Failed. Logging Out.');
FreeDTM(WalkDTM);
if not (Result) then
begin
Logout;
end;
end;
end;

function FindGuildLadder(up: Boolean): Boolean;
var
P, PP: TPointArray;
AP: T2DPointArray;
I, x, y: Integer;
UpText: string;
begin
case Up of
True: UpText := 'limb-u';
False: UpText := 'limb-d';
end;
FindColorsSpiralTolerance(MSCX, MSCY, P, 2307133, MSX1, MSY1, MSX2, MSY2, 5)
AP := TPAtoATPAEx(P, 30, 30)
SetArrayLength(PP, GetArrayLength(AP))
for I := 0 to High(AP) do
PP[I] := MiddleTPA(AP[I]);
MouseSpeed := 30;
for I := 0 to High(PP) do
begin
MMouse(PP[I].x, PP[I].y, 3, 3)
wait(50)
if IsUpText(UpText) then
begin
Result := True;
GetMousePos(x, y)
Mouse(x, y, 0, 0, True);
FFlag(0);
Exit;
end;
end;
end;

Procedure WalkBesideThaWall(Direction: string; Xmod: integer);
var //Base of Zeph.
centrex, centrey, XmodROFL, YmodROFL: integer;
begin
centrex := 627;
centrey := 85;
case Lowercase(Direction) of
's': begin
XmodROFL := 3;
YmodROFL := -40;
end;
'n': begin
XmodROFL := -18;
YmodROFL := -45;
end;
end;
if Direction = 's' then
begin
if (FindSymbol(x, y, 'mining spot')) then
Exit;
end;
if (FindColorSpiralTolerance(x, y, WallColour, MMX1, MMcy, MMcx, mmY2, 50)) then
begin
Mouse(centrex + XmodROFL - xMod, centrey + YmodROFL, 8, 5, true);
FFlag(random(3));
end;
end;

function LadderWalk(WhatWalk: integer): boolean;
begin
case WhatWalk of
1: begin
Result := FindColor(x, y, FindLadderColor, 666, 19, 706, 91);
if (Result) then
begin
Mouse(x + 25, y - 10, 5, 15, true);
wait(3000);
FFlag(random(3));
end;
end;
2: begin
Result := FindColor(x, y, FindLadderColor, 594, 67, 647, 129);
if (Result) then
begin
mouse(x + 18, y - 30, 5, 10, true);
FFlag(Random(3));
end;
end;
3: begin
Result := FindColor(x, y, FindLadderColor, 635, 25, 704, 93);
if (Result) then
begin
Mouse(x + 20, y, 5, 5, true);
FFlag(random(3));
end;
end;
4: begin
Result := FindColor(x, y, FindStoneColor, MMx1, MMy1, MMx2, MMy2);
if (Result) then
begin
Mouse(x, y, 5, 5, true);
FFlag(0);
end;
end;
end;
end;

function FindWestRocks: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 925;
dtmMainPoint.y := 419;
dtmMainPoint.AreaSize := 4;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindStoneColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 925;
dtmSubPoints[0].y := 419;
dtmSubPoints[0].AreaSize := 4;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindStoneColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 925;
dtmSubPoints[1].y := 415;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindStoneColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 933;
dtmSubPoints[2].y := 419;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindStoneColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 934;
dtmSubPoints[3].y := 414;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindStoneColor;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 928;
dtmSubPoints[4].y := 413;
dtmSubPoints[4].AreaSize := 4;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindStoneColor;
dtmSubPoints[4].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
Procedure MouseRock(dx, dy: integer; RockType, Wherendbank: string; modx, mody: integer; Click: boolean);
var
dx1, dy1: integer;
begin
case Lowercase(Wherendbank) of
'vwb', 'vwmtobank':
begin
case LowerCase(RockType) of
'clay':
begin
dx := 615;
dy := 47;
end;
'silver', 'iron':
begin
dx := 619;
Dy := 26;
end;
'tin':
begin
dx := 614
Dy := 42
end;
end;
Mouse(dx, dy, modx, mody, click);
FFlag(random(3));
end;
'vwm', 'vwmtomine':
begin
case LowerCase(RockType) of
'clay':
begin
dx := 597;
dy := 118;
dx1 := 619;
dy1 := 134;
end;
'silver', 'iron':
begin
Exit;
end;
'tin':
begin
dx := 633;
Dy := 75;
dx1 := 646;
dy1 := 89;
end;
end;
MouseBox(dx, dy, dx1, dy1, 1);
FFlag(random(3));
end;
end;
end;

function WalkWestMine: boolean;
var
WalkDTM, TimesX: integer;
RockType: string;
begin
RockType := Combobox3.Text;
MakeCompass('S');
WalkDTM := LoadAllDTMWalks(6);
if FindDTM(WalkDTM, X, Y, 618, 7, 704, 79) then
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Walk Main 1. - Complete.');
FFlag(0);
Result := True;
end else
if findcolor(x, y, FindVarrockRoadcolor, 618, 7, 704, 79) then
begin
Mouse(x, y, 5, 5, true);
end;

Writeln('Relocating Player');
if FindColor(x, y, FindLadderColor, 613, 40, 702, 88) then
begin
Mouse(x + 20, y - 10, 5, 15, true);
FFlag(random(3));
end;
repeat
WalkBesideThaWall('s', 8);
WalkBesideThaWall('s', 8);
if FindColor(x, y, FindLadderColor, 625, 42, 639, 95) then
begin
Mouse(x + 20, y - 10, 5, 15, true);
FFlag(random(3));
end;
WalkBesideThaWall('s', 20);
WalkBesideThaWall('s', 5);
TimesX := TimesX + 1;
until (FindSymbol(x, y, 'mining spot') or (FindColor(x, y, FindStoneColor, MMx1, MMy1, MMx2, MMy2)) or (TimesX = 3));
if FindColor(x, y, FindStoneColor, MMx1, MMy1, MMx2, MMy2) then
begin
Mouse(x, y + 8, 10, 5, true);
FFlag(0);
if FindDTM(FindWestRocks, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 5, 5, true);
FFlag(0);
end;
MouseRock(x, y, RockType, 'vwm', 5, 5, true);
Exit;
end else
if FindSymbol(x, y, 'mining spot') then
begin
Mouse(x, y, 10, 10, true);
FFlag(0);
if FindDTM(FindWestRocks, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 5, 5, true);
FFlag(0);
end;
MouseRock(x, y, RockType, 'vwm', 5, 5, true);
end;
end;


Procedure WalkWestBank;
var
RockType: string;
BankDTM: integer;
begin
RockType := Combobox3.Text;
MouseRock(x, y, RockType, 'vwb', 5, 5, true);
WalkBesideThaWall('n', -6);
if FindColor(x, y, FindLadderColor, 594, 26, 642, 86) then
begin
Mouse(x - 25, y, 5, 15, true);
FFlag(random(3));
end;
WalkBesideThaWall('n', -12);
WalkBesideThaWall('n', -15);
WalkBesideThaWall('n', -15);
if findcolor(x, y, FindVarrockRoadcolor, 640, 18, 703, 88) then
begin
Mouse(x, y, 5, 5, true);
Exit;
end;
BankDTM := DTMFromString('78DA63CC666260F06400031608C5F0F62D030' +
'317906604E2FF40C09805541388AAE6CF1F26B81A10600499E388' +
'5B0D080300EE700C1D');
if FindDTM(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x + 9, y, 1, 6, true);
FFlag(0);
FreeDTM(BankDTM);
end;
end;

procedure HitRock(Kind: string);
var
Id, x, y: integer;
begin
if (not (LoggedIn)) then Exit;
case LowerCase(Kind) of
'tin' : Id := 2;
'copper': Id := 12;
'iron' : Id := 3;
'coal' : Id := 18;
'mith' : Id := 15;
'clay' : Id := 0;
'silver': Id := 13;
end;
FindObjRock(x, y, ID);
If Not FindGas(x, y) then Mouse(x, y, 5, 5, True);
end;

function RelocatePlayer(Where: string):boolean;
begin
case LowerCase(Where) of
'mine': begin
if FindSymbol(x, y, 'mining site') then
begin
Mouse(x, y, 8, 8, true);
FFlag(random(3));
Result := True;
end else
Mouse(655, 100, 8, 8, true);
FFlag(random(3));
Result := True;
end;
end;
end;

Procedure FindPlayerStuck;
begin
if (TimeFromMark(Notminingtime) > 12000) then
begin
if RelocatePlayer('mine') then Exit;
Players[CurrentPlayer].Active:=False;
Logout;
end;
end;


procedure Mine1(Kind: string);
var
MineTime: integer;
begin
if (not (LoggedIn)) then Exit;
Item := 1;
repeat
HitRock(Kind);
MarkTime(MineTime);
FindPlayerStuck;
Item := Item + 1;
FindNormalRandoms;
while not (ExistsItem(Item)) or not (TimeFromMark(MineTime) > 5000) do
begin
//NoBan;
//DoResponding;
wait(1000);
end;
until (invfull)
end;

procedure MiningGuild;
begin
wait(3000);
repeat
{ WalkToGuild;
FindGuildLadder(False);
wait(100 + random(500));
FFlag(0);
WalkToMiningSpot; }
repeat
Mine1(Combobox3.Text);
until (Invfull or not loggedIn);
if not loggedin then
Break;
ExitGuildMine;
FindGuildLadder(True);
repeat
wait(1000);
until (FindColor(x, y, FindFallyRoadColor, MMx1, MMy1, MMx2, MMy2));
WalkToBankFromGuild;
until (not loggedin)
end;

procedure VEM;
begin
end;

procedure VWM;
begin
repeat
WalkWestMine;
repeat
Mine1(Combobox3.Text);
until (Invfull or not loggedIn);
WalkWestBank;
until (not loggedin)
end;

Procedure Powermine;
begin
repeat
Mine1(Combobox3.Text);
DropAll;
until (not loggedin)
end;

begin
FormIt;
Setupsrl;
Intro;
ActivateClient;
LoadRockRecords;
if Combobox2.Text = 'Mining Guild' then
MiningGuild;
if Combobox2.Text = 'VEM' then
VEM;
if Combobox2.Text = 'VWM' then
VWM;
if Combobox2.Text = 'PowerMine' then
Powermine;
FreeForm(Form1)
end.

Mjordan

2008-11-23 09:15:39

What exactly is this? Just a MEGA miner right?

MylesMadness

2008-11-23 09:37:29

Correct

Claymore

2008-11-24 00:43:58

Interesting, i don't think SRL's water finding function is broken.

Daniel

2008-11-24 05:29:55

From: Deathscytex
Interesting, i don't think SRL's water finding function is broken.

It used to be.

Also, Myles, do you know how to use For loops? Cos' you could use them a lot in the Intro procedure ;)

MylesMadness

2008-11-24 15:12:53

[QUOTE=Dan's The Man;503850]It used to be.

Also, Myles, do you know how to use For loops? Cos' you could use them a lot in the Intro procedure ;)The newest peace of coding in there is 6 months old. The intro was the first thing I did. Maybe a year ago.

noidea

2008-11-24 15:40:17

I hate For loops. They tell me there going to fffk up the script.

Daniel

2008-11-25 02:35:38

From: noidea
I hate For loops. They tell me there going to fffk up the script.

Why? They pwn!

NiCbaZ

2008-11-25 14:33:12

Why would you hate for loop there very usefull for things like this….


function N_WhatAxe: String;
var
cts,I,Z : Integer;
TPA: TPointArray;
T : Integer;
H : TBox;
Col: TIntegerArray;

begin
T := GetCurrentTab;
If T <> 4 then
GameTab(4);
H := InvBox(1);
Col := [791905,6313793,4478276,5914173];
For I:= 0 to High(col) do
begin
if FindColorsTolerance(TPA,Col[I], h.X1, h.Y1, h.X2, h.Y2 , 15) then
if Length(TPA) > 20 then
begin
Z:= I + 1;
Break;
end;
end;
case z of
1: Result:= 'dragon';
2: Result:= 'rune';
3: Result:= 'addy';
4: Result:= 'mith';
end;
end;

Sorry for Offtopic


Script looks nice, if its 1 year old will need lots of updating tho.

mastaraymond

2008-11-25 15:04:42

While\Repeat loops > For loops.. (In delphi).

noidea

2008-11-25 15:57:13

Yay mastaraymond agrees! I know Nicbaz, I use them in TPA's, because that the only way I know how to make TPA's.

footballjds

2008-11-28 09:50:03

cmon myles why don't you finish it?! it'd be great script! :)

Santa_Clause

2008-11-28 21:57:37

I thought I had already made a form for this script? Or is my memory being stupid again?

MylesMadness

2008-11-29 11:33:38

From: Santa_Clause
I thought I had already made a form for this script? Or is my memory being stupid again?
You did but we were in the middle of a revamp, and when we finished we lost your code :P