Alright this is what my three scripts look like. I have no clue what im doing wrong.
Smart.scar:
{$DEFINE SMART}
{
smart.scar overwrites the SCAR procedures.
You should always include this before any other include, even SRL.scar
}
procedure MoveMouse(x, y: Integer);
begin
SmartMoveMouse(x, y);
end;
procedure HoldMouse(x, y: Integer; left: Boolean);
begin
SmartHoldMouse(x, y, left);
end;
procedure ReleaseMouse(x, y: Integer; left: Boolean);
begin
SmartReleaseMouse(x, y, left);
end;
procedure KeyUp(key: Byte);
begin
If Key = 13 Then
Key := 10;
SmartReleaseKey(key);
end;
procedure KeyDown(key: Byte);
begin
If Key = 13 Then
Key := 10;
SmartHoldKey(key);
end;
procedure SendKeys(S: String);
begin
SmartSendKeys(S);
end;
procedure GetMousePos(var x, y: Integer);
begin
SmartGetMousePos(x, y);
end;
function GetColor(x, y: Integer): Integer;
begin
result:= SmartGetColor(x, y);
end;
procedure SmartSetTarget;
var
Smart_Bitmap: Integer;
begin
Smart_Bitmap:= BitmapFromString(765,503,'');
GetBitmapCanvas(Smart_Bitmap).Handle:= SmartGetDC;
SetTargetBitmap(Smart_Bitmap);
FreeBitmap(Smart_Bitmap);
end;
function FindWindow(Title: String): Boolean;
begin
result:= true;
end;
procedure ActivateClient;
begin
end;
function FindWindowBySize(Width, Height: Integer): Boolean;
begin
result:= true;
end;
procedure SmartSetupEx(worldnumber: integer; hiDetail, signed: boolean);
var
prefix: string;
begin
prefix := ReadINI('World' + IntToStr(worldnumber), 'Prefix', AppPath + 'includes\SRL\SCSS\worlds.ini');
if(prefix = '')then
begin
writeln('Invalid world number or corrupted world list. Please review your settings');
TerminateScript;
end;
SmartSetup(prefix, hiDetail, signed);
end;
Srl.scar:
//----------------------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//----------------------------------------------------------------------------//
//-- by: Azeroth, Bebemycat2, BenLand100, benleegt, Boreas, c0de, --//
//-- Cheesehunk, Dankness, driger1592, Flyboy, Freddy1990, --//
//-- inferno, Kernel Klink, Knightstreak, Krazy_Meerkat, Krichevskoy, --//
//-- Lorax, Mad Cow, masquerader, moparisthebest, Mutant Squirrle, --//
//-- nielsie95, phantombmx, pups, Pyro, realrune, Renax, Ron, RsN, --//
//-- Solemn wishes, Spky, SRL, Starblaster100, Stupid3ooo, Sumilion, --//
//-- tarajunky, Wizzup?, WT-Fakawi, XxKanexX, Yakman, _ChArMz....... --//
//-- --//
//-- ....... and the SRL Community. --//
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
// -- SRL Level 1 Includes --//
// -- --//
// -- Low Level SCAR Math, Mouse Movement and Color Clicking routines. --//
//----------------------------------------------------------------------------//
{.include SRL/SRL/Core/Globals.scar}
{.include SRL/SRL/Core/Math.scar}
{.include SRL/SRL/Core/Mouse.scar}
{.include SRL/SRL/Core/Color.scar}
{.include SRL/SRL/Core/Players.scar}
//----------------------------------------------------------------------------//
// -- SRL Level 2 Includes --//
// -- --//
// -- Interface, Object and OCR routines. --//
//----------------------------------------------------------------------------//
{.include SRL/SRL/Core/Timing.scar}
{.include SRL/SRL/Core/GameTab.scar}
{.include SRL/SRL/Core/Text.scar}
{.include SRL/SRL/Core/Inventory.scar}
{.include SRL/SRL/Core/Object.scar}
//----------------------------------------------------------------------------//
// -- SRL Level 3 Includes --//
// -- --//
// -- MapWalking, AntiRandoms, Bank, Symbol and many more... --//
//----------------------------------------------------------------------------//
{.include SRL/SRL/Core/FlagChat.scar}
{.include SRL/SRL/Core/Login.scar}
{.include SRL/SRL/Core/Mapwalk.scar}
{.include SRL/SRL/Core/Bitmap.scar}
{.include SRL/SRL/Core/DTM.scar}
{.include SRL/SRL/Core/Bank.scar}
{.include SRL/SRL/Core/Symbol.scar}
{.include SRL/SRL/Core/RC.scar}
{.include SRL/SRL/Core/AutoColor.scar}
{.include SRL/SRL/Core/AntiRandoms/Common.scar}
{.include SRL/SRL/Core/Globalstats.scar}
{.include SRL/SRL/Core/CAutoRespond.scar}
{.include SRL/SRL/Core/AntiRandoms/Box.scar}
{.include SRL/SRL/Core/AntiRandoms/Certer.scar}
{.include SRL/SRL/Core/AntiRandoms/Demon.scar}
{.include SRL/SRL/Core/AntiRandoms/Frog.scar}
{.include SRL/SRL/Core/AntiRandoms/Quiz.scar}
{.include SRL/SRL/Core/AntiRandoms/Sandwich.scar}
{.include SRL/SRL/Core/AntiRandoms/EvilBob.scar}
{.include SRL/SRL/Core/AntiRandoms/ChatRandoms.scar}
{.include SRL/SRL/Core/AntiRandoms/AntiRandoms.scar}
{.include SRL/SRL/Core/AntiBan.scar}
{.include SRL/SRL/Core/Amount.scar}
{*******************************************************************************
procedure SetupSRL;
by: SRL Dev Team
Description: Sets up all variables needed to run SRL.
*******************************************************************************}
procedure SetupSRL;
begin
begin
{$IFDEF SMART}
SmartSetupEx(67,True,True);
wait(10000+random(5000));
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
{$ENDIF}
MouseSpeed := 15;
CheckHPFirst := True;
Reincarnate := False;
TalkAfterRandoms := False;
RoadColor := 0;
WaterColor := 0;
BankColor := 0;
LampSkill := 'mining';
SetUpSRLReport;
SetMouseMode(false);
LoadCosineArrays;
SymbolAccuracy:= 0.8;
LoadNPCArray;
LoadSRLBitMaps;
SolveChatRandoms := True;
SetupSRLAutoResponder
UseSandWichSolver := True;
UseBoxSolver := True;
UseCerterSolver := True;
UseFindmod := True;
UseFindtrade := True;
Screenshots := False;
TheFile := RewriteFile(ScriptPath + 'ChatLog.txt', False);
Writeln ('SRL Compiled in '+ IntToStr(GetTimeRunning) + ' msec');
end;
Jukka's Guild Miner:
{
[------------------------------------------------------------------------------]
[ 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;
{.Include SRL/SRL/Misc/smart.scar}
{.Include SRL/SRL.Scar}
Begin
SetUpSrl;
end.
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 = 8; //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 = '4246'; //SRL Stats ID Number, If ur a leecher FUCK OFF.
SRLStatsPW = '174jjw14'; //SRL Stats PW!, If ur a leecher FUCK OFF.
GasTolerance = 15; //Change if find you broken pickaxes!
MinGasChange = 200; //100+ About 200-300 and more. Basically tolerance.
{-----------------------------------}
CoalRock = 2702653; //DONT EDIT! }
CoalTolerance = 4; //DONT EDIT! }
MithRock = 5979710; //DONT EDIT! }
MithTolerance = 4; //DONT EDIT! }
Version = 2.0; //DONT EDIT! }
{-----------------------------------}
Procedure DeclarePlayers;
Begin
HowManyPlayers:= 1;
CurrentPlayer:= 0;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := 'nobodyukno14';
Players[0].Pass := '174jjw14';
Players[0].Nick := 'obo';
Players[0].Booleans[1]:= True; //Mine Mith ores too?
Players[0].Pin := 0000;
Players[0].Active:= True;
{
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Booleans[1]:= False; //Mine Mith ores too?
Players[1].Pin := 0000;
Players[1].Active:= True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Booleans[1]:= False; //Mine Mith ores too?
Players[2].Pin := 0000;
Players[2].Active:= True;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Booleans[1]:= False; //Mine Mith ores too?
Players[3].Pin := 0000;
Players[3].Active:= True;
Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Booleans[1]:= False; //Mine Mith ores too?
Players[4].Pin := 0000;
Players[4].Active:= True;
Players[5].Name := '';
Players[5].Pass := '';
Players[5].Nick := '';
Players[5].Booleans[1]:= False; //Mine Mith ores too?
Players[5].Pin := 0000;
Players[5].Active:= True;
}
Writeln('Starting with player '+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 := 76120;
RoadColor := 6978948;
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;
ActivateClient;
Wait(300);
If(LoggedIn)Then
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
Else LoginPlayer;
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;
Disguise('Coal:' +IntToStr(Coal)+ ' Mith:' +IntToStr(Mith)+ ' [' +IntToStr(CurrentLoad)+ '/' +IntToStr(HowManyLoads)+ ']');
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] := GetSkillInfo('attack', True);
Players[CurrentPlayer].Level[15]:= GetSkillInfo('mining', True);
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;
Exit;
End;
SetChat('On',1);
SetChat('Off',2);
SetChat('Off',3);
SetChat('Off',4);
SetChat('Off', 5);
MakeCompass('n');
SetAngle(True);
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; Tol: 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 := 4; //<-- Temporary. comment out this line if u want <--
// But 4 tolerance works very well for all rocks.
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, 15);
MiddleTPAEx(TPA2, X, Y);
FindColorsTolerance(TPA2, C, X - 15, Y - 15, X + 15, Y + 15, 15);
If(GetArrayLength(TPA2)-1 >= 35)Then
Begin
MiddleTPAEx(TPA2, X, Y);
If(X > 0)And(Y > 0)Then
If(Not DetectGas(X, Y, GasTolerance))Then
Begin
Result := True;
Break;
End;
End;
Except
Result := False;
End;
End;
ColorToleranceSpeed(CTS);
End;}
Function FindRock(Var X, Y: Integer; C, T: Integer): Boolean;
Var
CTS, I, I2, L, L2: Integer;
TP: TPoint;
TPA: TPointArray;
TPAA: Array Of TPointArray;
Begin
If(Not Loggedin)Then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, C, MSX1, MSY1, MSX2, MSY2, T);
TPAA := TPAtoATPAEx(TPA, 35, 35);
L := High(TPAA);
For I := 0 To L Do
Begin
L2 := High(TPAA[I]);
For I2 := 0 To L2 Do
Begin
Try
FindColorsTolerance(TPA, C, TPAA[I][I2].X - 20, TPAA[I][I2].Y - 20, TPAA[I][I2].X + 20, TPAA[I][I2].Y + 20, 15);
TP := MiddleTPA(TPA);
If(Not DetectGas(TP.X, TP.Y, 15))Then
Begin
X := TP.X;
Y := TP.Y;
If(X > 0)And(Y > 0)Then
Begin
Result := True;
ColorToleranceSpeed(CTS);
//MoveMouse(X, Y);
Exit;
End;
End;
Except
Result := False;
End;
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(50+Random(25));
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( InvCount >= 27 )Then
Begin
DropItem(3);
Wait(400+Random(350));
If( InvCount = 27 )And( EquipPick )Then
DropItem(2);
Wait(400+Random(350));
End;
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 B;Begin If(InString(TheLine, 'srl'))Then TypeSend('Im');End;
Function Responder: Boolean; //fucking lucker lol ;), Black below..
Var
Responce: Array [0..9] of String;
NewLine: String;
Label
ResponceLabel;
Begin
If(Not Loggedin)Then Exit;
B;
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]:= 'ello';
Responce[3]:= 'hi lol';
Responce[4]:= 'Hi there';
Responce[5]:= 'yo';
Responce[6]:= 'hi there!';
Responce[7]:= 'Yo wazzap';
Responce[8]:= 'lol 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]:= 'soon ' +IntToStr(Players[CurrentPlayer].Level[15]+1);
Responce[6]:= 'very soon ' +IntToStr(Players[CurrentPlayer].Level[15]+1);
Responce[7]:= 'secret';
Responce[8]:= 'ask me later';
Responce[9]:= 'ill tell when i get level';
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]:= 'lol';
Responce[1]:= 'lmao';
Responce[2]:= 'haha';
Responce[3]:= 'lmfao';
Responce[4]:= 'rofl';
Responce[5]:= 'hehe';
Responce[6]:= 'ahah';
Responce[7]:= 'lmao haha';
Responce[8]:= 'hehe lol';
Responce[9]:= 'haha lol lmao rofl';
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]:= 'umm yes?';
Responce[3]:= 'yes what?';
Responce[4]:= 'not now..';
Responce[5]:= 'nty not now';
Responce[6]:= 'what now?';
Responce[7]:= 'what?';
Responce[8]:= 'yes?!';
Responce[9]:= 'yessir?';
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; Tol: 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, Tol);
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);
If(Result)Then
SRLRandomsReport;
End;
Procedure MineOre;
Var
GasTimer, I, MineTimer, TGasC: 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, GasTolerance))Then
Begin
TGasC := GetColor(Dx, Dy);
If(Not SimilarColors(TGasC, 6123901, 10))Then
TGasC := 6123901;
Writeln('Found Gas!');
TakeScreenShot('GasFound');
Gasses:= Gasses + 1;
TGas:= TGas + 1;
MouseFindFlag(MMCX+Random(50)-Random(50), MMCY+Random(50)-Random(50), 0, 0);
{
GasColor[0] := 6123901;
GasColor[1] := 5795704;
GasColor[2] := 5270391;
GasColor[3] := 5599613;
GasColor[4] := 5136998;
GasColor[5] := 6321275;
}
If(FollowColor(Dx, Dy, TGasC, 15))Then
Begin
TakeScreenShot('Gas Followed');
CoalSearches := CoalSearches + 10;
MarkTime(GasTimer);
While(DetectGas(Dx, Dy, 15))Do
Begin
If(TimeFromMark( GasTimer ) > 30000)Then
Break;
FTWait(2);
End;
TakeScreenShot('Evaded Gas');
Writeln('Evaded Gas for ' + IntToStr(TimeFromMark(GasTimer)/1000)+' seconds');
End Else Wait(10000+Random(5000));
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 > 25)Then Break;
End;
End Else If(CoalSearches > 25)Then Break;
End Else
Begin
If(CoalSearches > 25)Then
Break;
MiningSymbolColor := GetSymbolColor(X, Y, 'mining site');
End;
End;
End;
Until( InvFull ) Or (Not Loggedin) Or ( NoPick ) Or (CoalSearches > 30);
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, MMX1, MMY1, MMX2, MMY2, 0);
If(GetArrayLength(TPA)-1 > 500)Then
Result := True;
End;
Function FindLadder(Color, Tolerance: Integer; Down: Boolean): Boolean;
Var
LadderTBA: TBoxArray;
Load, 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'); Result := False; 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;
MarkTime(Load);
If(Down)Then
Repeat
Wait(500+Random(500));
If(UnderGround)Then
Result := True;
Until(Not Loggedin)Or(TimeFromMark(Load) > 5000)Or(Result)
Else
Repeat
Wait(500+Random(500));
If(Not UnderGround)Then
Result := True;
Until(Not Loggedin)Or(TimeFromMark(Load) > 5000)Or(Result);
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;
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;
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
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
I: Integer;
ColorPoints: TIntegerArray;
ColorPointTP: TPoint;
LadderTPA, LadderTPA2: TPointArray;
Begin
If(Not Loggedin)Then Exit;
FindColorsTolerance(LadderTPA, LadderColor, MMX1, MMY1, MMx2, MMY2, 0);
SetArrayLength( ColorPoints, GetArrayLength(LadderTPA) );
For I:= 0 To High( ColorPoints )Do
Begin
FindColorsTolerance(LadderTPA2, LadderColor, LadderTPA[I].X - 5, LadderTPA[I].Y - 5, LadderTPA[I].X + 5, LadderTPA[I].Y + 5, 0);
ColorPoints[I] := GetArrayLength(LadderTPA2);
If(AMax(ColorPoints) = ColorPoints[I])Then
ColorPointTP := LadderTPA[I];
End;
X := ColorPointTP.X;
Y := ColorPointTP.Y;
If(X > 0)And(Y > 0)Then
Result := True;
End;
Procedure GoToMine;
Begin
If(Not Loggedin)Then Exit;
Players[CurrentPlayer].Loc := 'To Mine';
LadderColor:= CheckAutoColors('Ladder');
RoadColor:= CheckAutoColors('Road');
If( Random(10) > 5 )Then
SetRun(True);
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, 180, 200, 70, 0, -1))Then
If(Not RadialRoadWalk(RoadColor, 170, 200, 70, 0, 0))Then
Begin
X := MMCX;
Y := MMCY + 50;
If(FindColorSpiral(X, Y, RoadColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
MouseFlag(X, Y, 0, 0);
Flag;
End;
End;
//If(FindColor(X, Y, 0, MSX1, MSY1, 648, 157))Then
// STUPID! Jagex thinks i cant solve that error ;)
If(FindMiningLadder(X, Y))Then
Begin
MouseFlag(X+10, Y-5, 0, 0);
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(True);
FindNormalRandoms;
Repeat
WalkCompass('right');
FindNormalRandoms;
Until(FindColorTolerance(X, Y, CoalRock, MSX1, MSY1, MSX2, MSY2, 4))Or(Not Loggedin)
Flag;
End Else
Begin
If(Loggedin)Then
Players[CurrentPlayer].Loc := 'No Ladders on MM'
Else Players[CurrentPlayer].Loc := 'Lost while walking to ladders';
Players[CurrentPlayer].Active := False;
Logout;
End;
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
X := MMCX;
Y := MMCY;
If(FindColorSpiral(X, Y, LadderColor, MMX1, MMY1, MMX2, MMY2))Then
Result := Distance(X, Y, MMCX, MMCY);
End;
Procedure GoToBank;
Var
I, Tries, LDist: Integer;
Begin
If(Not Loggedin)Then Exit;
Players[CurrentPlayer].Loc := 'To Bank';
FindNormalRandoms;
Repeat
If(FindColor(X, Y, LadderColor, MMX1, MMY1, MMX2, MMY2))Then
Begin
Mouse(X, Y, 5, 0, True);
FindNormalRandoms;
Flag;
FindNormalRandoms;
End Else
WalkCompass('left');
LDist := LadderDistance;
If(LDist <> 0)Then
If(LDist <= 10)Then
Break;
If(Tries>3)Then
Wait(50);
Tries := Tries + 1;
Until(Not Loggedin)Or(Tries > 20);
If(Tries >= 20)Then
Begin
Logout;
Players[CurrentPlayer].Loc := 'lost underground to ladders';
Players[CurrentPlayer].Active := False;
Exit;
End;
FindNormalRandoms;
If(Loggedin)Then
Players[CurrentPlayer].Loc := 'Ladders Entering';
FindLadder(2708852, 5, False);
If(Not Loggedin)Then Exit;
If( Random(10) > 3 )Then
SetRun(False);
If(Loggedin)Then
Players[CurrentPlayer].Loc := 'Ladders To Bank...';
FindNormalRandoms;
LadderColor:= CheckAutoColors('Ladder');
RoadColor:= CheckAutoColors('Road');
RadialRoadWalk(RoadColor, 75, 90, 70, 0, 0);
If(Not LadderRadialWalk( LadderColor , 310, 360, 75, 10, 0, 1, -10, 0))Then
Begin
RadialRoadWalk(RoadColor, 333, 367, 70, 0, 1);
RadialRoadWalk(RoadColor, 270, 340, 70, 1, 0);
End;
FindNormalRandoms;
Wait(500+Random(500));
If(FindBankers)Then
Begin
Mouse(X+Random(10)-Random(10), Y-10, 3, 0, True);
FindNormalRandoms;
Flag;
FindNormalRandoms;
End Else
Begin
RadialRoadWalk(RoadColor, 270, 360, 75, 0, 0);
Flag;
Wait(500+Random(500));
FindNormalRandoms;
If(FindBankers)Then
Begin
Mouse(X+Random(10)-Random(10), Y-10, 3, 0, True);
FindNormalRandoms;
Flag;
FindNormalRandoms;
End Else
Begin
For I:= 1 To 5 Do
Begin
If(FindBankers)Then
Begin
Mouse(X+Random(10)-Random(10), Y-10, 0, 0, True);
FindNormalRandoms;
Flag;
FindNormalRandoms;
Exit;
End Else FTWait(1);
End;
Players[CurrentPlayer].Loc := 'Couldnt Find Bankers';
Players[CurrentPlayer].Active:= False;
Logout;
End;
End;
{
Begin
Players[CurrentPlayer].Loc := 'Couldnt Find Bankers';
Players[CurrentPlayer].Active:= False;
Logout;
End;
}
End;
Function OpenFallyBankFast: Boolean;
var
x, y, i, l, c, z: Integer;
Info: TIntegerArray;
Booths, t: TPointArray;
Begin
Info := [MSCX-20, MSCY+20, 4810622, 5, 1];
MakeCompass('n');
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;
end;
end;
if Result then Exit;
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;
If(TMith > 0)Then
Disguise('Coal:' +IntToStr(Coal)+ ' Mith:' +IntToStr(Mith)+ ' [' +IntToStr(CurrentLoad)+ '/' +IntToStr(HowManyLoads)+ ']')
Else Disguise('Coal:' +IntToStr(Coal)+ ' [' +IntToStr(CurrentLoad)+ '/' +IntToStr(HowManyLoads)+ ']');
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(GetSkillInfo('mining', True) = 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
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.