SRL Archive - S.M.A.R.T. General and Q/A.

Using S.M.A.R.T on Switched Users?


Daniel

2008-01-15 20:03:42

Is it possible to run S.M.A.R.T (Do i have to put the '.'s after every letter?) when your user account is switched?

Thanks for reading and hope someone answer (Which i think they will). And i think i have set S.M.A.R.T up right :p

Timer

2008-01-15 20:29:29

Good Question, I dont know though..

BUMP

Smartzkid

2008-01-15 22:20:13

I think it's fine, the 'glitch' is only in what you are seeing, and it's not in the image SCAR sees.

Atleast that's what Ben told me :p

footballjds

2008-01-15 22:21:24

i think so.. not positive thoug…:p
any how! CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!

Daniel

2008-01-15 22:28:50

From: footballjds
i think so.. not positive thoug…:p
any how! CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!CONGRATS ON MEMBERSHIP!

Thanks for the reply.

btw:THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!THANKS FOR NOTICING!

lol, mine is ten times bigger than yours :p

footballjds

2008-01-15 22:43:52

I agree. maybe i wish i didn't vote for you? withthat kinda spam??
jk…
:rolleyes:

Daniel

2008-01-15 23:01:33

From: footballjds
I agree. maybe i wish i didn't vote for you? withthat kinda spam??
jk…
:rolleyes:

Hmm… Maybe i'll really get you mad by posting SPAM in all your threads. Maybe i will or maybe i won't, tough decision. Hmm.. Nah, just kidding too :spot:

P.S: Like my new avatar i just made?

Markus

2008-01-16 04:51:31

Yes, you can switch safely, only some graphical issues, but nothing that'll interfere with the autoing.

Gratz @ membs btw ;)

Daniel

2008-01-16 05:00:24

From: Markus
Yes, you can switch safely, only some graphical issues, but nothing that'll interfere with the autoing.

Gratz @ membs btw ;)

Thanks for letting me (us) know :)

Thanks Markus :') (<- That means crying with happiness)

But what are the graphical issues, i have a RADEON 9200SE 128mb card, DirectX 9.0c, 3D Acceleration and have 32-bit installed. If that interferes with the issues then i won't do it.

Markus

2008-01-16 05:52:52

The S.M.A.R.T. will flicker a bit, nothing serious. If you minimize S.M.A.R.T. you won't notice anything.

rkroxpunk

2008-01-16 06:29:28

hmm why didn't you just try it and see if it worked instead of waiting for an answer? :rolleyes:

footballjds

2008-01-16 11:11:22

[offtopic]no your avatar is gay[/offtopic]
on a serious note: blank.

Daniel

2008-01-16 18:17:48

From: rkroxpunk
hmm why didn't you just try it and see if it worked instead of waiting for an answer? :rolleyes:

Actually i tried to install S.M.A.R.T in JuKKas Guild Miner and it would even log in. So i don't think i could've tried it myself.

From: footballjds
[offtopic]no your avatar is gay[/offtopic]
on a serious note: blank.

It is not blank, it is an animated SRL. And I'm only a beginner in photo shop.

Dudenow12

2008-01-16 21:32:54

From: IP-Drowner
Actually i tried to install S.M.A.R.T in JuKKas Guild Miner and it would even log in. So i don't think i could've tried it myself.


I'm not sure why it wouldn't log in, but when it would try to run it wouldn't work be cause JuKKa's guild miner is ScarScape only and SMART is not ScarScape.


And when you get back on, after switching accounts,you can press stop blocking and then click start blocking again and that should stop the flickering. I'm pretty sure. :)

Daniel

2008-01-16 21:42:38

From: Dudenow12
I'm not sure why it wouldn't log in, but when it would try to run it wouldn't work be cause JuKKa's guild miner is ScarScape only and SMART is not ScarScape.


And when you get back on, after switching accounts,you can press stop blocking and then click start blocking again and that should stop the flickering. I'm pretty sure. :)
Yes, but the log in procedure is from SRL.

Here is the script of JuKKas Guild Miner modified for S.M.A.R.T:

{
[------------------------------------------------------------------------------]
[ JuKKa's Guild Miner ]
[------------------------------------------------------------------------------]
[ Instructions: ]
[ 1) HowManyLoads = X; <- Enter how many loads per player? ]
[ 2) Enter SRLStats ID And SRLStatsPW or the script WILL NOT WORK!]
[ 3) Declare Your players! ]
[ 4) Place your players in falador east bank! ]
[ 5) Make SURE your first player makes it to the guild! ]
[------------------------------------------------------------------------------]
[ Features: ]
[ 1) Fully autocolor ]
[ 2) Great axe head finder! ]
[ 3) Great antirandoms uptodate with SRL! ]
[ 4) SEXY Mining procedure ]
[ 5) SUPPORTS STOUT! IF YOU HAVE 59 MINING! ]
[ 6) NOW SUPPORTS MITHRIL ORES! ]
[------------------------------------------------------------------------------]
}

Program GuildMiner;
{$Define SMART}
{$IfDef SMART}
{.include SRL/SRL/Misc/Smart.scar}
{$EndIf}
{.Include SRL/SRL.Scar}

Var
MiningSymbolColor, TLostHead, BrokenPicks, GotPick, CoalSearches, Mith, X, Y, Dx, Dy, TStout, ResponceTime, CurrentResponce, CurrentLoad, LadderColor: Integer;
LostHead, TBroken, MiningTol, MiningColor, ScreenShot, Gems, StoutsDrank, RespondedTimes, TRespond, TGas, Gasses, Coal, Gained, Banked: Integer;
PickHeadColors: Array Of Integer;
NoPick, EquipPick, DrinkStout: Boolean;
MiningNow, LastChatterString: String;

Const
HowManyLoads = 99; //How Many Loads Per Player? 3-8 is good.
UseResponder = False; //Use responder?
CheckVersion = True; //Check if script is uptodate? Recommended if your a leecher
TakeScreens = True; //Take Screenshots?
RCMasterNick = ''; //Whos RC Master? Leave blank if none.
SRLStatsID = '1669'; //SRL Stats ID Number, If ur a leecher FUCK OFF.
SRLStatsPW = ''; //SRL Stats PW!, If ur a leecher FUCK OFF.
GasTolerance = 12; //Change if find you broken pickaxes!
MinGasChange = 200; //100+ About 200-300 and more. Basically tolerance.

{-----------------------------------}
CoalRock = 2438710; //3163461; DONT EDIT! }
CoalTolerance = 4; //DONT EDIT! }
MithRock = 5979710; //DONT EDIT! }
MithTolerance = 4; //DONT EDIT! }
Version = 1.7; //DONT EDIT! }
{-----------------------------------}

Procedure DeclarePlayers;
Begin

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

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Booleans[1]:= False; //Mine Mith ores too?
Players[0].Pin := 0000;
Players[0].Active:= True;

Writeln('Starting '+IntToStr(CurrentPlayer)+'/' + IntToStr(HowManyPlayers-1) + '');
End;

Procedure WalkCompass(Compass: String);
Var
ExceededTries: Integer;
Begin
If(Not Loggedin)Then Exit;

Y:= MMCY;

Case LowerCase(Compass) Of
'left': X:= MMCX-35;
'right': X:= MMCX+35;
End;

Repeat
X := X+Random(25)-Random(25);
Y := Y+Random(25)-Random(25);
ExceededTries := ExceededTries + 1;
If(ExceededTries > 50)Then
Begin
Logout;
Players[CurrentPlayer].Loc := 'Error in WalkCompass';
Players[CurrentPlayer].Active := False;
Exit;
End;
Until(rs_OnMinimap(X, Y))Or(Not Loggedin);

Mouse(X, Y, 5, 5, True);
FFlag(10);

End;

Procedure VersionChecker;
Var
NewVersion: String;
Current: Extended;
Begin
If( CheckVersion )Then
Begin
NewVersion:= GetPage('http://freewebs.com/jk2fakefiles/Guildminer/version.txt');
NewVersion := Between('is ',' Thank', NewVersion);
Try
Current := StrToFloat(NewVersion);
Except
Writeln('Error in version checking..');
Exit;
End;
If(Current = Version)Then
Begin
Writeln('You''re up to date! ');
Exit;
End Else
If(Current < Version)Then
Begin
Writeln('Thank you for beta testing ;)');
Exit;
End Else
Begin
Writeln(' Your Version Is '+ FloatToStr(Version)+'. Newest Version Is '+ NewVersion);
OpenWebPage('http://www.villavu.com/forum/showthread.php?t=17826');
TerminateScript;
End;
End;
End;

Procedure Setup;
Var
C, I: Integer;
Begin
ClearDeBug;
Writeln('Successfully compiled');
SetupSRL;
RCMaster := RCMasterNick;
RCSetNick;

LadderColor := 76119;
RoadColor := 6913156;

VersionChecker;

ScriptID := '314';
SRLID := SRLStatsID;
SRLPassword := SRLStatsPW;
If ( SRLID = '' ) Or ( SRLPassword = '' )Then
Begin
Writeln(' You Need a SRL Stats Account, Create One');
OpenWebPage('http://www.stats.srl-forums.com/index.php?action=view_script&id=314');
TerminateScript;
End;
SRLRandomsReport;

DeclarePlayers;

For C:= 0 To HowManyPlayers-1 Do
For I := 0 To 99 Do
Players[C].Integers[I] := 0;
Wait(300);
If(Not Loggedin)Then
LoginPlayer
Else NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick,UpChars);

End;

Procedure AutoRetaliate(Act: Boolean);
Var
Dx, Dy: Integer;
Begin
Gametab(1);
If(FindColorTolerance(Dx, Dy, 2106255, 580, 364, 715, 394, 10))Then
Begin
If(Not Act)Then
Mouse(657, 376, 30, 10, True)
End Else
Begin
If(Act)Then
Mouse(657, 376, 30, 10, True)
End;
End;

Function LoadPick(Style: String; Int: Integer): Integer;
Begin
Case LowerCase(Style) Of
'dtm':
Begin
Case Int Of //Bronze - Rune DTMS!
1: Result := DTMFromString('78DA63DCC0C0C0A0C9800618914820BD19486' +
'81350B38A0835AB81843E11E6E8A2AA30D39264104156B306BF1A' +
'16200600A5500645');
2: Result := DTMFromString('78DA63BCCFC0C050CA800618914820FD08489' +
'4135073134854A2AAB0B3B464E04256731BBF1A269839D5B8ED62' +
'06D1B7F0BB07A406007C420985');
3: Result := DTMFromString('78DA63CC616460286540038C4824904E05B22' +
'A5155448786328820ABC9C0AF068CD38164356EBB98606ACA09A8' +
'C927AC0600C71D0796');
4: Result := DTMFromString('78DA636C646060D06440038C482490AE0612B' +
'AA82A0C0CDC184490D5D4E257C30833471FB75D4C20BA82083520' +
'73B409A86921AC06009DB10633');
5: Result := DTMFromString('78DA638C676060B06740038C4824904E02124' +
'E04D44403096754154676460C5CC86A22F1AB6102D11140C215B7' +
'5DCC30358EF8D5000060E40523');
6: Result := DTMFromString('78DA6394636460F06440038C4824909604B27' +
'C515518397B317021AB11C3AF068CC581A43F6EBB9840B40490E5' +
'4D408D226135000BAF0415');
End
End;
'colors':
Begin
Case Int Of //Bronze - Rune
1: Result:= 1649206;
2: Result:= 3750206;
3: Result:= 5592411;
4: Result:= 4599856;
5: Result:= 3292722;
6: Result:= 5590329;
End
End;
End;
End;

Procedure Returnlevel(Var PickType, Attack, Mining: Integer);
Begin
Case PickType Of
1:
Begin
Attack := 1;
Mining := 1;
End;

2:Begin
Attack := 1;
Mining := 1;
End;

3:Begin
Attack := 5;
Mining := 6;
End;

4:Begin
Attack := 20;
Mining := 21;
End;

5:Begin
Attack := 30;
Mining := 31;
End;

6:Begin
Attack := 40;
Mining := 41;
End;
End
End;

Function AbleToEquipPick(Pick: Integer): Boolean;
Var
LevelAttack, LevelMining: Integer;
Begin
Returnlevel(Pick, LevelAttack, LevelMining);
If(Players[CurrentPlayer].Level[1] >= LevelAttack)And
(Players[CurrentPlayer].Level[15]>= LevelMining)Then
Begin
Result:= True;
Players[CurrentPlayer].Booleans[0]:= True;
End;
End;

function InIntArr(Num: Integer; I: TIntegerArray): Boolean;
var
C: Integer;
begin
for C:= 0 to Length(I) - 1 do
if(I[C] = Num)then
begin
Result:= True;
exit;
end;
end;

procedure ShrinkArray(var Arr: TIntegerArray);
var
Used: TIntegerArray;
I, Index: Integer;
begin
SetLength(Used, Length(Arr));
if(InIntArr(0, Arr))then
Inc(Index);
for I:= 0 to Length(Arr) - 1 do
if(not(InIntArr(Arr[i], Used)))then
begin
Used[Index]:= Arr[i];
Inc(Index);
end;
SetLength(Used, Index);
Arr:= Used;
end;

Function GetPickHeadColors: Boolean;
Var
FailedPick, I, II, PickDTM, PickStyle: Integer;
ColorTPA: TPointArray;
Label
GetPickColors;
Begin
FindNormalRandoms;

GetPickColors:
If(Not Loggedin)Then Exit;

If( EquipPick )Then
GameTab(5)
Else GameTab(4);

Wait(500+Random(500));
For I:= 6 DownTo 1 Do
Begin
PickDTM:= LoadPick('DTM', I);
If(FindDTM( PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
FindColorsTolerance(ColorTPA, LoadPick('Colors', I), X, Y, X+30, Y+30, 10);
For II:= 0 To GetArrayLength(ColorTPA)-1 Do
Begin
SetArrayLength(PickHeadColors, GetArrayLength(PickHeadColors)+1);
PickHeadColors[II]:= GetColor(ColorTPA[II].X, ColorTPA[II].Y);
End;
PickStyle:= I;
Break;
End;
End;

ShrinkArray(PickHeadColors);

For II:= 0 To GetArrayLength(PickHeadColors)-1 Do
Begin
//Writeln('PickHeadColor['+IntToStr(II)+']:= '+IntToStr(PickHeadColors[II])+';');
If( PickHeadColors[II] <> 0)Then
Result:= True;
End;

If(Not Result)Then
Begin
Writeln('Getting NEW pickcolors, Failed');
FailedPick:= FailedPick + 1;
If(FailedPick > 4)Then
Begin
Writeln('Coudlnt get pickcolors');
Players[CurrentPlayer].Loc:='Couldnt get pickcolors';
Logout;
Players[CurrentPlayer].Active:= False;
Exit;
End;
GoTo GetPickColors;
End;

Writeln('Picked '+IntToStr(GetArrayLength(PickHeadColors)) + ' Colors');
Case I Of
1: Writeln('You have a Bronze pick axe');
2: Writeln('You have a Iron pick axe');
3: Writeln('You have a Steel pick axe');
4: Writeln('You have a Mith pick axe');
5: Writeln('You have a Addy pick axe');
6: Writeln('You have a Rune pick axe');
End
FreeDTM( PickDTM );
End;

Procedure EquipCurrentPick;
Var
PickTP: TPoint;
I: Integer;
Begin
If(Not Loggedin)Then Exit;
If(Not EquipPick)Then Exit;

GameTab(5);

For I:= 6 DownTo 1 Do
Begin
PickTP:= EquipmentCoords(5);
If(FindColorTolerance(X, Y, LoadPick('color', I), PickTP.X-30, PickTP.Y-30, PickTP.X+30, PickTP.Y+30, 5))Then
Exit;
End;

GameTab(4);
Wait(500+Random(400));
For I:= 1 To 28 Do
If(ExistsItem(I))Then
Begin
PickTP:= ItemCoords(I);
MMouse(PickTP.X, PickTP.Y, 4, 4);
Wait(50);
GetMousePos(X, Y);
If(IsUpText('ield'))Then
Begin
Mouse(X, Y, 0, 0, True);
Exit;
End;
End;
End;

Function ReturnBestPick: Integer;
Var
PickAxe, PickDTM, I, Pick: Integer;
Begin

For I:= 4 To 5 Do
Begin
GameTab(I);
PickAxe := DTMFromString('78DA63AC646460486540038C482490AE01B23' +
'208A82906B2D209A82902B2B2F1AB010034EE038A');
If(FindDTM(PickAxe, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
For Pick := 6 DownTo 1 Do
Begin
PickDTM := LoadPick('dtm', Pick);
If(FindDTM( PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Result:= Pick;
FreeDTM(PickDTM);
FreeDTM(PickAxe);
Exit;
End;
End;
End;
FreeDTM ( PickAxe );
End;

If(Result = 0)Then
Begin
Writeln('Error Pick');
Logout;
Players[CurrentPlayer].Active:= False;
End;
End;

Procedure InitPlayer;
Begin
CurrentLoad:= 0;
DrinkStout:= False;
If(Not Loggedin)Then Exit;

Wait(1000+Random(1000));

Autoretaliate(False);

If(GetCombatLevel < 20)Then
Begin
Writeln('Please Level Up Your Charachters in Combat');
Logout;
Players[CurrentPlayer].Loc := 'Too Low Level';
Players[CurrentPlayer].Active:= False;
Exit;
End;

Players[CurrentPlayer].Level[1] := GetSkillLevel('attack');
Players[CurrentPlayer].Level[15]:= GetSkillLevel('mining');

If(Players[CurrentPlayer].Level[15]=59)Then
Begin
DrinkStout:= True;
Writeln('Entering Guild with stout');
End Else
If(Players[CurrentPlayer].Level[15] < 59)Then
Begin
Writeln('You need level 60, To enter the guild, Or 59 with stout!');
Players[CurrentPlayer].Loc := 'Not Enough Mining Lvl';
Logout;
Players[CurrentPlayer].Active:= False;
Exit;
End;

AbleToEquipPick(ReturnBestPick);

EquipPick := Players[CurrentPlayer].Booleans[0];
EquipCurrentPick;

If(Not GetPickHeadColors)Then
Begin
Writeln('Couldnt get pick colors, Equip or have in inventory.');
Players[CurrentPlayer].Loc := 'Couldnt Get PickColors';
Logout;
Players[CurrentPlayer].Active:= False;
End;

SetChat('On',1);
SetChat('Off',2);
SetChat('Off',3);
SetChat('Off',4);
SetChat('Off', 5);
HighestAngle;
End;

Function FollowColor(Var X, Y: Integer; Color, Tol: Integer): Boolean;
Var
NoFlag, Fail: Integer;
Begin

MarkTime ( Fail );
If(FlagPresent)Then
Begin

Repeat
If(TimeFromMark( Fail ) > 5000 )Then
Begin
Result:= False;
Break;
End;
Wait(20);
Result:= FindColorSpiralTolerance(X, Y, Color, X-30, Y-30, X+30, Y+30, Tol);
Until(Not FlagPresent) Or (Not Loggedin) Or (Not Result);

If(Result)Then
Begin
MarkTime( NoFlag );
Repeat
Wait(20);
Result:= FindColorSpiralTolerance(X, Y, Color, X-30, Y-30, X+30, Y+30, Tol);
Until(TimeFromMark(NoFlag)>500) Or (Not Loggedin) Or (Not Result);
End;

End Else Result:= True;

End;

Function DetectGas(Var Gx, Gy: Integer): Boolean; Forward;
Procedure TakeScreenShot(Reason: String); Forward;

{Function FindRock(Var X, Y: Integer; Color, Tol: Integer): Boolean;
Var
Fx, Fy, L, I: Integer;
TPA, TPA2: TPointArray;
Begin
If(Not(LoggedIn))Then Exit;
Try
FX := MSCX; FY := MSCY;
FindColorsSpiralTolerance(FX, FY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol+6);
L := GetArrayLength(TPA) - 1;
For I := 0 To L Do
Begin
FindColorsTolerance(TPA2, Color, TPA[i].X - 15, TPA[i].Y - 15, TPA[i].X + 15, TPA[i].Y - 15, Tol+6);
MiddleTPAEx(TPA2, FX, FY);
FindColorsTolerance(TPA2, Color, FX - 25, FY - 25, FX + 25, FY + 25, Tol+6);
If(GetArrayLength(TPA2)-1 >= 15)Then
Begin
MiddleTPAEx(TPA2, X, Y);
If(X > 0)And(Y > 0)Then
If(Not DetectGas(X, Y))Then
Begin
Result := True;
Break;
End;
End Else MMouse(TPA2[I].X, TPA2[I].Y, 0, 0);
End;
Except
Exit;
End;
End;}

Function FindRock(Var X, Y, C, Tol: Integer): Boolean;
Var
L, I, CTS: Integer;
TPA, TPA2: TPointArray;
TP: TPoint;
Begin
If(Not(LoggedIn))Then Exit;
//Tol := 10; //<-- Temporary. comment out this line if u want <--
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, C, MSx1, MSy1, MSx2, MSy2, Tol);
L := GetArrayLength(TPA) - 1;
For I := 0 To L Do
Begin
TP := TPA[i];
X := TP.x;
Y := TP.y;
Try
FindColorsTolerance(TPA2, C, X - 15, Y - 15, X + 15, Y + 15, Tol+5);
MiddleTPAEx(TPA2, X, Y);
FindColorsTolerance(TPA2, C, X - 15, Y - 15, X + 15, Y + 15, Tol+5);
If(GetArrayLength(TPA2)-1 >= 35)Then
Begin
MiddleTPAEx(TPA2, X, Y);
If(X > 0)And(Y > 0)Then
If(Not DetectGas(X, Y))Then
Begin
Result := True;
Break;
End;
End;
Except
Result := False;
End;
End;
ColorToleranceSpeed(CTS);
End;

Function SuccessFullClick(mousex, mousey, ranx, rany: Integer; left: Boolean): Boolean;
var
a, b, c: Integer;
begin
MMouse(mousex, mousey, ranx, rany);
Wait(60 + Random(30));
GetMousePos(b, c);
HoldMouse(b + 1, c, left);
repeat
Wait(20 + Random(30));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, left);

If(FindColor(b, c, 255, b-10, c-10, b+10, c+10))Then
Result:= True;
End;

Function FindRockMiddle: Boolean;
Begin
If(Not Loggedin)Then Exit;
If(InvFull)Then Exit;

If(Players[CurrentPlayer].Booleans[1])And(CoalSearches <= 1)Then
Begin
If(FindColorTolerance(X, Y, MithRock, MSX1, MSY1, MSX2, MSY2, MithTolerance))Then
Begin
MiningColor:= MithRock;
MiningTol:= MithTolerance;
MiningNow:= 'Mith';
End Else
Begin
MiningColor:= CoalRock;
MiningTol:= CoalTolerance;
MiningNow:= 'Coal';
End;
End Else
Begin
MiningColor:= CoalRock;
MiningTol:= CoalTolerance;
MiningNow:= 'Coal';
End;
Status('Missed: '+IntToStr(CoalSearches)+', Now Mining: ' + MiningNow);
If( FindRock ( X , Y , MiningColor, MiningTol ) ) Then
Begin
MMouse(X, Y, 5, 5);
Wait(10);
GetMousePos(X, Y);
If(IsUpText('Mine'))Then
Begin
Case Random(5) Of
0, 1, 2, 3:
Begin
If(SuccessFullClick(X, Y, 0, 0, True))Then
Begin
GetMousePos(Dx, Dy);
If(FollowColor(Dx, Dy, MiningColor, MiningTol))Then
Begin
Result:= True;
Wait(500+Random(500));
End;
End;
End;
4:
Begin
Mouse(X, Y, 0, 0, False);
GetMousePos(Dx, Dy);
Wait(10);
If(ChooseOption('Mine'))Then
If(FollowColor(Dx, Dy, MiningColor, MiningTol))Then
Begin
Result:= True;
Wait(500+Random(500));
End;
End;
End;
End;
End;
End;

Function RockColorExists(Var Dx, Dy, Color, Tolerance: Integer): Boolean;
Begin
Result:= FindColorSpiralTolerance(X, Y, Color, Dx-10, Dy-10, Dx+10, Dy+10, Tolerance);
End;

Procedure TakeScreenShot(Reason: String);
Var
Screen: Integer;
Begin
If(Not Loggedin)Then Exit;

If(TakeScreens)Then
Begin
Try
ScreenShot:= ScreenShot + 1;
Screen:= BitmapFromString(764, 502, '');
CopyClientToBitmap(Screen, MSX1, MSY1, 764, 502);

SaveBitmap(Screen, ScriptPath + IntToStr(ScreenShot) + '' + Reason + '.bmp');
Writeln('ScreenShot: ' + ScriptPath + IntToStr(ScreenShot) + '' + Reason + '.bmp');
FreeBitmap(Screen);
Except
Writeln('Error In ScreenShot');
Exit;
End;
End Else Exit;
End;

Function AttachPick: Boolean;
Var
Ax, Ay, Handle, AxeHead: Integer;
Begin
Handle := DTMFromString('78DA634C61626078CC8002BC9DAC18FE03694' +
'620FE0F048C4940356F18D000231209A4F3806AEE105003B2EB03' +
'0135894035EF895043C01C00F4030DB4');
AxeHead := DTMFromString('78DA637466626078C280024C9D4D19FE03694' +
'620FE0F048CD640352F18D000231209A42D816A9E1150E3886917' +
'861A27A09AC704D4B800D53C24A0C60DA8E63901359E44A871256' +
'C1700B0451030');
GameTab(4);
If(FindDTM(Handle, X, Y, MIX1, MIY1, MIX2, MIY2))And
(FindDTM(AxeHead, AX, AY, MIX1, MIY1, MIX2, MIY2))Then
Begin
FreeDTM(Handle);
FreeDTM(AxeHead);
Mouse(X, Y, 4, 4, False);
If(Not ChooseOption('Use'))Then Exit;
Wait(300+Random(400));
Mouse(AX, AY, 3, 3, True);
Writeln('Pick Attached!');
Wait(300+Random(400));
Result := True;
Exit;
End;
FreeDTM(Handle);
FreeDTM(AxeHead);
End;

Procedure WalkToDropDot;
Begin
X:= MMCX; Y:= MMCY; //Red Drop Dot!
If(FindColorSpiralTolerance(X, Y, 3553023, MMX1, MMY1, MMX2, MMY2, 20))Then
Begin
Case 1+Random(4) Of
1: Mouse(X - 5, Y, 3, 3, True);
2: Mouse(X + 5, Y, 3, 3, True);
3: Mouse(X, Y + 5, 3, 3, True);
4: Mouse(X, Y - 5, 3, 3, True);
End
Flag;
End;
End;

Function FindLostPick: Boolean;
Var
PickHandle, BrokenPick, PickDTM, I, II, III, Tol, Pick: Integer;
PickTPA: TPointArray;
Begin
If(Not Loggedin)Then Exit;

If(InvFull)Then
DropToPosition(1, 2);

BrokenPick := DTMFromString('78DA63DCCBC0C0D0CD800618914820BD1D48F' +
'412A166220135078830E73890984C849AA9F8D50000C33207EA');
PickHandle := DTMFromString('78DA63DCC1C0C0E0C38002CCD51818FE03694' +
'620FE0F048CFB800C170634C0884402E93D40C289809A8D402282' +
'809A2D402212BF1A003B1D0A81');

If( EquipPick )Then
Begin
GameTab(5);
Wait(400+Random(300));
If(FindDTM(BrokenPick, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
TakeOff(5);
NoPick:= True;
Writeln('***** Pick broken *****');
BrokenPicks := BrokenPicks + 1;
TBroken := TBroken + 1;
FreeDTM( BrokenPick );
FreeDTM(PickHandle);
Exit; //Exit Because Broken Pick nothing we can do here..
End Else
If(FindDTM(PickHandle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Writeln('***** Lost PickHead *****');
TakeScreenShot('PickHead');
TakeOff(5);
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
NoPick := True;
End Else
Begin
NoPick := True;
TakeOff(5);
Writeln('Error, Tell Jukka to update his DTMS');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
TerminateScript;
End;
End Else
Begin
GameTab(4);
Wait(400+Random(300));
If(FindDTM(BrokenPick, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
NoPick:= True;
Writeln('***** Pick broken *****');
BrokenPicks := BrokenPicks + 1;
TBroken := TBroken + 1;
FreeDTM( BrokenPick );
FreeDTM(PickHandle);
Exit;
//Exit Because Broken Pick nothing we can do here..
End Else
If(FindDTM(PickHandle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Writeln('***** Lost PickHead *****');
TakeScreenShot('PickHead');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
NoPick := True;
End Else
Begin
Writeln('Error, Tell Jukka to update his DTMS');
FreeDTM(BrokenPick);
FreeDTM(PickHandle);
TerminateScript;
End;

End;

GameTab(4);

WalkToDropDot;
Flag;
Wait(500+Random(400));
MarkTime(Pick);

Repeat
For I:= 0 To GetArrayLength(PickHeadColors)-1 Do
If(PickHeadColors[I] <> 0)Then
Begin
FindColorsSpiralTolerance(X, Y, PickTPA, PickHeadColors[I], MSX1, MSY1, MSX2, MSY2, Tol);
For II:= 0 To GetArrayLength(PickTPA)-1 Do
Begin
X:= PickTPA[II].X; Y:= PickTPA[II].Y;
MMouse(X, Y, 0, 0);
Wait(10);
If(IsUpText('ake'))Then
Begin
Mouse(X, Y, 0, 0, True);
Wait(10);
TakeScreenShot('Found Pick');
Flag;
Wait(500+Random(400));
If(Not AttachPick)Then Break;
GameTab(4);
Wait(500+Random(300));
For III:= 1 To 6 Do
Begin
PickDTM:= LoadPick('DTM', III);
If(FindDTM( PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
If( EquipPick )Then
Mouse(X+8, Y+8, 5, 5, True);
NoPick:= False;
Result:= True;
TakeScreenShot('Pick Attached');
Writeln('***** Found Pick *****');
AxeAttaches := AxeAttaches + 1;
SRLRandomsReport;
FreeDTM(PickDTM);
Exit; //EXIT EVERYTHING!
End Else FreeDTM(PickDTM);
End;
End;
End;
End;
WalkToDropDot;
Flag;
Wait(500+Random(400));
Until(TimeFromMark(Pick)>60000)Or(Result)Or(Not Loggedin);

TakeScreenShot('CantFindHead');
Writeln('***** Lost Head *****');
TLostHead := TLostHead + 1;
LostHead := LostHead + 1;
End;

Function PickCheck: Boolean;
Begin

If(FindColor(X, Y, 16711680, 192, 442, 204, 454))Then
If(FindText(X, Y, 'Pickax', NPCChars, 122, 373, 181, 395))Then
Begin
Writeln('NoPick!');
TakeScreenShot('NO PICK!');
Result:= True;
If(FindLostPick)Then
Result:= False
Else NoPick:= True;
End;

End;

{*******************************************************************************
function GasCheck(gx, gy: Integer): Boolean;
By: piv
Description: Pivs GasChecker.
*******************************************************************************}

function FindGas(gx, gy: Integer): Boolean;
var
clientcanvas, gascanvas1, gascanvas2: TCanvas;
xG, yG, count: Integer;
pic1, pic2: Integer;
begin
if (FindColorTolerance(xG, yG, 8296866, gx - 20, gy - 20, gx + 20, gy + 20,
50)) then
begin
pic1 := BitmapFromString(40, 40, '');
pic2 := BitmapFromString(40, 40, '');
gascanvas1 := GetBitmapCanvas(pic1);
gascanvas2 := GetBitmapCanvas(pic2);
clientcanvas := getclientcanvas;
CopyCanvas(clientcanvas, gascanvas1, gx - 20, gy - 20, gx + 20, gy + 20, 0,
0, 40, 40);
Wait(100);
CopyCanvas(clientcanvas, gascanvas2, gx - 20, gy - 20, gx + 20, gy + 20, 0,
0, 40, 40);
count := 0;
for yG := 1 to 40 do
for xG := 1 to 40 do
if ((gascanvas1.pixels[xG, yG]) <> (gascanvas2.pixels[xG, yG])) then
count := count + 1;
if (count > 150) then //if more than 15% change
Begin
//WriteLn(IntToStr(Trunc(((count) / 1024) * 100)) + '% change.');
Result := True;
End;
FreeBitmap(pic1);
FreeBitmap(pic2);
end;
end;

Function InString(Text1, Text2: String): Boolean;
Begin
Result:= (Pos(LowerCase(Text2), LowerCase(Text1)) <> 0);
End;
Procedure Rest;Begin If(InString(TheLine, 'SRL'))Then TypeSend('Im');End;
Function Responder: Boolean;
Var
Responce: Array [0..9] of String;
NewLine: String;
Label
ResponceLabel;
Begin
If(Not Loggedin)Then Exit;
Rest;
If(Not UseResponder)Then Exit;

If(TimeFromMark(ResponceTime)<1000)Then Exit;
MarkTime(ResponceTime);

If(Not LastChatter(LastChatterString))Then Exit;

If(InString(LastChatterString, Players[CurrentPlayer].Nick))Then Exit;

OldLine:= TheLine;
GetLastChatText(TheLine);
NewLine:= TheLine;

If(OldLine = TheLine)Then Exit;

If(InString(TheLine, 'hi')) Or (InString(TheLine, 'ello')) Or (InString(TheLine, 'yo'))Then
Begin
Responce[0]:= 'Hi';
Responce[1]:= 'Hello';
Responce[2]:= 'Hello there';
Responce[3]:= 'Hello, how are you?';
Responce[4]:= 'What is up?';
Responce[5]:= 'Good Evening';
Responce[6]:= 'Hey, welcome to the guild =)';
Responce[7]:= 'Welcome to the magnificent mining guild :)';
Responce[8]:= 'Hi Hi';
Responce[9]:= 'Hi there';
Result:= True;
GoTo ResponceLabel;
End;

If(InString(TheLine, 'mining lvl')) Or (InString(TheLine, 'mining lev')) Or (InString(TheLine, 'mining lv'))Then
Begin
Responce[0]:= IntToStr(Players[CurrentPlayer].Level[15]);
Responce[1]:= IntToStr(Players[CurrentPlayer].Level[15]) +', You?';
Responce[2]:= IntToStr(Players[CurrentPlayer].Level[15])+ ' lol';
Responce[3]:= 'Currently ' +IntToStr(Players[CurrentPlayer].Level[15]);
Responce[4]:= 'right now ' +IntToStr(Players[CurrentPlayer].Level[15]);
Responce[5]:= 'Almost at ' +IntToStr(Players[CurrentPlayer].Level[15]+1);
Responce[6]:= 'I am on the hiscores, you can check it out :)';
Responce[8]:= 'I can''t talk, i''m sorry but i am muted. I wish i could help.';
Responce[9]:= 'I''m on the hiscores, check me out.';
Result:= True;
GoTo ResponceLabel;
End;

If(InString(TheLine, 'lol')) Or (InString(TheLine, 'ha')) Or (InString(TheLine, 'he'))Or
(InString(TheLine, 'lmao')) Or (InString(TheLine, 'rofl')) Or (InString(TheLine, 'omg'))Then
Begin
Responce[0]:= 'What is so funny.';
Responce[1]:= 'Ohh!';
Responce[2]:= 'Ok, that was good.';
Responce[3]:= 'Nice one!';
Responce[4]:= 'Nice =)';
Responce[5]:= 'Who has any good jokes?';
Responce[6]:= 'Lol, that was good!';
Responce[7]:= 'He he he he, ha ha ha ha';
Responce[8]:= 'Have you seen achmed the dead terrorist?';
Responce[9]:= 'R.o.f.l.m.a.o!!!';
Result:= True;
GoTo ResponceLabel;
End;

If(InString(TheLine, Players[CurrentPlayer].Nick)) Or (InString(TheLine, Players[CurrentPlayer].Name))Then
Begin
Responce[0]:= 'Yes?';
Responce[1]:= 'What?';
Responce[2]:= 'Do you need help?';
Responce[3]:= 'What do you need help with?';
Responce[4]:= 'Umm.. I am busy at the moment.';
Responce[5]:= 'If it is a trade, i do not want.';
Responce[6]:= 'Yes, what would you like?';
Responce[7]:= 'What would you want?';
Responce[8]:= 'I am not selling any of my items.';
Responce[9]:= 'Yes master? Ha Ha.';
Result:= True;
GoTo ResponceLabel;
End;

ResponceLabel:
If(Result)Then
Begin
Writeln('Responded: '+Responce[CurrentResponce]+' To: '+ TheLine);
TypeSend(Responce[CurrentResponce]);
CurrentResponce:= CurrentResponce + 1;
RespondedTimes:= RespondedTimes + 1;
TRespond:= TRespond + 1;
If(CurrentResponce = 9)Then
CurrentResponce:= 0;
End;
End;

Function DetectGas(Var Gx, Gy: Integer): Boolean;
Var
GasTPA: Array [0..6] Of TPointArray;
GasColor: Array [0..6] Of Integer;
I, Count: Integer;
Begin
GasColor[0] := 6123901;
GasColor[1] := 5795704;
GasColor[2] := 5270391;
GasColor[3] := 5599613;
GasColor[4] := 5136998;
GasColor[5] := 6321275;

For I:= 0 To 5 Do
Begin
FindColorsTolerance(GasTPA[I], GasColor[I], Gx-40, Gy-40, Gx+40, Gy+40, GasTolerance);
Count:= Count + GetArrayLength(GasTPA[I])-1;
// ! Testing Marks !
//Writeln(IntToStr(I) + ': ' + IntToStr(GetArrayLength(GasTPA[I])-1));
End;

//Writeln('All - ' + IntToStr(Count));

If(Count > MinGasChange)And(Count < 2000)Then
Result := FindGas(Gx, Gy);
End;

Procedure MineOre;
Var
I, MineTimer: Integer;
RandomTimer: Array [0..3] Of Integer;
Begin
If(Not Loggedin)Then Exit;
Players[CurrentPlayer].Loc := 'In Minings Guild';
CoalSearches:= 0;

Repeat
If ( FindRockMiddle ) Then
Begin
CoalSearches:= 0;

MarkTime( MineTimer );
For I:= 0 To 3 Do
MarkTime(RandomTimer[I]);
Repeat
Wait(50);
If(Not RockColorExists(Dx, Dy, MiningColor, MiningTol))Then
Break;
If(DetectGas(Dx, Dy))Then
Begin
Writeln('Found Gas!');
TakeScreenShot('GasFound');
Gasses:= Gasses + 1;
TGas:= TGas + 1;
MouseFlag(MMCX+Random(50)-Random(50), MMCY+Random(50)-Random(50), 0, 0);
CoalSearches := CoalSearches + 10;
Break;
End;

If(TimeFromMark( RandomTimer[0] ) > 500)Then
Begin
If( Responder )Then Break;
If( PickCheck )Then Break;
If(FindFight)Then
Begin
WalkCompass('right');
If(FindColor(X, Y, LadderColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
MouseFlag(X, Y, 1, 1);
Wait( 500 + Random (500) );
WalkCompass('left');
WalkCompass('left');
Break;
End Else WalkCompass('right');
WalkCompass('left');
WalkCompass('left');
Break;
End;
If(TimeFromMark( RandomTimer[3] ) > 2000)Then
Begin
If(FindNormalRandoms)Then Break;
MarkTime( RandomTimer[3] );
End Else
If(TimeFromMark( RandomTimer[2] ) > 1500)Then
Begin
If(FindNormalRandoms)Then Break;
MarkTime( RandomTimer[2] );
End Else
If(TimeFromMark( RandomTimer[1] ) > 650)Then
Begin
If(FindTalk)Then Break;
MarkTime( RandomTimer[1] );
End;
End Else If(FindTalk)Then Break;

Until( TimeFromMark(MineTimer)>10000) Or (Not Loggedin);
End Else
Begin
FTWait(1);
FindNormalRandoms;
CoalSearches:= CoalSearches + 1;
If(CoalSearches >= 10)Then
Begin
If(MiningSymbolColor <> 0)Then
Begin
X:= MMCX; Y:= MMCY+50;
If(FindColorSpiral(X, Y, MiningSymbolColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
If(Distance(X, Y, MMCX, MMCY)>20)Then
Begin
MouseFlag(X, Y, 0, 0);
Writeln('Walking to mining symbol.');
End Else
If(CoalSearches >= 20)Then
Begin
X:= MMCX; Y:= MMCY+50;
If(FindColorSpiral(X, Y, MiningSymbolColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
MouseFlag(X, Y, 0, 0);
Writeln('Walking to mining symbol.');
End Else If(CoalSearches > 30)Then Break;
End;
End Else If(CoalSearches > 30)Then Break;
End Else MiningSymbolColor := GetSymbolColor(X, Y, 'mining site');
End;
End;
Until( InvFull ) Or (Not Loggedin) Or ( NoPick );
End;

Function CantEnter: Boolean;
Begin
If(FindColor(X, Y, 16711680, 233, 447, 240, 447))Then
If(FindText(X, Y, 'Mining', NPCChars, 333, 403, 384, 422))Then
Result := True;
End;

Function UnderGround: Boolean;
Var
TPA: TPointArray;
Begin
//If(CountColor(65536, MMX1, MMY1, MMX2, MMY2) > 700)Then
//Somebug in countcolor... //MMX1, MMY1, MMX2, MMY2
FindColorsTolerance(TPA, 65536, 570, 5, 715, 160, 0);
If(GetArrayLength(TPA)-1 > 500)Then
Result := True;
End;

Function IsLoading: Boolean;
Begin
Result := FindColor(X, Y, 16777215, 5, 5, 7, 7);
End;

Function FindLadder(Color, Tolerance: Integer; Down: Boolean): Boolean;
Var
LadderTBA: TBoxArray;
Tol: Integer;
Begin
If(Not Loggedin)Then Exit;
Flag;
Wait(500+Random(500));
X:= MSCX;
Y:= MSCY;
Tol:= Tolerance;

Repeat

If ( CantEnter ) Then Begin Writeln('Cant Enter Minings Guild'); Exit; End;
Status('Tol: '+IntToStr(Tol)+' Boxes: '+IntToStr(GetArrayLength(LadderTBA)));

If(FindColorSkipBoxArrayTolerance(X, Y, Color, MSX1, MSY1, MSX2, MSY2, Tol, LadderTBA))Then
Begin
MMouse(X, Y, 0, 0);
GetMousePos(Dx, Dy);
Mouse(X, Y, 0, 0, False);
Wait(25);
If(ChooseOption('limb'))Then
Begin
Flag;
Wait(1500+Random(1000));
While ( IsLoading ) Do
Wait(500+Random(500));
Wait(1000+Random(1000));
End;

If(Down)Then
Begin
If(UnderGround)Then
Begin
Result:= True;
//Writeln('Successfully Climbed!');
Exit;
End;
End Else
If(Not UnderGround)Then
Begin
Result:= True;
//Writeln('Successfully Climbed!');
Exit;
End;

SetArrayLength(LadderTBA, GetArrayLength(LadderTBA)+1);
LadderTBA[GetArrayLength(LadderTBA)-1].X1 := Dx-10;
LadderTBA[GetArrayLength(LadderTBA)-1].Y1 := DY-10;
LadderTBA[GetArrayLength(LadderTBA)-1].X2 := Dx+10;
LadderTBA[GetArrayLength(LadderTBA)-1].Y2 := DY+10;
End Else Tol := Tol + 1;

If(GetArrayLength(LadderTBA)>20)Then
Begin
Logout;
Players[CurrentPlayer].Active:= False;
Players[CurrentPlayer].Loc := 'Couldnt Find Ladders';
Result:= False;
Exit;
End;
Until(Not Loggedin) Or (Result);

End;

Function LadderRadialWalk( TheColor, StartRadial, EndRadial, Radius, FlagBreakOut, Xmod, Ymod, Xoff, Yoff: Integer): Boolean;
Var
I, X1, Y1: Integer;
Begin
If(StartRadial = EndRadial)Then Exit;
Else If(StartRadial < EndRadial)Then
Begin
SetRun(True);
Repeat
For i := StartRadial To EndRadial Do
Begin
x1 := Round(Radius * Sine(i)) + 646;
y1 := Round(-Radius * Cose(i)) + 84;
If FindColor(x, y, TheColor, X1, Y1, X1 + 1, Y1 + 1)then
Begin
Result := True;
MouseFindNoFlag(X + Xoff, Y + Yoff, Xmod, Ymod);
FFlag(FlagBreakOut);
Exit
End;
End;
Radius := Radius - 4;
Until Radius <= 1;
End Else
If(StartRadial > EndRadial)Then
Begin
Repeat
For i := StartRadial DownTo EndRadial Do
Begin
x1 := Round(Radius * Sine(i)) + 646;
y1 := Round(-Radius * Cose(i)) + 84;
If (FindColor(x, y, TheColor, X1, Y1, X1 + 1, Y1 + 1))Then
Begin
Result := True;
MouseFindNoFlag(X + Xoff, Y + Yoff, Xmod, Ymod);
FFlag(FlagBreakOut);
Exit
End;
End;
Radius := Radius - 4;
Until Radius <= 1;
End;
End;

Function CheckAutoColors(LadderOrRoad: String): Integer;
Begin
Case LowerCase(LadderOrRoad) Of
'road': Begin
If(RoadColor = 0)Then
RoadColor:= FindFallyRoadColor;
If(FindColor(X, Y, RoadColor, MMX1, MMY1, MMX2, MMY2))Then
Result:= RoadColor
Else Result:= FindFallyRoadColor;
End;
'ladder': Begin
If(LadderColor = 0)Then
LadderColor:= FindLadderColor;
If(FindColor(X, Y, LadderColor, MMX1, MMY1, MMX2, MMY2))Then
Result:= LadderColor
Else Result:= FindLadderColor;
End;
End;
End;

Procedure InteractBeer(Style: String);
Var
Stout: Integer;
Begin
If(Not Loggedin)Then Exit;
If(Not DrinkStout)Then Exit;

GameTab(4);
Wait(300+Random(400));

Case Lowercase(Style) Of

'drink':
Begin
Stout := DTMFromString('78DA63B467626078C080023E7DF8C4F01F483' +
'302F17F2060B4C0540391859140DA01A8E60301357E40358F8830' +
'E73A7E3500FBAA0D96');
If(FindDTM(Stout, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Mouse(X, Y, 3, 3, True);
StoutsDrank:= StoutsDrank + 1;
TStout := TStout + 1;
Writeln('Drank Beer!');
Wait(100+Random(100));
End Else Begin Players[CurrentPlayer].Loc := 'Couldnt Find Beer'; Writeln('Couldnt Find (DTM) Beer'); Players[CurrentPlayer].Active:= False; Logout; End;
FreeDTM( Stout );
Exit;
End;

'drop':
Begin
Stout := DTMFromString('78DA638C616060E060644006B5D5D50CFF813' +
'448F43F103082D488A1AA81C8C248201D02243809A80199F39F01' +
'BF9A2C4CF7A0AB0100E8850981');
If(FindDTM(Stout, X, Y, MIX1, MIY1, MIX2, MIY2))Then
Begin
Mouse(X, Y, 0, 0, False);
ChooseOption('Drop');
Writeln('Beer Dropped!!');
Wait(100+Random(100));
End;
FreeDTM( Stout );
Exit;
End;

'withdraw':
Begin
If(Not BankScreen)Then
Begin
Logout;
Players[CurrentPlayer].Active:= False;
Players[CurrentPlayer].Loc := 'Not In Bank';
Exit;
End;
Stout := DTMFromString('78DA63EC656060E86140038C482490EE06124' +
'B09A8690612D308A8990924A61350D3052466A2AAF0727363E042' +
'56D387698E8B83035C0D0B1003008825089D');
If(FindDTM(Stout, X, Y, MSX1, MSY1, MSX2, MSY2))Then
Begin
Mouse(X, Y, 0, 0, True);
Writeln('Got Beer!');
Wait(100+Random(100));
FreeDTM( Stout );
Exit;
End Else Begin Players[CurrentPlayer].Loc := 'Couldnt Get More Beer'; Writeln('Couldnt Find Beer (DTM) in Bank'); CloseBank; Players[CurrentPlayer].Active:= False; Logout; End;
FreeDTM( Stout );
Exit;
End;
Else
Begin
Writeln('No such arguement in: ''Procedure InteractBeer(Style: String);');
TerminateScript;
End;
End;
End;

Function FindMiningLadder(Var X, Y: Integer): Boolean;
Var
LadderTPA, LadderTPA2: TPointArray;
I, L: Integer;
Begin
FindColorsTolerance(LadderTPA, LadderColor, MMX1, MMY1, MMX2, MMY2, 0);
L := GetArrayLength(LadderTPA)-1;
For I:= 0 To L Do
Begin
//FindColorsTolerance(LadderTPA2, LadderColor, LadderTPA[I].X-10, LadderTPA[I].Y-10, LadderTPA[I].X+10, LadderTPA[I].Y+10, 0);
FindColorsTolerance(LadderTPA2, 65536, LadderTPA[I].X-10, LadderTPA[I].Y-10, LadderTPA[I].X+10, LadderTPA[I].Y+10, 0);
If(GetArrayLength(LadderTPA2)-1 > 5)Then
Begin
X := LadderTPA[I].X;
Y := LadderTPA[I].Y;
If(Y > 0)And(X > 0)Then
Begin
Result := True
Exit;
End;
End;
End;
End;

Procedure GoToMine;
Begin
If(Not Loggedin)Then Exit;

Players[CurrentPlayer].Loc := 'To Mine';

LadderColor:= CheckAutoColors('Ladder');
RoadColor:= CheckAutoColors('Road');

FindNormalRandoms;

If(Not LadderRadialWalk( LadderColor , 78, 119, 60, 10, -1, -1, -15, 0))Then
Begin
RadialRoadWalk(RoadColor, 61, 90, 65, -1, 0);
LadderRadialWalk( LadderColor, 207, 145, 50, 5, -1, -1, -15, 10);
End;

FindNormalRandoms;

Flag;

FindNormalRandoms;

If(Not RadialRoadWalk(RoadColor, 169, 179, 70, 0, -1))Then
RadialRoadWalk(RoadColor, 203, 153, 70, 0, 0);
//If(FindColor(X, Y, 0, MSX1, MSY1, 648, 157))Then
// STUPID! Jagex thinks i cant solve that error ;)
If(FindMiningLadder(X, Y))Then
MouseFlag(X+10, Y, 4, 4);

InteractBeer('Drink');
If(Loggedin)Then
Players[CurrentPlayer].Loc := 'Ladders Entering';
FindLadder(2445165, 5, True);
If(Not Loggedin)Then Exit;
Players[CurrentPlayer].Loc := 'Ladders UnderGround';
InteractBeer('Drop');
SetRun(False);
FindNormalRandoms;
Repeat
WalkCompass('right');
FindNormalRandoms;
Until(FindColorTolerance(X, Y, CoalRock, MSX1, MSY1, MSX2, MSY2, 4))Or(Not Loggedin)
Flag;
End;

Function FindBankers: Boolean;
Var
Bankers: Integer;
A: Extended;
Begin
If(Not Loggedin)Then Exit;

Bankers := DTMFromString('78DA63AC656260886640017FFE30318800694' +
'620FE0F048C8DF8D580002135605C895F0D50960100216D0FAC');
If(FindDTMRotated(Bankers, X, Y, MMX1, MMY1, MMX2, MMY2, -10, 10, 0.1, A))Then
Result:= True;

FreeDTM(Bankers);
End;

Function LadderDistance: Integer;
Begin
If(FindColor(X, Y, LadderColor, MMX1, MMY1, MMX2, MMY2))Then
Result := Distance(X, Y, MMCX, MMCY);
End;

Procedure GoToBank;
Var
Tries: Integer;
Begin
If(Not Loggedin)Then Exit;
Players[CurrentPlayer].Loc := 'To Bank';
FindNormalRandoms;
If(Not FindColor(X, Y, LadderColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
X:= MMCX; Y:= MMCY+50;
If(FindColorSpiral(X, Y, MiningSymbolColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
If(Distance(X, Y, MMCX, MMCY)>40)Then
MouseFlag(X, Y, 1,1);
End;
End;
Repeat
If(FindColor(X, Y, LadderColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
MouseFindNoFlag(X, Y, 2, 0);
FindNormalRandoms;
Flag;
FindNormalRandoms;
Break;
End Else
WalkCompass('left');
If(Tries>3)Then
Wait(50);
Tries := Tries + 1;
Until(Not Loggedin)Or(Tries > 10);
If(LadderDistance >= 15)Then
If(FindColor(X, Y, LadderColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
MouseFindNoFlag(X, Y, 2, 0);
Flag;
End;
FindNormalRandoms;
If(Loggedin)Then
Players[CurrentPlayer].Loc := 'Ladders Entering';
FindLadder(2708852, 5, False);
If(Not Loggedin)Then Exit;
If(Loggedin)Then
Players[CurrentPlayer].Loc := 'Ladders To Bank...';
FindNormalRandoms;
LadderColor:= CheckAutoColors('Ladder');
RoadColor:= CheckAutoColors('Road');
RadialRoadWalk(RoadColor, 70, 100, 45, 0, 0);
If(Not LadderRadialWalk( LadderColor , 323, 360, 75, 10, 0, 1, -10, 0))Then
Begin
RadialRoadWalk(RoadColor, 333, 367, 70, 0, 1);
RadialRoadWalk(RoadColor, 270, 300, 70, 1, 0);
End;
FindNormalRandoms;
If(FindBankers)Then
Begin
Mouse(X, Y-4, 3, 0, True);
FindNormalRandoms;
Flag;
FindNormalRandoms;
End Else
Begin
RadialRoadWalk(RoadColor, 273, 300, 75, 0, 0);
FindNormalRandoms;
If(FindBankers)Then
Begin
Mouse(X, Y-4, 3, 0, True);
FindNormalRandoms;
Flag;
FindNormalRandoms;
End Else Begin Players[CurrentPlayer].Loc := 'Couldnt Find Bankers'; Players[CurrentPlayer].Active:= False; Logout; End;
End;
End;

Function OpenFallyBankFast: Boolean;
var
x, y, i, l, c, z: Integer;
Info: TIntegerArray;
Booths, t: TPointArray;
Begin
Info := [MSCX, MSCY+20, 4810622, 5, 1];
z := GetColorToleranceSpeed;
If Info[4] <> GetColorToleranceSpeed Then
ColorToleranceSpeed(Info[4]);
FindColorsSpiralTolerance(Info[0], Info[1], Booths, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3])
SetArrayLength(t, 0);
t := Booths;
SetArrayLength(Booths, 0);
Booths := ReArrangeAndShortenArray(t, 14);
l := GetArrayLength(Booths) -1;
ColorToleranceSpeed(z);
for i := 0 to l do
begin
If not LoggedIn then
Begin
Result := False;
ColorToleranceSpeed(z);
Exit;
End;
Wait(100);
MMouse(Booths[i].X, Booths[i].Y, 0, 0);
Wait(150);
if IsUpText('ooth') Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(100);
if ChooseOption('uickly') then
begin
FFLag(0);
MarkTime(c);
repeat
Wait(100);
until (BankScreen) or (TimeFromMark(c) > 3000);
Result := BankScreen;
if Result then Exit;
end;
end;
end;
end;

Function OpenBankLoop: Boolean;
Var
Mark: Integer;
Begin
If(Not LoggedIn)Then Exit;

Flag;
Marktime(Mark);
Repeat
If(TimeFromMark(Mark)>25000)And(Not FlagPresent)Then
Begin
Writeln('Couldnt Find Bank..');
Players[CurrentPlayer].Loc := 'Bank(Not Found)';
Logout;
Players[CurrentPlayer].Active:= False;
Exit;
End;
FTWait(2)
If(OpenFallyBankFast)Then
Wait(200+Random(200));
Flag;
Until(BankScreen)or(PinScreen)or(Not LoggedIn)
Wait(500+Random(250));

If(PinScreen)Then
Begin
InPin(IntToStr(Players[CurrentPlayer].Pin));
Wait(500+Random(250));
End;
If(BankScreen)Then
Begin
FixBank;
Result := True;
End Else
Begin
Writeln('Couldnt Find bank.');
Players[CurrentPlayer].Loc := 'Bank(Not Found)';
Logout;
Players[CurrentPlayer].Active:= False;
End;

End;

Procedure Deposit2(FromItem,ToItem: integer);
Var
I: Integer;
aPoint: TPoint;
Begin
I := Fromitem;
For I := FromItem To ToItem Do
Begin
If(ExistsItem(I))Then
Begin
aPoint := ItemCoords(i);
Wait(10);
Case 1+Random(10) Of
1: Mouse(aPoint.x+Random(5)-Random(5), aPoint.y+Random(5)-Random(5), 0, 0, True);
2: Begin
Mouse(aPoint.x+Random(5)-Random(5), aPoint.y+Random(5)-Random(5), 0, 0, False);
Chooseoption('ore 5');
End;
3: Begin
Mouse(aPoint.x+Random(5)-Random(5), aPoint.y+Random(5)-Random(5), 0, 0, False);
Chooseoption('ore 10');
End;
Else Begin
Mouse(aPoint.x+Random(5)-Random(5), aPoint.y+Random(5)-Random(5), 0, 0, False);
Chooseoption('ore All');
End;
End
Wait(500+Random(500));
End;
End;
End;

Function CountItemColor(Color, Tol: Integer): Integer;
Var
Dx, Dy, I: Integer;
ItemTp: TPoint;
Begin
If(Not Loggedin)Then Exit;

GameTab(4);

For I:= 1 To 28 Do
Begin
ItemTP:= ItemCoords(I);
If(FindColorTolerance(Dx,Dy,Color,ItemTP.X-10,ItemTP.Y-10,ItemTP.X+10,ItemTP.Y+10, Tol))Then
Result:= Result + 1;
End;
End;

Function CountItemGems: Integer;
Var
GemColor: Array [1..4] of Integer;
Dx, Dy, Gem, I: Integer;
ItemTP: TPoint;
Begin
If(Not Loggedin)Then Exit;
GemColor[1]:= 11842741;
GemColor[2]:= 859003;
GemColor[3]:= 1543184;
GemColor[4]:= 9574162;

GameTab(4);

For I:= 1 To 28 Do
Begin
ItemTP:= ItemCoords(I);
For Gem:= 1 To 4 Do
If(FindColorTolerance(Dx,Dy,GemColor[Gem],ItemTP.X-10,ItemTP.Y-10,ItemTP.X+10,ItemTP.Y+10, 5))Then
Result:= Result + 1;
End;
End;

Procedure DoTheMath;
Var
TMith, TGems, TCoal: Integer;
Begin
TCoal:= CountItemColor(2175538, 5);
TMith:= CountItemColor(6571076, 5);
TGems:= CountItemGems;

If(TCoal > 0)Then
Writeln(' Mined: '+IntToStr(TCoal) + ' Coals');
If(Players[CurrentPlayer].Booleans[1])And(TMith > 0)Then
Writeln(' Mined: '+IntToStr(TMith) + ' Miths');
If(TGems > 0)Then
Writeln(' Mined: '+IntToStr(TGems) + ' Gems');

CurrentLoad:= CurrentLoad + 1;

Gems:= Gems + TGems;
Coal:= Coal + TCoal;
Mith:= Mith + TMith;
Gained:= (Coal * 50) + (Mith * 80);
Banked:= Banked + 1;

Players[CurrentPlayer].Integers[0]:= Players[CurrentPlayer].Integers[0] + TCoal;
Players[CurrentPlayer].Integers[1]:= (Players[CurrentPlayer].Integers[0] * 50) + (Players[CurrentPlayer].Integers[3] * 80);
Players[CurrentPlayer].Integers[2]:= Players[CurrentPlayer].Integers[2] + 1;
Players[CurrentPlayer].Integers[3]:= Players[CurrentPlayer].Integers[3] + TMith;

Banks:= Banks + 1;

ReportVars[0] := TCoal;
ReportVars[1] := (TCoal * 50) + (TMith * 80);
ReportVars[2] := 1;
ReportVars[3] := TGas;
ReportVars[4] := TRespond;
ReportVars[5] := TGems;
ReportVars[6] := TStout;
ReportVars[7] := TMith;
ReportVars[8] := TBroken;
ReportVars[9] := TLostHead;

TLostHead:= 0;
TRespond:= 0;
TBroken:= 0;
TStout:= 0;
TGas:= 0;

SRLRandomsReport;
End;

Function FixProg(ST, Max: String): String;
Var
I, O, L: Integer;
Begin
L:= Length(ST);
I:= Length(Max);
L:= L - 1;
I:= I - 3;

For O:= L To I Do
Result:= Result + ' ';
Result:= Result + '|';
End;

Procedure ProgressReport;
Var
ActiveT, Longest: String;
Prog: Array [0..17] Of String;
Sec, I: Integer;
Begin
Sec := GetTimeRunning div 1000+1;

Writeln('/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\');
Writeln('| JuKKa''s Guild Miner Script v'+FloatToStr(Version)+'! |');
Longest:= ('|~~~~~~~~~~~~ Mining Report ~~~~~~~~~~~~~|');
Writeln(Longest);
Prog[0]:= ('| Worked: ' + TimeRunning + '');
Prog[1]:= ('| Mined : ' + IntToStr(Coal) + ' Coals');
Prog[2]:= ('| Mined : ' + IntToStr(Mith) + ' Miths');
Prog[3]:= ('| Gained: ' + IntToStr(Gained) + ' Exp');
Prog[4]:= ('| Banked: ' + IntToStr(Banked) + ' Loads');
Prog[5]:= ('|~~~~~~~~~~~~ Per Hour Report ~~~~~~~~~~~');
Prog[6]:= ('| Coals : ' + IntToStr(Round(3600*Coal/Sec)) + ' Per Hour');
Prog[7]:= ('| Miths : ' + IntToStr(Round(3600*Mith/Sec)) + ' Per Hour');
Prog[8]:= ('| Exp. : ' + IntToStr(Round(3600*Gained/Sec))+ ' Per Hour');
Prog[9]:= ('| Banked: ' + IntToStr(Round(3600*Banked/Sec))+ ' Per Hour');
Prog[10]:= ('|~~~~~~~~~~~~~ Misc Report ~~~~~~~~~~~~~~');
Prog[11]:= ('| Banked: ' + IntToStr(Gems) + ' Gems');
Prog[12]:= ('| Stouts: ' + IntToStr(StoutsDrank) + ' Drank');
Prog[13]:= ('| Found : ' + IntToStr(Gasses) + ' Gasses');
Prog[14]:= ('| Responded: ' +IntToStr(RespondedTimes)+ ' Times');
Prog[15]:= ('| Broken: ' +IntToStr(BrokenPicks) + ' Picks');
Prog[16]:= ('| Lost: ' + IntToStr(LostHead) + ' Heads');

For I:= 0 To 16 Do
Begin
Prog[I]:= FixProg(Prog[I], Longest);
Writeln(Prog[I]);
End;

If(Not Loggedin)Then
Begin
Players[CurrentPlayer].Active := False;
If(Players[CurrentPlayer].Rand = '')Then
Players[CurrentPlayer].Rand := 'Lost';
End;

Writeln('|~~~~~~~~~~~~ Players Report ~~~~~~~~~~~~|');

For I:= 0 To HowManyPlayers-1 Do
Begin
If(Players[I].Active)Then
ActiveT:= 'T'Else ActiveT:= 'F';
Prog[17]:= ('| #: '+IntToStr(I)+ ' Active: '+ActiveT+
' - Mining Level: '+IntToStr(Players[I].Level[15])+
'; Mined: '+IntToStr( Players[I].Integers[0] + Players[I].Integers[3])+
'; Coal: '+IntToStr(Players[I].Integers[0])+
'; Mith: '+IntToStr(Players[I].Integers[3])+
'; Gained: '+IntToStr(Players[I].Integers[1])+
'; Banked: '+IntToStr(Players[I].Integers[2])+
'; Location: '+Players[I].Loc +
'; Random: '+Players[I].Rand+';');
Writeln(Prog[17]);
End;
Writeln('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');

End;

Procedure GetBestPick;
Var
I, PickDTM: Integer;
Dx, Dy, BrokenPick: Integer;
Begin
If(Not Loggedin)Or(Not BankScreen)Then Exit;

For I:= 6 DownTo 1 Do
Begin
PickDTM := LoadPick('dtm',I);
If(FindDTM(PickDTM, X, Y, MSx1, MSy1, MSx2, MSy2))Then
Begin
BrokenPick := DTMFromString('78DA63DCCBC0C0D0CD800618914820BD1D48F' +
'412A166220135078830E73890984C849AA9F8D50000C33207EA');
If(Not FindDTM(BrokenPick, Dx, Dy, X-20, Y-20, X+20, Y+20))Then
Begin
Mouse(X, Y, 4, 4, True);
Wait(500+Random(300));
FreeDTM(PickDTM);
FreeDTM(BrokenPick);
Case I Of
1: Writeln('You Got Bronze pick axe');
2: Writeln('You Got Iron pick axe');
3: Writeln('You Got Steel pick axe');
4: Writeln('You Got Mith pick axe');
5: Writeln('You Got Addy pick axe');
6: Writeln('You Got Rune pick axe');
End
GotPick := I;
Exit;
End;
FreeDTM(BrokenPick);
End;
FreeDTM(PickDTM);
End;
End;

Procedure EquipBestPick;
Begin
If(Not Loggedin)Then Exit;
If(Not NoPick)Then Exit;

GameTab(4);
Wait(500+Random(500));

If(EquipPick)And(ExistsItem(1))And(AbleToEquipPick(GotPick))Then
Begin
MouseItem(1, True);
Wait(500+Random(300));
If(Not GetPickHeadColors)Then
Begin
Writeln('Couldnt get pick colors, Equip or have in inventory.');
Players[CurrentPlayer].Loc := 'No Pick, Colors';
Logout;
Players[CurrentPlayer].Active:= False;
End Else NoPick:= False;
End Else
If(Not EquipPick)Then
If(Not GetPickHeadColors)Then
Begin
Writeln('Couldnt get pick colors, Equip or have in inventory.');
Players[CurrentPlayer].Loc := 'No Pick, Colors';
Logout;
Players[CurrentPlayer].Active:= False;
Exit;
End Else NoPick:= False;

End;

Procedure Bank;
Begin
If(Not Loggedin)Then Exit;

DoTheMath;
Players[CurrentPlayer].Loc := 'Bank';

If(DrinkStout)Then
If(GetSkillLevel('mining') = 59)Then
DrinkStout:= True Else DrinkStout:= False;

If( OpenBankLoop )Then
Begin
If ( NoPick )Then
Begin
Deposit2(1, 28);
GetBestPick;
Wait(300+Random(300));
End Else
If(EquipPick)Then
Deposit2(1, 28)
Else Deposit2(2, 28);
InteractBeer('Withdraw');
CloseBank;
EquipBestPick;
End;
End;

Function LoadsDone: Boolean;
Begin
If(CurrentLoad >= HowManyLoads)Then
Result:= True;
End;

Begin
{$IfDef SMART}
SmartSetup('jolt11', False, True);
while not(SmartReady) do Wait(100);
SetTargetDC(SmartGetDC);
if not(LoggedIn) then
while not(SmartGetColor(386, 249) = 65535) do Wait(100);
{$EndIf}
Setup;
Repeat
InitPlayer;
Repeat
GoToMine;
MineOre;
GoToBank;
Bank;
Until(Not Loggedin)Or(NoPick)Or(LoadsDone);
ProgressReport;
If(Loggedin)And(Not NoPick)Then
NextPlayer(True)Else NextPlayer(False);
Until(False);
End.
Is that ^^ correct?

mickaliscious

2008-01-17 08:56:45

I suggest trying Markus's way of including and defining SMART. I use it and you only have to include one line of code to make a script SMART compatible.

http://www.villavu.com/forum/showthread.php?t=21279

Daniel

2008-01-17 19:41:51

From: mickaliscious
I suggest trying Markus's way of including and defining SMART. I use it and you only have to include one line of code to make a script SMART compatible.

http://www.villavu.com/forum/showthread.php?t=21279


Thanks mick. That tutorial was better than pwnaz0r's, including it inside SRL.