SRL Archive - Archive

Nava2 - SRL Member Application Form


Nava2

2008-05-12 18:53:31

<!– BEGIN TEMPLATE: formanswers –>
Nava2 - SRL Member Application Form
Nava2

What is the meaning to life?


Where you Referred to SRL? If yes, by whom?
yes
XxXx Toxin XxXx reffered me.

Programming Knowledge
Nope sorry, but the answer to life is 42. :D

Other Communitys
RuneScape community; a clan site.

How Long have You Played Runescape
5+ years.

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

My experience with Scar started back in classic. I was a DEFINITE leecher, only using scripts my cousins friends got me.

After the Massive ban; I stopped autoing.

About two months ago, unsure of the time, I decided to start autoing again.

I leeched for about two weeks then decided to start to write a script. I started writing a ShiloFisher script; it was too hard so I decided to write this mining script.

Since then I have written it and gone through many tribulations.

Thats my experience with scar…

Personally, I love the challenge of learning new things, I enjoy doing things like scripting. I lead a great social life and work as well as goto high school full time. As you may know, anytime someone needs help on the forums, I try to help if I can. I learnt well from doing that and believe that others learn from my help! :)

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted

{|=========================================================================|
|| ||
|| Welcome to ||
|| Nava2's Falador West Miner! ||
|| ||
||========================================================================||
|| ||
|| REQUIREMENTS ||
|| Scar: 3.15 ||
|| SRL Revision: 16 ||
|| RS Status: P2P ||
|| ||
||========================================================================||
|| ||
|| Please be sure to Fill in everything ||
|| correctly. ||
|| ||
|| MultiPlayer now should work; please test. ||
|| ||
|| If Banking Start in Fally West Bank, if ||
|| Powering start at the mine. ||
|| ||
||========================================================================||
|| ||
|| Special Thanks to: ||
|| Coh3n ||
|| XxXx Toxin XxXx ||
|| Hermpie <- Best Tutor Ever! and Helper ||
|| Timer <- Fix0r of t3h 3rr0rz ||
|| Skilld U <- Great guy; helped a lot. ||
|| MylesMadness <- Tested some things ||
|| Bullzeye95 <- First person to give me ||
|| a thorough review! <3 ||
|| And anyone I forgot :) ||
|| ||
||========================================================================||
|| ||
|| Questions or Comments? ||
|| Please post on my Thread! :) ||
|| Any corrections are appreciated! ||
|| ||
||========================================================================|}


program FallyWestIronMiner;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Mining.scar}
const

// Fill in the Following:

{-SRL Stats-}

SRL_ID = ''; // SRL Stats ID Number NOT YOUR FORUMS ACCOUNT
SRL_PASS = ''; // SRL Stats Password

{-Maximums-}

TMaxTime = 0; // Maximum Time in Minutes. 0 is infinite.
TMaxLoads = 0; // Maximum amount of loads to Mine. 0 is infinite.
TMaxOres = 0; // Maximum amount of Ores to Mine. 0 is infinite.

PMaxTime = 0; // Maximum Time in Minutes per player. 0 is infinite.
PMaxLoads = 0; // Maximum amount of loads to Mine per player. 0 is infinite.
PMaxOres = 0; // Maximum amount of Ores to Mine per player. 0 is infinite.

{-AntiBan/Randoms-}

LampSk = 'Mining'; // Use Magic Lamp on What Skill?

FirHovSk = 'Mining'; // Hover over Skill
SecHovSk = 'Smithing'; // Hover over Skill

ChangeMusic = true; // Set to false if you don't want the script to change music volumes.

ChatModes = true; // Allow script to turn off necessary chats?

AutoResponder = true; // Use AutoResponder?

SleepPlayer = true; // Use Random Sleeps?
SleepEvery = 10; // if Sleeping, sleep how often?

{-Smart-}

SMARTworld = 0; // World, 0 is random.
Signed = true; // Use signed Java?

{-Standards-} // Don't change unless you get errors.

MSpeed = 12; // Mouse Speed. Default recommended. Changes throughout script.

IronColor = 2503506; // Iron Vein color
RockColor = 1725027; // Rock Color

{-Don't Touch Below unless you know what you are using.-}

VersionN = 0.15;
UseRev = 16;
UseVer = 315;

Debugging = false; // Use debugging? Not useful to normal users! :)

var
x, y, k: integer;
DTM, MineDTM, SCFMDTM, SCFBDTM, DDTMCount1, DDTMCount2, DDTMCount3: integer;
PickDTM: Array [0..5] of integer;
PRunTimeS, PRunTimeR: Array of integer;
TLoads, TOres, PLoads, POres, TRunTime, MiningWaitTime: integer;
RespondTime, TempTimeRunning, SleepTime, SleepEv, ActiveLength, RandomsN, AntiBanN, RespondsN, TXp: integer;
DirtRoad, FallyRoad, StoneColor, WldLvl, PickaxeT, PickaxeColor: integer;
OldMessage: string;
KS: Boolean;

procedure DeclarePlayers;
begin
HowManyPlayers := 1; {Change if adding more Players, see below}
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'Username'; {Your RuneScape Username}
Players[0].Pass := 'Password'; {Your Password}
Players[0].Nick := 'erna'; {3-4 letters of your RuneScape username NON-CAPITALIZED!}
Players[0].Pin := '0000'; {Enter Your Bank Pin here, '0000' used for no Bank Pin}
Players[0].Active := True; {Use this Player? True for YES, False for NO}
Players[0].booleans[0] := true; {True is banking, false is power.)

{==================== Use MultiPlayer? ====================}
{ }
{ Fill out the following form, delete all // }
{ at the beginning of each line. Also, for }
{ more than one extra player, make sure the }
{ numbers are in consecutive order. (0,1,2...) }
{==========================================================}

// Players[1].Name := 'username'; {Your RuneScape Username}
// Players[1].Pass := 'password'; {Your Password}
// Players[1].Nick := 'nick'; {Four letters of your RuneScape username NON-CAPITALIZED!}
// Players[1].Pin := '0000'; {Enter Your Bank Pin here, '0000' used for no Bank Pin}
// Players[1].Active := True; {Use this Player? True for YES, False for NO}
// Players[1].booleans[0] := false; {True is banking, false is power.)

end;


{-- D O N O T T O U C H B E L O W H E R E ! ! ! --}


{*******************************************************************************
procedure SetDDTM
By: Nava2
Description: Sets up DDTMs used in the scripts.
*******************************************************************************}

procedure SetSCFBDDTM;
var SubPoints: array[0..2] of TDTMPointDef;
MainPoint : TDTMPointDef;
SCFBTDTM: TDTM;

begin
MainPoint.x:=20;
MainPoint.y:=12;
MainPoint.areasize:=1
MainPoint.areashape:=0;
MainPoint.color:=FallyRoad;
MainPoint.tolerance:=0;

SubPoints[0].x:=27;
SubPoints[0].y:=10;
SubPoints[0].areasize:=1;
SubPoints[0].areashape:=0;
SubPoints[0].color:=15265269;
SubPoints[0].tolerance:=10;

SubPoints[1].x:=13;
SubPoints[1].y:=16;
SubPoints[1].areasize:=1;
SubPoints[1].areashape:=0;
SubPoints[1].color:=15265269;
SubPoints[1].tolerance:=10;

SubPoints[2].x:=13;
SubPoints[2].y:=10;
SubPoints[2].areasize:=1;
SubPoints[2].areashape:=0;
SubPoints[2].color:=15265269;
SubPoints[2].tolerance:=10;

SubPoints[3].x:=27;
SubPoints[3].y:=15;
SubPoints[3].areasize:=1;
SubPoints[3].areashape:=0;
SubPoints[3].color:=15265269;
SubPoints[3].tolerance:=10;

SCFBTDTM.MainPoint := MainPoint;
SCFBTDTM.SubPoints := SubPoints;
SCFBDTM := AddDTM(SCFBTDTM)
end;

procedure SetSCFMDDTM;
var SubPoints: array[0..2] of TDTMPointDef;
MainPoint : TDTMPointDef;
SCFMTDTM: TDTM;

begin
MainPoint.x:=21;
MainPoint.y:=20;
MainPoint.areasize:=1
MainPoint.areashape:=0;
MainPoint.color:=DirtRoad;
MainPoint.tolerance:=0;

SubPoints[0].x:=27;
SubPoints[0].y:=15;
SubPoints[0].areasize:=1;
SubPoints[0].areashape:=0;
SubPoints[0].color:=15265269;
SubPoints[0].tolerance:=10;

SubPoints[1].x:=13;
SubPoints[1].y:=16;
SubPoints[1].areasize:=1;
SubPoints[1].areashape:=0;
SubPoints[1].color:=15265269;
SubPoints[1].tolerance:=10;

SubPoints[2].x:=13;
SubPoints[2].y:=10;
SubPoints[2].areasize:=1;
SubPoints[2].areashape:=0;
SubPoints[2].color:=15265269;
SubPoints[2].tolerance:=20;

SCFMTDTM.MainPoint := MainPoint;
SCFMTDTM.SubPoints := SubPoints;
SCFMDTM := AddDTM(SCFMTDTM)
end;

procedure SetMineDDTM;
var SubPoints: array[0..2] of TDTMPointDef;
MainPoint : TDTMPointDef;
MineTDTM: TDTM;

begin
MainPoint.x:=89;
MainPoint.y:=92;
MainPoint.areasize:=1
MainPoint.areashape:=0;
MainPoint.color:=1385789;
MainPoint.tolerance:=255;

SubPoints[0].x:=84;
SubPoints[0].y:=99;
SubPoints[0].areasize:=1;
SubPoints[0].areashape:=0;
SubPoints[0].color:=2572660;
SubPoints[0].tolerance:=10;

SubPoints[1].x:=90;
SubPoints[1].y:=95;
SubPoints[1].areasize:=1;
SubPoints[1].areashape:=0;
SubPoints[1].color:=StoneColor;
SubPoints[1].tolerance:=0;

SubPoints[2].x:=89;
SubPoints[2].y:=88;
SubPoints[2].areasize:=1;
SubPoints[2].areashape:=0;
SubPoints[2].color:=StoneColor;
SubPoints[2].tolerance:=0;

MineTDTM.MainPoint := MainPoint;
MineTDTM.SubPoints := SubPoints;
MineDTM := AddDTM(MineTDTM)
end;

{*******************************************************************************
procedure DeclareDTM(Which: String);
By: Nava2
Description: Declares the DTM which is specified by the string Which as DTM.
*******************************************************************************}

procedure DeclareDTM(Which: string);
begin

case Which of

'Bankers' : DTM := DTMFromString('78DA63E4666060606340016FDF426846289F9' +
'10948B033A00146062E643542408283801A6120C18AAAE2EE5D06' +
'543520BB9851D5FCFB278CAA869B08BB406A58D0CDE143510300B' +
'7BC086E');

'IronOre' : DTM := DTMFromString('78DA639CCEC0C020C18002DC7514192481342' +
'310FF0702C676204392010D302291407A3690E021A06619901021' +
'A0663E905020A0660A9050C3AF06005CC408E4');

'PickDTM' : begin

PickDTM:= [DTMFromString('78DA63CC656060E06440013ED6CA0C22409A1' + //Bronze
'188FF0301632C90C1CD8006189148205D09240409A801D9C5865F' +
'0D00B9D606A1'), DTMFromString('78DA639CCEC0C0C0C98002FC3D3D194480342' + //Iron
'310FF0702C67620839B010D302291401A640E1B01358B8184207E' +
'35000B5B0780'), DTMFromString('78DA6394646060D0654001A5B9B90C22409A1' + //Steel
'188FF0301232790A1CF800618914820AD0A244C09A801D9A5855F' +
'0D00C3FC0686'), DTMFromString('78DA6374666060E0644001B6B6910C22409A1' + //Mith
'188FF0301A33190C1CD800618914820ED0F240409A801D9C5865F' +
'0D0092DC0622'), DTMFromString('78DA6394646060E06440018E818E0C22409A1' + //Addy
'188FF0301A32A9021C88006189148200D32839B801A905D6CF8D5' +
'00005D58057A'), DTMFromString('78DA6374626060D0654001F621B10C22409A1' + //Rune
'188FF0301A33F9061CA8006189148206D0C24F409A801D9A5855F' +
'0D00D4AF06CD')];

end;

'BrokenPick' : DTM := DTMFromString('78DA6334676660A8656440058C4824907603A' +
'A2926A0C61BA8A688801A3BA09A4C026A8C806A728950D34A408D' +
'13504D3E7E3500C8FC050A');

'PickHandle' : DTM := DTMFromString('78DA6314656060906440017A0AAC0C22409A1' +
'188FF0301A31490C1CB800618914820CD0F24D408A81102125204' +
'D488030909FC6A00E9ED0557');

'Mine' : if DDTMCount1 = 0 then
begin
MakeCompass('0');
SetMineDDTM;
DDTMCount1 := 1;
end else
DTM := MineDTM;

'ShortcutFB': if DDTMCount2 = 0 then
begin
MakeCompass('0');
SetSCFBDDTM;
DDTMCount2 := 1;
end else
DTM := SCFBDTM;

'ShortcutFM': if DDTMCount3 = 0 then
begin
MakeCompass('0');
SetSCFMDDTM;
DDTMCount3 := 1;
end else
DTM := SCFMDTM;

end;
end;




{-ShortCuts-}

{FindBlackChatMessage}

function BlkText(Text: String):Boolean;
begin
Result:= FindBlackChatMessage(Text);
end;

{FindRotatedDTM}

function MMDTM(WhichDTM: string; var x, y: integer):Boolean;
var z: extended;
begin
result := false;
DeclareDTM(WhichDTM);
if FindDTMRotated(DTM, x, y, MMX1, MMY1, MMX2, MMY2, 0, 2 * pi, 10, z) then
result := true;
if not result then Writeln('Could not find DTM.');
FreeDTM(DTM);
end;

{-Nava2's Clicking Procedure!-}

procedure NMouse(x, y, ranx, rany: integer; Option: string);
begin
GetMousePos(x, y);
case random(5) of
0..3: Mouse(x, y, ranx, rany, true);
4: begin
Mouse(x, y, ranx, rany, false);
Wait(100+random(50));
ChooseOption(Option);
end;
end;
end;

{*******************************************************************************
procedure Time2(t: String, mark: integer): String;
By: Phalanx + RsN, small edit by Hy71194, edit by Nava2
Description: Makes time look pretty :). I added time from Mark as well as
from Total. If doing total; Mark = 0.
*******************************************************************************}

function Time2(t: String; mark: integer): String;
var
RHours, Minutes, Seconds, RMinutes, RSeconds: LongInt;
Time: string;
begin
case Lowercase(t) of
'total': begin
Seconds := GetTimeRunning div 1000;
Time := IntToStr(Seconds) + ' Secs (' + IntToStr(GetTimeRunning) + ')';
end;
'mark': begin
Seconds := TimeFromMark(mark) div 1000;
Time := IntToStr(Seconds) + ' Secs (' + IntToStr(TimeFromMark(mark))+ ')';
end;
end;
Minutes := Seconds div 60;
RHours := Minutes div 60;
if Minutes <> 0 then
begin
RSeconds := Seconds mod (Minutes * 60);
Time := IntToStr(Minutes) + ' Mins and ' + IntToStr(RSeconds) + ' Secs';
end;
if RHours <> 0 then
begin
RMinutes := Minutes mod (RHours * 60);
RSeconds := Seconds mod (Minutes * 60);
Time := IntToStr(RHours) + ' Hrs, ' + IntToStr(RMinutes) + ' Mins, and ' + IntToStr(RSeconds) + ' Secs';
end;
Result := Time;
end;

{-NDB aka Nava2's Debug!-}

procedure NDB(Proc : String);
begin
if Debugging then
Writeln('Debug: '+ Proc + '; Time: ' + Time2('total', 0));
Status(Proc);
end;

{*******************************************************************************
function FindDirtRoadColor2: Integer;
By: Tarajunky edit by Nava2
Description: Autodetects Dirt Road Color on Minimap; Nava2 edit: removed the
FindWaterColor calling; useless for this script, also made it
a bit faster by removing some of the pixels it searchs for.
*******************************************************************************}

function FindDirtRoadColor2: Integer;
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P:TpointArray;
begin
GC := 4548987;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 140);
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, 140) then
begin
red := (TestColor mod 256);
green := ((TestColor / 256) mod 256);
blue := ((TestColor / 256) / 256);
if Red - Green <= 33 then if Red - Green >= 5 then if Red <= 120 then
if Green - Blue >= 17 then if Green - Blue <= 58 then
if Blue <=45 then if Red - Blue >= 30 then if Red - Blue <= 75 then
if GetColor(P[a].x +3 , P[a].y + 3) = TestColor then
if GetColor(P[a].x - 3, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y - 3) = TestColor then
if GetColor(P[a].x - 3, P[a].y + 3) = TestColor then
begin
Result := TestColor;
WriteLn('Dirt Road Color = ' +
IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Dirt Road Color!');
Result := 0;
end;

{*******************************************************************************
procedure AntiBan;
By: Nava2
Description: Basic AntiBan Functions
*******************************************************************************}

procedure AntiBan;
var g: integer;
begin
AntiBanN := AntiBanN + 1;
NDB('AntiBan');
case random(90) of
0: RandomRClick;
1: BoredHuman;
2: HoverSkill(FirHovSk, False);
3: AlmostLogout;
4: PickUpMouse;
5: HoverSkill(SecHovSk, False);
6: begin
g:= GetCurrentTab;
GameTab(RandomRange(1, 8));
Wait(1000+random(500));
GameTab(g);
end;
7: begin
if not ChangeMusic then Exit;
g:= GetCurrentTab;
Gametab(13);
Wait(150+random(100));
case random(3) of
0: SetBar('area',random(5));
1: SetBar('volume',random(5));
2: SetBar('effect',random(5));
end;
Wait(150+random(100));
Gametab(g);
end;
8: DoEmote(random(37));
end;
end;

{*******************************************************************************
procedure FindRandoms
By: Nava2
Description: Find Normal Randoms and Fights, runs away, and back.
*******************************************************************************}

procedure FindRandoms;
var z: integer;
begin
if not Debugging then NDB('FindRandoms');
FindNormalRandoms;
if FindPick then RandomsN := RandomsN + 1;
if FindFight then
begin
RunAway('W', true, 1, 15000 + random(5000));
if not FindColor(x, y, IronColor, MSX1, MSY1, MSX2, MSY2) then
repeat
MarkTime(z);
MMDTM('Mine', x, y);
MMouse(x, y, 5, 5);
Wait(100+random(50));
Mouse(x, y, 2, 2, true);
FFlag(0);
until FindColor(x, y, IronColor, MSX1, MSY1, MSX2, MSY2) or (TimeFromMark(z) > 10000);
RandomsN := RandomsN + 1;
end;
if GasFound(x, y) then
begin
AntiBan;
Wait(22000+random(10000));
RandomsN := RandomsN + 1;
AntiBan;
end;
end;

{*******************************************************************************
procedure ChatMode;
By: Nava2
Description: Turns off Private chat!
*******************************************************************************}

procedure ChatMode;
begin
if not ChatModes then Exit;
NDB('ChatMode');
case random(2) of
0: begin
SetChat('on', 1);
SetChat('off', 2);
SetChat('on', 3);
SetChat('on', 4);
SetChat('on', 5);
end;
1: begin
SetChat('on', 5);
SetChat('on', 4);
SetChat('on', 3);
SetChat('off', 2);
SetChat('on', 1);
end;
end;
end;

{*******************************************************************************
function DigitGroup(MyNumber: integer) string;
By: PriSoner edit by Bullzeye95
Description: Formats an integer into groups of 3 seperated by commas and returns
a formatted string. i.e "1234567" would become "1,234,567".
I know there is probably an easier way of doing this and probably
an existing function. i just can not remember it!
*******************************************************************************}

function DigitGroup(MyNumber: integer): string;
var b: integer;
a, c: string;
begin
a := IntToStr(MyNumber);
b := length(a) + 1;
c := ',';
if b > 4 then
repeat
b := b - 3;
if b > 1 then insert(c, a, b);
until b < 3;
result := a;
end;

{*******************************************************************************
function InChatAr(Text: TStringArray): Boolean;
By: WT-Fakawi - Changed to include Array of text by Nava2
Description: Grabs Last Chat Line and performs checks on occurence of text
*******************************************************************************}

function InChatAr(Text: TStringArray): Boolean;
var
i: integer;
s: string;
begin
for i := 0 to Length(Text) - 1 do
begin
if (not (GetLastChatText(s))) then LastChatter(s);
Text[i] := Lowercase(Text[i]);
Result := (Pos(Text[i], s) > 0);
if Result then Break;
end;
end;


{- Forwarded Procedures for functionality! :) -}
function SetupBasics: boolean; forward;
function SetupPlayer: Boolean; forward;
procedure PlayerReport(Fi: boolean); forward;
function FailSafes:Boolean; forward;
procedure Spc(text: string); forward;

{*******************************************************************************
function WeLost(Location: String): Boolean;
By: Nava2
Description: Checks if lost at location.
*******************************************************************************}

function Welost(Location: String):boolean;
begin
NDB('WeLost');
result := false;
FailSafes;
FindRandoms;
case Lowercase(Location) of
'mining' : begin
MakeCompass('N');
if not FindSymbol(x, y, 'mining site') then
begin
MakeCompass('S');
if not FindSymbol(x, y, 'Mining site') then
begin
result := true;
exit;
end;
end;
end;
end;
if result then
begin
Players[CurrentPlayer].Loc := ('Lost while ' + Location);
NDB('Lost ' + Location);
PlayerReport(true);
exit;
end;
end;

{*******************************************************************************
procedure AutoRespond;
By: Nava2
Description: Responds to assorted text. Will NOT respond to itself.
*******************************************************************************}

procedure AutoRespond;
var CurrentMessage, name: string;
begin
if (not AutoResponder) or (TimeFromMark(RespondTime) >= 50000) then exit;
GetLastChatText(CurrentMessage);
if CurrentMessage = OldMessage then exit;
OldMessage := CurrentMessage;
LastChatter(Name);
if Lowercase(Name) = Lowercase(Players[CurrentPlayer].name) then exit;
case random(4) of

0..2: begin

if InChatAr(['mining', 'level', 'mine', 'lvl']) then
begin
case random(5) of
0: TypeSend(IntToStr(Players[CurrentPlayer].Integers[1]));
1: TypeSend(IntToStr(Players[CurrentPlayer].Integers[1]) + ' hbu?');
2: TypeSend(IntToStr(Players[CurrentPlayer].Integers[1]) + ' you?');
3: TypeSend('I just got ' + IntToStr(Players[CurrentPlayer].Integers[1]) + ' u?');
4: TypeSend('I''m almost ' + IntToStr(Players[CurrentPlayer].Integers[1] + 1) + ', hby?');
end;
RespondsN := RespondsN + 1;
RespondTime := 0;
MarkTime(RespondTime);
exit;
end;

if InChatAr(['hi', 'hey', 'yo', 'sup', 'heya', Lowercase(Capitalize(Players[CurrentPlayer].name)), Lowercase(Players[CurrentPlayer].nick)]) then
begin
case random(5) of
0: TypeSend('heya :)');
1: TypeSend('Hi...');
2: TypeSend('hey');
3: TypeSend('?');
4: TypeSend('what ... ?');
end;
RespondsN := RespondsN + 1;
RespondTime := 0;
MarkTime(RespondTime);
exit;
end;

if InChatAr(['lol', 'haha', 'hehe', 'lawl', 'rofl', 'l0l']) then
begin
case random(6) of
0: TypeSend('Ha.');
1: TypeSend('wtf');
2: TypeSend('lol');
3: TypeSend('hehe');
4: TypeSend('rofl');
5: TypeSend('roflmfao');
end;
RespondsN := RespondsN + 1;
RespondTime := 0;
MarkTime(RespondTime);
exit;
end;
end;
end;

end;


{*******************************************************************************
function PickaxeFind: integer;
By: Nava2
Description: Finds PickAxe in inventory, or wielded. Returns the integer
of the pickaxe found.
*******************************************************************************}

function PickaxeFind: integer;
var i: integer;
begin
NDB('PickaxeFind');
result:= 6;
GameTab(4);
DeclareDTM('PickDTM');
for i := 0 to 5 do
if FindDTM(PickDTM[i], x, y, 547, 202, 737, 466) then
begin
if CoordsToItem(x, y) <> 1 then
begin
DragItem(CoordsToItem(x, y), 1);
Spc('Silly Billy,');
Spc('I told you to put your pick in the first.');
end;
Wait(500+random(250));
result := i;
k := 2;
end;

if result = 6 then
begin
GameTab(5);
for i := 0 to 5 do
if FindDTM(PickDTM[i], x, y, 547, 202, 737, 466) then
begin
Wait(500+random(250));
result := i;
k := 1;
end;
GameTab(4);
end;
for I:= 0 to 5 do
FreeDTM(PickDTM[I]);
end;

{*******************************************************************************
procedure PickaxeType(Head:integer):String;
By: Nava2
Description: Finds which pickaxe, declares max MiningWaitTime, the level
to wield the pickaxe, and results in the type of PickAxe.
*******************************************************************************}

function PickaxeType(head:integer):String;
begin
NDB('PickaxeType');
PickaxeT := head;
case head of
0: begin
result := 'Bronze Pickaxe';
PickaxeColor := 2308940;
MiningWaitTime := 8000;
WldLvl := 1;
end;

1: begin
result := 'Iron Pickaxe'
PickaxeColor := 4473929;
MiningWaitTime := 8000;
WldLvl := 1;
end;

2: begin
result := 'Steel Pickaxe';
PickaxeColor := 6908273;
MiningWaitTime := 7000;
WldLvl := 5;
end;

3: begin
result := 'Mithril Pickaxe';
PickaxeColor := 5848381;
MiningWaitTime := 6000;
WldLvl := 20;
end;

4: begin
result := 'Addy Pickaxe';
PickaxeColor := 4083262;
MiningWaitTime := 5000;
WldLvl := 30;
end;

5: begin
result := 'Rune Pickaxe';
PickaxeColor := 6708293;
MiningWaitTime := 4000;
WldLvl := 40;
end;
end;
end;

{*******************************************************************************
procedure FindEmptyInv: integer;
By: Nava2
Description: Finds the last empty inventory spot.
*******************************************************************************}

function FindEmptyInv: integer;
begin
NDB('FindEmptyInv');
if InvEmpty then result := 1;
if FailSafes or InvFull then
begin
NDB('FindEmptyInv B');
result := 0;
exit;
end;
for result := k to 28 do
begin
if not ExistsItem(result) then
begin
NDB('FindEmptyInv C');
break;
end;
end;
end;

{*******************************************************************************
procedure DropItems(l: integer);
By: Nava2
Description: Drops items in slots k to l. k is defined else where.
*******************************************************************************}

procedure DropItems(l: integer);
var i, TMSpeed: integer;
begin
NDB('DropItems');
FailSafes;
TMSpeed := MouseSpeed;
MouseSpeed := 20 + random(5);
for i:= k to l do
if ExistsItem(i) then
begin
FindRandoms;
MouseItem(i, False);
Wait(170 + Random(50));
ChooseOption('rop');
Wait(RandomRange(50, 200));
end;
MouseSpeed := TMSpeed;
end;

{*******************************************************************************
function FindIron(var x, y: integer):boolean;
By: Nava2
Description: Searchs for iron vain, then if it finds rock colors around it
it returns an x and y co-ord.
*******************************************************************************}

function FindIron(var x, y: integer):Boolean;
var
RockTPA, IronTPA: TPointArray;
IronRock, RealRock: T2DPointArray;
H1, H2, i, z, TCTS: integer;
begin
NDB('FindIron');
if FailSafes or InvFull then Exit;
TCTS := GetColorToleranceSpeed;
if(not(TCTS = 2))then ColorToleranceSpeed(2);
FindColorsSpiralTolerance(x, y, IronTPA, IronColor, MSX1, MSY1, MSX2, MSY2, 6);
IronRock := TPAtoATPAEx(IronTPA, 20, 20);
H1 := High(IronRock);
for i := 0 to H1 do
begin
MiddleTPAEx(IronRock[i], x, y);
FindColorsSpiralTolerance(x, y, RockTPA, RockColor, x - 10, y - 10, x + 10, y + 10, 6)
RealRock := TPAtoATPAEx(RockTPA, 10, 10);
H2 := High(RealRock);
for z := 0 to H2 do
begin
MiddleTPAEx(RealRock[z], x, y);
MMouse(x, y, 4, 4);
if not FindColorSpiralTolerance(x, y, IronColor, x - 20, y - 20, x + 20, y + 20, 6) then exit;
Result := IsUpText('ine');
if GasFound(x, y) then
begin
AntiBan;
Wait(22000+random(10000));
AntiBan;
end;
if Result then Break;
if not Result then Wait(1000+random(500));
end;
end;
if Result then
GetMousePos(x, y);
ColorToleranceSpeed(TCTS);
end;

{*******************************************************************************
procedure MineTheRock;
By: Nava2
Description: Mines Iron until Inventory is Full.
*******************************************************************************}

procedure MineTheRock;
var MWTime, ESpot: integer;
begin
WeLost('Mining');
NDB('MineTheRock A');
MarkTime(MWTime);
FindRandoms;
Failsafes;
if InvFull then exit;
FFlag(0);
if GasFound(x, y) then
begin
AntiBan;
Wait(22000+random(10000));
AntiBan;
end;
FindRandoms;
if FindIron(x, y) then
begin
NMouse(x, y, 0, 0, 'ine');
FFlag(0);
FindPick;
ESpot := FindEmptyInv;
if (ESpot = 0) or InvFull then exit;
while not (ExistsItem(ESpot) or BlkText('urrently') or (TimeFromMark(MWTime) > MiningWaitTime)) do
begin
FindRandoms;
FailSafes;
Wait(50+random(50));
end;
FindRandoms;
FailSafes;
NDB('MineTheRock B');
end;
end;

{*******************************************************************************
procedure PowerMine;
By: Nava2
Description: Runs PowerMine procedure, mines iron, and drops!
*******************************************************************************}

procedure PowerMine;
var ABCount, z: integer;
begin
ABCount := 0;
SetRun(true);
FailSafes;
NDB('PowerMine A');
if not FindSymbol(x, y, 'Mine Spot') then
begin
Writeln('I told you to start at the mine; Switching Players.');
Players[CurrentPlayer].Loc := 'Player not at mine.';
exit;
end;
repeat
ABCount := ABCount + 1;
if (ABCount = 5+ random(5)) then
begin
AntiBan;
ABCount := 0;
end;
FailSafes;
repeat
if not (Players[CurrentPlayer].Loc = '') then
begin
PlayerReport(true);
Exit;
end;
FindRandoms;
MinetheRock;
until InvFull or FailSafes;
NDB('PowerMine C');
if InvFull then
begin
MouseSpeed := MSpeed + Random(5) - random(5);
FindRandoms;
FailSafes;
AntiBan;
DeclareDTM('IronOre');
z := CountItemsDTM('inventory', DTM);
TOres := TOres + z;
POres := POres + z;
ReportVars[1] := ReportVars[1] + z;
DropItems(28);
TLoads := TLoads + 1;
PLoads := PLoads + 1;
ReportVars[0]:= ReportVars[0] + 1;
PlayerReport(false);
FreeDTM(DTM);
end;
until FailSafes;
NDB('PowerMine D');
end;

{*******************************************************************************
function WalkToShortCut: Boolean;
By: Nava2
Description: Walks from Bank to Shortcut.
*******************************************************************************}

function WalkToShortCut: boolean;
var Mark1, tries: integer;
begin
if FailSafes then exit;
NDB('WalkToShortCut');
MakeCompass('N');
result := true;
FallyRoad := FindFallyRoadColor;
if not MMDTM('ShortCutFB', x, y) then
begin
FindSymbol(x, y, 'Short cut');
MMouse(x, y, 4, 4);
FindRandoms;
Wait(100+random(150));
Mouse(x, y, 0, 0, true);
if FlagPresent then
begin
MarkTime(Mark1);
repeat
Wait(100+random(50));
until (Failsafes or (TimeFromMark(Mark1) >= 500))
end;
if not MMDTM('ShortCutFB', x, y) then
begin
Tries := 0;
repeat
Writeln('Could not find ShortCut, re-logging in to try again.');
LogOut;
Wait(1000+random(2000));
LoginPlayer;
Tries:= Tries + 1;
until (MMDTM('ShortCutFB', x, y)) or (Tries >= 3);
if (Tries >= 3) then
begin
result := false;
Players[CurrentPlayer].Loc := 'Could not locate Shortcut from Bank.';
exit;
end;
end else
begin
MMouse(x, y, 3, 3);
Wait(100+random(100));
Mouse(x, y, 1, 1, true);
FFlag(2);
end;
end;
DirtRoad := FindDirtRoadColor2;
{RadialWalk(DirtRoad, 230, 290, 65, -1, 0);
MarkTime(Mark2);
if FlagPresent then
begin
FFlag(3);
result := true;
end;
MarkTime(Mark2);
While not FlagPresent or (TimeFromMark(Mark2) >= 1000) do
begin
RadialWalk(DirtRoad, 230, 290, 65, -1, 0);
if FailSafes then break
end;}
end;

{*******************************************************************************
function HandleShortCut(var x1, y1: integer; FromBank: boolean):boolean;
By: Nava2
Description: Finds the crumbled wall shortcut. If it is found it then returns
an x, and y. The FromBank refers to if it is from bank and searchs
for another color accordingly.
*******************************************************************************}

function HandleShortCut(var x1, y1: integer; FromBank: boolean):boolean;
var
Wall1TPA: TPointArray;
Wall1: T2DPointArray;
H1, i, TCTS: integer;
begin
if FailSafes then exit;
NDB('HandleShortcut');
SetAngle(false);
TCTS := GetColorToleranceSpeed;
if(not(TCTS = 2))then ColorToleranceSpeed(2);
if not FindSymbol(x, y, 'Short cut') then
begin
result := false;
Writeln('Not at Shortcut!');
exit;
end;
if FromBank then
begin
MakeCompass('W');
FindColorsSpiralTolerance(x, y, Wall1TPA, 6912133, MSX1 + 165, MSY1 + 150, MSX2 - 165, MSY2 - 150, 5);
end else
begin
MakeCompass('E');
FindColorsSpiralTolerance(x, y, Wall1TPA, 9676986, MSX1 + 165, MSY1 + 150, MSX2 - 165, MSY2 - 150, 5);
end;
Wall1 := TPAtoATPAEx(Wall1TPA, 30, 30);
H1 := High(Wall1);
for i := 0 to H1 do
begin
MiddleTPAEx(Wall1[i], x, y);
MMouse(x, y, 1, 1);
writeln('found wall');
Result := IsUpText('limb');
if Result then Break;
end;
if Result then
begin
GetMousePos(x, y);
x1 := x;
y1 := y;
Result := true;
end;
ColorToleranceSpeed(TCTS);
end;

{*******************************************************************************
function BankToMine: Boolean;
By: Nava2
Description: Walks from the Bank to the Mine.
*******************************************************************************}

function BankToMine: boolean;
var Walks1: integer;
c: string;
begin
result := false;
if GetMMLevels('Energy', c) >= 50 then
begin
SetRun(true);
end else SetRun(false);
if WalkToShortcut then
begin
if HandleShortCut(x, y, true) then
begin
NMouse(x, y, 1, 1, 'limb');
repeat
RadialWalk(DirtRoad, 340, 20, 65, 1, 0);
FFlag(randomrange(0, 4));
until FailSafes or FindSymbol(x, y, 'Mining Spot') or (Walks1 >= 4) or FindColor(x, y, 1920374, MMX1, MMY1, MMX2, MMY2) or MMDTM('Mine', x, y);
StoneColor := FindStoneColor;
if MMDTM('Mine', x, y) then
begin
MMouse(x, y, 3, 3);
Wait(100+random(150));
Mouse(x, y, 1, 1, true);
FFlag(1);
result := true;
end else
begin
RadialWalk(1920374, 350, 10, 75, 0, -1); // click in mine
FFlag(2);
end;
end;
end;
end;

{*******************************************************************************
function MineToBank: Boolean;
By: Nava2
Description: Walks from the Mine to the Bank.
*******************************************************************************}

function MineToBank: boolean;
var Walks1: integer;
begin
NDB('MineToBank');
MakeCompass('E');
SetRun(false);
result := false;
repeat
RadialWalk(DirtRoad, 340, 20, 65, 0, -1);
FFlag(randomrange(0, 4));
FindRandoms;
until FailSafes or FindSymbol(x, y, 'Short Cut') or (Walks1 >= 4) or MMDTM('ShortCutFM', x, y);
if MMDTM('ShortCutFM', x, y) then
begin
MMouse(x, y, 3, 3);
Wait(100+random(150));
Mouse(x, y, 1, 1, true);
FFlag(2);
end else
begin
RadialWalk(FallyRoad, 340, 20, 65, 0, -1);
FFlag(randomrange(0, 4));
end;
FindRandoms;
if HandleShortCut(x, y, false) then
begin
NMouse(x, y, 1, 1, 'limb');
result:= true;
end;
end;

{*******************************************************************************
function BankTheOres: boolean;
By: Nava2
Description: Enters bank, then banks the iron ores.
*******************************************************************************}

function BankTheOres: boolean;
var z, i: integer;
begin
if FailSafes then exit;
if not FindBank('fwb') then exit;
if PinScreen then
begin
if not Players[CurrentPlayer].Pin = '0000' then
InPin(Players[CurrentPlayer].Pin);
end;
DeclareDTM('IronOre');
z := CountItemsDTM('inventory', DTM);
POres := POres + z;
TOres := TOres + z;
ReportVars[1] := ReportVars[1] + z;
FreeDTM(DTM);
if BankScreen then
begin
for i:= k to 28 do
if ExistsItem(i) then
begin
MouseItem(i, false);
case random(10) of
0..8: ChooseOption('ll');
9: begin
ChooseOption('X');
Wait(100+random(150));
TypeSend(IntToStr(RandomRange(29 - k, 200)));
end;
end;
end;
CloseBank;
TLoads := TLoads + 1;
PLoads := PLoads + 1;
ReportVars[0]:= ReportVars[0] + 1;
PlayerReport(false);
result := true;
end;
if BankScreen then CloseBank;
AntiBan;
FindRandoms;
end;

{*******************************************************************************
function BankMine: boolean;
By: Nava2
Description: MainLoop for Banking. Walks to Mine; mines a full load; walks
to bank; banks; then repeats.
*******************************************************************************}

procedure BankMine;
var ABCount: integer;
c: string;
begin
NDB('BankMine');
repeat
if not FindSymbol(x, y, 'Bank') then
begin
Writeln('I told you to start at the bank; Switching Players.');
Players[CurrentPlayer].Loc := 'Player not in Bank.';
exit;
end;
if not BankToMine then
begin
Players[CurrentPlayer].Loc := 'Lost Walking to Mine';
PlayerReport(true);
exit;
end;
ABCount := 0;
if GetMMLevels('Energy', c) >= 50 then SetRun(true) else SetRun(false);
FailSafes;
FindRandoms;
NDB('BankMine A');
FailSafes;
repeat
if not (Players[CurrentPlayer].Loc = '') then
begin
PlayerReport(true);
Exit;
end;
ABCount := ABCount + 1;
if (ABCount = 5 + random(5)) then
begin
AntiBan;
ABCount := 0;
end;
FindRandoms;
MinetheRock;
until InvFull or FailSafes;
if InvFull then
begin
if not MineToBank then
begin
Players[CurrentPlayer].Loc := 'Lost Walking from Mine to Bank';
PlayerReport(true);
exit;
end;
BankTheOres;
MouseSpeed := MSpeed + Random(5) - random(5);
end;
until FailSafes;
end;

{*******************************************************************************
procedure Spc(Text: String), Header(Title: String), and Footer(Title: String);
By: Nava2
Description: Spc: Creates lines to make a nice looking Debug Report.
Header: Writes Header for Reports etc. With Title!
Footer: Writes Footer for Reports etc. With Title!
*******************************************************************************}

procedure Spc(Text: String);
begin
Writeln(Padr(' | ' + Text, 48) + '|');
end;

procedure Header(Title:String);
begin
if Debugging then exit;
Writeln('~Written at ' + TheTime + ', on ' + TheDate(1) + '.~');
Writeln('*/-============================================-\*');
Spc(' Nava2s Falador West Iron Miner');
Spc(' ' + Title);
Spc(' Version ' + FloattoStr(VersionN));
end;

procedure Footer(Title:String);
begin
if Debugging then exit;
Spc('');
Spc(' End of ' + Title);
Spc(' Nava2s Falador West Iron Miner');
Writeln('*\-============================================-/*')
end;

{*******************************************************************************
procedure News;
By: Nava2
Description: Shows News for this version!
*******************************************************************************}

procedure News;
begin
Header('News Report');
Spc('');
Writeln(' | There are several bugs, they are:');
Writeln(' | * Doesn''t drop entire inventory (Only happens with lag; sorry not my fault :( )');
Writeln(' | * GasFinding isn''t great. Please post screenshots of gas when you get it!');
Writeln(' | * The amount of randoms solved is very wrong...');
Writeln(' | * Banking is in first stages; let me know the walking errors.');
Writeln('');
Writeln(' | * IF ANYONE HAS A MEMBERS ACC I CAN TEST ON PLEASE LET ME KNOW!');
Spc('');
Spc(' Please post proggies! :)');
Footer('News Report');
end;

{*******************************************************************************
procedure Signature;
By: Nava2
Description: Title Says it :)
*******************************************************************************}

procedure Signature;
var i: integer;
begin
if Debugging then exit;
for I:= 1 to 3 do
begin
ClearDebug;
Writeln(' _______ ________ ')
Wait(100);
Writeln(' \ \ _____ ___ _______ \_____ \ ')
Wait(100);
Writeln(' / | \\__ \\ \/ /\__ \ / ____/ ')
Wait(100);
Writeln(' / | \/ __ \\ / / __ \_/ \ ')
Wait(100);
Writeln(' \____|____(______/\_/ (______/\_______ \')
Wait(100);
if i = 2 then Writeln(' \/ ©');
if i = 3 then Writeln(' Fally West Iron Miner \/ ©');
Wait(100);
end;
News;
Wait(500);
end;

{*******************************************************************************
procedure SleepyTime
By: Nava2
Description: Sleeps for designated times. The time gets greater the longer
the player is running.
*******************************************************************************}

procedure SleepyTime;
var a, b, c: integer;
begin
if not SleepPlayer then exit;
if (not TimeFromMark(ActiveLength) >= (SleepEv * 60000)) then exit;
a := TimeFromMark(PRunTimeR[CurrentPlayer]);
b := a - RandomRange(60000, 120000);
LogOut;
Writeln('Sleeping for ' + Time2('Mark', b));
for c := 0 to 6 do
begin
Wait(b div 6);
if FailSafes then exit;
end;
LoginPlayer;
ActiveLength := 0;
MarkTime(ActiveLength);
SleepEv := SleepEvery + random(300000);
end;

{*******************************************************************************
procedure MultiPlayerReport;
By: Nava2
Description: Shows the progess of the players who are active.
*******************************************************************************}

procedure MultiPlayerReport;
var i: integer;
active: string;
begin
if (HowManyPlayers = 1) then exit;
Header('Multi-Player Report');
for i := 0 to HowManyPlayers - 1 do
begin
if Players[i].active = true then
begin
Active := 'T';
end else
Active := 'F';
Writeln(' |-============================================-| ');
Writeln(IntToStr(i) + ': ' + Players[i].nick + ' = ' + Active + '; ' + Time2('Mark', PRunTimeS[i])
+ 'Lvl: ' + IntToStr(Players[i].Integers[1]));
Writeln(' |-============================================-| ');
end;
Footer('Multi-Player Report');
end;

{*******************************************************************************
function FailSafes:Boolean;
By: Nava2
Description: Checks if maximum values have been met. Returns true if they are met.
Script then writes Final Player Report and exits;
Also checks for minor failsafes:
Checks if Logged in;
Checks FindPick;
Checks if the script should Sleep;
*******************************************************************************}

function FailSafes:Boolean;
begin
if not Debugging then NDB('FailSafes (Begin)');
Result := False;

if (TMaxTime > 0) and (TMaxTime <= ((GetTimeRunning div 1000) div 60)) then
begin
Players[CurrentPlayer].Loc := 'Maximum Time Limit Reached.';
NDB('FailSafes (TTime)');
PlayerReport(true);
Result := True;
KS := True;
Exit;
end;

if (TMaxLoads > 0) and (TMaxLoads <= TLoads) then
begin
Players[CurrentPlayer].Loc := 'Maximum Loads Completed.';
NDB('FailSafes (TLoads)');
PlayerReport(true);
Result := True;
KS := True;
Exit;
end;

if (TMaxOres > 0) and (TMaxOres <= TOres) then
begin
Players[CurrentPlayer].Loc := 'Maximum amount of Ores mined.';
NDB('FailSafes (TOres)');
PlayerReport(true);
Result := True;
KS := True;
Exit;
end;

if (PMaxTime > 0) and (PMaxTime <= ((TimeFromMark(PRunTimeR[CurrentPlayer]) div 1000) div 60)) then
begin
Players[CurrentPlayer].Loc := 'Maximum Time Limit for Player ' + Players[CurrentPlayer].name + ' Reached.';
NDB('FailSafes (PTime)');
PlayerReport(true);
Result := True;
Exit;
end;

if (PMaxLoads > 0) and (PMaxLoads <= PLoads) then
begin
Players[CurrentPlayer].Loc := 'Maximum Loads for Player ' + Players[CurrentPlayer].name + ' Completed.';
NDB('FailSafes (PLoads)');
PlayerReport(true);
Result := True;
Exit;
end;

if (PMaxOres > 0) and (PMaxOres <= POres) then
begin
Players[CurrentPlayer].Loc := 'Maximum amount of Ores for Player ' + Players[CurrentPlayer].name + ' mined.';
NDB('FailSafes (POres)');
PlayerReport(true);
Result := True;
Exit;
end;

if not LoggedIn then
begin
NDB('FailSafes (LogIn)');
LoginPlayer;
Result := True
while not LoggedIn do Wait(500+random(250));
if LoggedIn then
begin
Result := false;
Players[CurrentPlayer].Loc := 'Could not login Player.';
end;
Exit;
end;

if not FindPick then
begin
Players[CurrentPlayer].Loc := 'Player could not attach pick head.';
NDB('FailSafes (FindPick)');
PlayerReport(true);
Result := True;
Exit;
end;

SleepyTime;

end;

{*******************************************************************************
procedure PlayerReport(Fi: boolean);
By: Nava2
Description: Player report if Fi is true then its the final report.
*******************************************************************************}

procedure PlayerReport(Fi: boolean);
begin
Writeln('');
Writeln('');
NDB('ProgressReport');
if debugging then exit;
if Fi then Header('Final Progress Report') else Header('Progress Report');
Spc('');
Spc('Player Name: ' + Players[CurrentPlayer].Name);
Players[CurrentPlayer].Integers[1] := GetSkillInfo('Mining', false);
if (Players[CurrentPlayer].Integers[1] > Players[CurrentPlayer].Integers[0]) then Spc('Starting Mining Level: ' + IntToStr(Players[CurrentPlayer].Integers[0]));
Spc('Current Mining Level: ' + IntToStr(Players[CurrentPlayer].Integers[1]));
if Players[CurrentPlayer].Booleans[0] then
begin
if (TLoads > 0) then Spc('Loads Banked: ' + DigitGroup(TLoads));
if (TOres > 0) then Spc('Ores Banked: ' + DigitGroup(TOres));
end else
if (TOres > 0) then Spc('Ores Dropped: ' + DigitGroup(TOres));
Players[CurrentPlayer].Integers[6] := GetXp('Mining');
TXp := Players[CurrentPlayer].Integers[6] - Players[CurrentPlayer].Integers[5];
Spc('Experience Gained: ' + DigitGroup(TXp));
Spc('Total Run Time: ' + Time2('total',0));
if AntiBanN > 0 then Spc('Preformed ' + DigitGroup(AntiBanN) + ' AntiBans.');
//if RandomsN > 0 then Spc('Handled ' + DigitGroup(RandomsN) + ' Randoms.');
if RespondsN > 0 then Spc('Responded ' + DigitGroup(RespondsN) + ' times.');
if Fi then Spc('Reason Ended: ' + Players[CurrentPlayer].Loc);
Spc(' Please Post Progress Reports! Thank You!');
if Fi then Footer('Final Progress Report') else Footer('Progress Report');
MultiPlayerReport;
Disguise('Completed ' + DigitGroup(TLoads) + ' Loads. - Nava2''s Iron Miner');
ReportVars[2] := ReportVars[2] + (TRunTime - TempTimeRunning);
TempTimeRunning := TimeFromMark(TempTimeRunning);
SRLRandomsReport;
SendSRLReport;
end;

{*******************************************************************************
procedure SwitchPlayer;
By: Nava2
Description: Changes players based on different criteria.
*******************************************************************************}

procedure SwitchPlayer;
begin
if LoggedIn then LogOut;
PlayerReport(True);
PRunTimeS[CurrentPlayer] := TimeFromMark(PRunTimeR[CurrentPlayer]) + PRunTimeS[CurrentPlayer];
if not Players[CurrentPlayer].Loc = '' then
begin
NextPlayer(false);
end else
NextPlayer(true);
if not LoggedIn then LoginPlayer;
Players[CurrentPlayer].Loc := '';
Writeln('Switched to Player: ' + Players[CurrentPlayer].name);
SetupPlayer;
end;

{*******************************************************************************
function RandWorld: integer;
By: PriSoner edit by Nava2 to return members only.
Description: Returns a random world number. Uses worlds.ini to get a world count
and check if world is members.
*******************************************************************************}

function RandWorld: integer;
var winipath: String;
rndcount: integer;
begin
winipath := AppPath + 'includes\SRL\SCSS\worlds.ini';
rndcount := StrToInt(ReadINI('Worlds', 'Count', winipath));
repeat
result := Random(rndcount) + 1;
until (ReadINI('World' + IntToStr(result), 'Type', winipath) = 'Members');
writeln('Your Randomly Chosen World is: ' + IntToStr(result));
end;

{*******************************************************************************
procedure SetupPlayer:boolean;
By: Nava2
Description: Sets up player, checks to make sure Mining level is over 15, and
Agility level is over 5 if banking. Returns false if any of the
requirements aren't met.
*******************************************************************************}

function SetupPlayer:boolean;
var i: integer;
begin
NDB('SetupPlayer');
Wait(3000+random(1500));
SetAngle(true);
case random(3) of
0: MakeCompass('N');
1: MakeCompass('W');
2: MakeCompass('E');
end;
if Debugging then
begin
result := true
exit;
end;
Players[CurrentPlayer].Integers[7] := GetSkillInfo('Attack', false);
Header('Setup Player');
Spc('');
Spc('Setting up ' + Players[CurrentPlayer].name + ' :)');
Players[CurrentPlayer].Integers[0] := GetSkillInfo('Mining', false);
Spc('Current Mining Level is ' + IntToStr(Players[CurrentPlayer].Integers[0]) + '.');
Wait(500+random(250));
if (Players[CurrentPlayer].Integers[0] < 15) then
begin
Spc('Please get ' + IntToStr(15 - Players[CurrentPlayer].Integers[0]) + ' more Mining levels.');
Spc('Changing Players.');
Footer('Setup Player');
result := false;
Exit;
end;
if (Players[CurrentPlayer].Booleans[0]) then
begin
Players[CurrentPlayer].Integers[2] := GetSkillInfo('Agility', false);
Spc('Your Agility level is ' + IntToStr(Players[CurrentPlayer].Integers[2]))
if not LoggedIn then Exit;
if (Players[CurrentPlayer].Integers[2] < 5) then
begin
Spc('Please get ' + IntToStr(5 - Players[CurrentPlayer].Integers[2]) + ' more Agility levels.');
Spc('Changing Players.');
Footer('Setup Player');
result := false;
Exit;
end;
end;
i := PickaxeFind;
if (i = 6) then
begin
Spc('Cannot find Pickaxe.');
Spc('Changing Players.');
Footer('Setup Player');
result := false;
Exit;
end;
Spc('Found ' + PickaxeType(i) + '.');
if (Players[CurrentPlayer].Integers[7] > WldLvl) and (k = 2) then
begin
FindDTM(PickDTM[i], x, y, MIX1, MIY1, MIX2, MIY2);
MMouse(x, y, 3, 3);
Wait(100+random(200));
case random(2) of
0: Mouse(x, y, 2, 2, true);
1: begin
Mouse(x, y, 2, 2, false);
ChooseOption('ield');
end;
end;
Spc('Wielded ' + PickaxeType(i) + '.');
end;
Spc('Everything Looks Great');
Spc('Starting Script! :D');
Footer('Setup Player');
Result := true;
ChatMode;
Players[CurrentPlayer].Integers[5]:= GetXp('Mining');
SetBar('brightness', 5);
RespondTime := 0;
MarkTime(RespondTime);
MarkTime(PRunTimeR[CurrentPlayer]);
SleepEv := SleepEvery + random(300000);
end;

{*******************************************************************************
procedure SetupSMART;
Description: Sets up Smart.
*******************************************************************************}

procedure SetupSMART;
var Rnd: integer;
begin
NDB('SetupSmart');
WriteLn('Setting up SMART');
if SMARTWorld = 0 then
begin
Rnd := RandWorld;
SmartSetupEx(Rnd, false, Signed);
end else SmartSetupEx(SMARTWorld, false, Signed);
WriteLn('Please Hold...');
SetTargetDC(SmartGetDC);
while not (SmartGetColor(253, 233) <> 1118604) do wait(100);
end;

{*******************************************************************************
procedure SetupBasics;
By: Nava2
Description: Sets up Basics needed functions for script, SRL Stats, HideScar,
etc.
*******************************************************************************}

function SetupBasics: boolean;
var a, b: integer;
begin
NDB('SetupBasics');
result := true;
SetupSMART;
SetupSRL;
ScriptID := '812';
a := SRLVersionNumber;
if a = 15 then
a := 16;
if (a <> UseRev) then // Idea taken from Hy's caver.
begin
Writeln('Please update your SRL to Rev ' + IntToStr(UseRev) + ' before running this script.');
TerminateScript;
end;
b := GetScarVersion;
if (b <> UseVer) then
begin
Writeln('Please update your Scar version to ' + IntToStr(UseVer) + ' before running this script.');
TerminateScript;
end;
SRLID := SRL_ID;
SRLPASSWORD := SRL_PASS;
if (SRL_ID = '') or (SRL_PASS = '') then
begin
if (SRL_ID = '') then Writeln('Please enter a valid SRL Stats ID.');
if (SRL_PASS = '') then Writeln('Please enter your SRL Stats Password.');
Writeln('Next time, please use a valid SRL ID and Password, if you have one. Starting.');
Writeln('Don''t leach. Use a valid SRL ID and Password.');
TerminateScript;
end;
Disguise('Nava2''s Falador West Miner');
MouseSpeed := MSpeed + Random(5) - random(5);
MarkTime(TRunTime);
MarkTime(ActiveLength);
RandomsN := 0;
AntiBanN := 0;
MineDTM := 0;
SCFBDTM := 0;
SCFMDTM := 0;
TempTimeRunning := 0;
SymbolAccuracy := 0.5;
FindLamp(LampSk);
SRLRandomsReport;
DeclarePlayers;
if Players[CurrentPlayer].Name = 'Username' then
begin
Writeln('Oops! You forgot to change your username!');
Writeln('If this error came up wrongly, Please find this piece of code in SetupBasics and remove it! :)');
result := false;
KS := False;
exit;
end;
if Players[CurrentPlayer].Pass = 'Password' then
begin
Writeln('Oops! You forgot to change your Password!');
Writeln('If your password really is Password,');
Writeln('I STRONGLY suggest you change it!');
Writeln('If you would like to keep that password;');
Writeln('Please find this piece of code in SetupBasics and remove it.');
result := false;
KS := False;
exit;
end;
end;

{*******************************************************************************
procedure MainLoop;
By: Nava2
Description: Main loop which runs script.
*******************************************************************************}

procedure MainLoop;
begin
FailSafes;
if (Players[CurrentPlayer].Booleans[0] = false) then
begin
NDB('MainLoop (Power)');
PowerMine;
end else
begin
NDB('MainLoop (Bank)');
BankMine;
end;
PlayerReport(true);
end;

begin
Signature;
NDB('Script Start');
repeat
if SetupBasics then
begin
ActivateClient;
Wait(2000+random(500));
LoginPlayer;
if SetupPlayer then
begin
Wait(2000+random(1000));
if not (LoggedIn) then exit;
MainLoop;
end;
end;
if (Pos('Player', Players[CurrentPlayer].Loc) <> 0) then
SwitchPlayer;
until (not Pos('Player', Players[CurrentPlayer].Loc) <> 0) or KS;
Logout;
SendSRLReport;
SRLRandomsReport;
NDB('End of Script');
end.

{-Version History-

0.01 - Initial release.
0.02 - Attempted to fix bug which rocks were clicked twice every time they were mined.
0.03 - Redid PickaxeDTM's and fixed double clicking.
0.04 - Small adjustments
Added Pickaxe wielding if not already wielded.
0.05 - Added BlkText function to make reading easier.
Added FailSafes function, creates infinite option, as well as Speeds up Compiling.
0.06 - Added SRL Script Stats
Removed OresPLoad variable.
0.07 - Rewrote FindIron function myself!
Removed Bug where cursor Hovered over dropped ore.
Rearranged some of the procedures for my reading ease.
Fixed the Bug which the Script stopped when there was no ore left in the rock.
Added MineDTM which is a DTM of the iron rocks! (Used in Fighting randoms, and in future banking)
Made the PickaxeFindInv, PickaxeFindWld, and PickaxeFind into one function called PickaxeFind.
0.08 - Removed MakeCompass('S') because it errors when mining.
Replaced ReasonEnded with Players[CurrentPlayer].Loc.
Made IronColor and RockColor constants for easy changing.
Added News Report, and made the header and footer into procedures to shave off some MS.
Assorted small tweaks.
Added ChatModes Antiban, sets Private and Clan chats off.
Changed FindRandoms, edited the FindFight procedure.
Made the Reports Fancier! :) with the addition of the Spc function.
Created FindPick1 function which in theory should reattach pickaxe.
0.09 - Fixed GameTab Error where 0 does not exist.
Tweaked FindIron to search for IronColor after it thinks its found the rock :).
Rearranged some more procedures.
Tweaked WeLost, FindPick1, and FailSafes.
Added many more times where FailSafes is called.
0.10 - Fixed multiple errors through out...
Changed WeLost.
Removed FindPick1 from script. Left the procedure in, will change at some point.
Removed Waits for ores, it will now look for the ore in the next empty invy spot.
Modified DropItems.
Added NDB, which is a Debugging tool for myself.
Added more Failsafes!
Fixed bug which clicked on Walk Here UpText. (Thanks Wizzup?)
Tweaked a lot.
0.11 - Removed several uneeded or broken procedures.
Added FinalPlayerReport to PlayerReport.
Tweaked MineTheRock.
Fixed the mining bug where it clicked away from the rock.
Added RandWorld, which gives a random members world!
Made script move pick to first inventory spot if its not.
Fixed some bugs.
0.12 - Removed some suspicious randomness from the script. The mouse tweaked :).
Added HandleShortcut function.
Added a lot of walking procedures.
Fixed the annoying Could not find ## error.
OMFG BANKING OMFGBBQSAUCE!?!?!
0.13 - Changed a lot of the walking procedure.
Added DDTM of shortcut for accuracy.
Changed DeclareDTM to reduce lag and pull on your system.
Added DDTM's for the shortcut and the mine; needs to be tested.
Added AutoRespond function.
MANY CHANGES THANKS TO BULLZEYE95!
Added MultiPlayer.
Added new FindDirtRoadColor procedure.
0.14 - Stupid Error... I messed up the Colors in the MineDDTM, Fixed.
0.15 - Fixed a bug which caused the script to end because or revision error.
}

:D

——————————————————
<!– END TEMPLATE: formanswers –>

bullzeye95

2008-05-12 18:59:38

Helped him out for a while and reviewed his script. Smart kid. He understands things easily, and has a great attitude. He is always helping people on IRC and on these forums. Yes from me.

Cazax

2008-05-12 19:07:27

Yes. One thing:
function FindIron(var x, y: integer):Boolean;
var
RockTPA, IronTPA: TPointArray;
IronRock, RealRock: T2DPointArray;
H1, H2, i, z, TCTS: integer;
begin
NDB('FindIron');
if FailSafes or InvFull then Exit;
TCTS := GetColorToleranceSpeed;
if(not(TCTS = 2))then ColorToleranceSpeed(2);
FindColorsSpiralTolerance(x, y, IronTPA, IronColor, MSX1, MSY1, MSX2, MSY2, 6);
IronRock := TPAtoATPAEx(IronTPA, 20, 20);
H1 := High(IronRock);
for i := 0 to H1 do
begin
MiddleTPAEx(IronRock[i], x, y);
FindColorsSpiralTolerance(x, y, RockTPA, RockColor, x - 10, y - 10, x + 10, y + 10, 6)
RealRock := TPAtoATPAEx(RockTPA, 10, 10);
H2 := High(RealRock);
for z := 0 to H2 do
begin
MiddleTPAEx(RealRock[z], x, y);
MMouse(x, y, 4, 4);
if not FindColorSpiralTolerance(x, y, IronColor, x - 20, y - 20, x + 20, y + 20, 6) then exit;
Result := IsUpText('ine');
if GasFound(x, y) then
begin
AntiBan;
Wait(22000+random(10000));
AntiBan;
end;
if Result then Break;
if not Result then Wait(1000+random(500));
end;
end;
if Result then
GetMousePos(x, y);
ColorToleranceSpeed(TCTS);
end;
Like weird, Hermpie style, excuse me if im wrong… here is the hermpie style:
Function HOpenBank(WhichBank, WhichDir :String; HPin:Integer):Boolean;
Var
TempTpa: TpointArray;
Temp: T2DPointArray;
H, CTS, I, MSpeed, TempX, TempY, HColor, M:Integer;
Begin
M:=GetSystemTime;
Case LowerCase(WhichBank) Of
'feb','falador east':HColor:= 2243147;//4481401
'fwb','falador west':HColor:= 3496051;//4481401
'veb','varrock east':HColor:= 2050647;//2838878
'vwb','varrock west':HColor:= 1653574;//
'akb','alkharid':HColor:= 738138;
'dnb','draynor':HColor:= 5929095;
'evb','edgevillage':HColor:= 2636871;
'pcb','pestcontrol':HColor:=11647942;
End;
If HColor < 1 Then Writeln('Your Choice Is A Not Existing Bank.');
GameTab(5)
If (lowercase(WhichBank)='dnb') or (lowercase(WhichBank)='draynor') Then MakeCompass('W') else MakeCompass('N');
MSpeed:=MouseSpeed;
MouseSpeed:=30;
if not LoggedIn Then Exit;
CTS := GetColorToleranceSpeed;
If not CTS = 2 Then ColorToleranceSpeed(2);
FindColorsSpiralTolerance(TempX, TempY, TempTPA, HColor, MSX1+10, MSY1+10, MSX2-10, MSY2-10, 5);
Temp:= TPAtoATPAEx(TempTPA, 17, 18);
SortATPASize(Temp, True);
H:=High(Temp);
For I := 0 To H Do
Begin
MiddleTPAEx(Temp[i], TempX, TempY);
MMouse(TempX, TempY, 3, 3);
Wait(30+random(10));
Result:=IsUpText('ank');
If Result Then Break;
End;
If Result Then
Begin
Mouse(TempX, TempY, 0, 0, False);
Wait(40+random(10));
Result:=ChooseOption('uickly');
If Result Then Result:=IsBankOpen(5000,True);
If Pinscreen Then Result:= InPin(InttoStr(HPin));
If Result Then Result:=IsBankOpen(5000,False);
end;
If Result Then Writeln('HOpenBank Succesfully Openend The Bank. In '+IntToStr(GetSystemTime - M)+' MiliSecs.');
If Not result Then Writeln('HOpenBank Did Not Open The Bank. ');
ColorToleranceSpeed(CTS);
MouseSpeed:=MSpeed;
MakeCompass(WhichDir);
End;

Harry

2008-05-12 19:07:31

I helped too :D I vote yes looks fine.

skilld u

2008-05-12 19:07:45

yes. i love you. <3





you are a very quick learner and seem to have grasped the basic SRL stuff.

Nava2

2008-05-12 19:12:53

From: Cazax
Yes. One thing:
Edited out code.
Like weird, Hermpie style, excuse me if im wrong… here is the hermpie style:
Edited out code.


Oh I agree completely. He taught me TPA's. I redid that completely myself, but his style of result works well so I would use it. If you look through the whole thing, there is a lot of influence by Hermpie. He was my first tutor :)

Thanks for the Yes's everyone.

Nava2

P1nky

2008-05-12 23:27:44

i never saw u in srl but , really well organized just hoping people didnt do it for you (helped you alot) but either way it looks good and legit!

Nava2

2008-05-13 08:16:12

From: P1NKY
i never saw u in srl but , really well organized just hoping people didnt do it for you (helped you alot) but either way it looks good and legit!


The most anyone did was bullzeye who did a thorough editing job, and just shaved down the lines as it is HUGE haha :)

Nava2

Pure1993

2008-05-13 08:36:20

Yes, for the reasons which have been named. ^^

ShowerThoughts

2008-05-13 09:44:45

I voted yes because he's weird :p
*Cough*
Special Thanks to:
|| Hermpie <- Best Tutor Ever! and Helper ||
*cough*
:p

Btw this sucks :p the most guys i thought are getting 100% yesses :( and my apply is a shame :(

Richard

2008-05-13 12:41:32

Yes, not only because that script is really good, but because I've seen you around SRL, and you seem to be a great helper to people who are less experienced than you. GL!

Pure1993

2008-05-13 13:07:57

OMFG, I siply hate it when people simply vote "no"… No reason, probably he/she didn't even read the app… i think we should make these votes public, because everyone should state why they are voting which way anyway….

the scar noob

2008-05-13 13:47:30

From: Pure1993
OMFG, I siply hate it when people simply vote "no"… No reason, probably he/she didn't even read the app… i think we should make these votes public, because everyone should state why they are voting which way anyway….


What do you mean with "votes public"? That everyone can see who voted what?

-Tsn.

ShowerThoughts

2008-05-13 14:55:23

From: the scar noob
What do you mean with "votes public"? That everyone can see who voted what?

-Tsn.


Yeah,(o noez)

Nava2

2008-05-13 16:23:31

:( who voted no… I kinda agree with everyone I wanna know why. I don't care much that they voted it. I just want to know why.

Thanks for the Yes's though everyone else.

So, when will I know my status?

Nava2

the scar noob

2008-05-13 17:06:13

From: Nava2
:( who voted no… I kinda agree with everyone I wanna know why. I don't care much that they voted it. I just want to know why.

Thanks for the Yes's though everyone else.

So, when will I know my status?

Nava2


Uhh.. be patience!:) Your application can pend for some more days=D

-Tsn.

Nava2

2008-05-13 20:43:34

From: the scar noob
Uhh.. be patience!:) Your application can pend for some more days=D

-Tsn.


Haha; I don't have much of a choice do I? :)

Nava2

Prince

2008-05-14 02:20:02

Well i havent been around SRL for A WHILE
and i am truly sorry for that, lost intrest in runescape and im going ahead with java, nonetheless i was bored tonite and decided to pop in and say hi!

back on topic:
looks amazing, definetly a better script than i can ever write, i may well get back to runescape, i miss the days of scar scripting :'(

definetly gets a yes from me :D

Nava2

2008-05-14 08:14:52

From: Prince
Well i havent been around SRL for A WHILE
and i am truly sorry for that, lost intrest in runescape and im going ahead with java, nonetheless i was bored tonite and decided to pop in and say hi!

back on topic:
looks amazing, definetly a better script than i can ever write, i may well get back to runescape, i miss the days of scar scripting :'(

definetly gets a yes from me :D


Thanks and welcome back :)

Nava2

ShowerThoughts

2008-05-14 08:41:18

An mod or admin can see who voted no… so.. mod admin?

Negaal

2008-05-14 10:20:19

Sure yes

Camaro'

2008-05-14 10:43:24

From: Negaal
Sure yes


Second that, good luck script NAVA2 :P Hope you get far in SRL.

Wizzup?

2008-05-14 10:47:13

In, Welcome. :)