n3ss3s
2007-11-17 04:58:54
This is how it ended up :(
I simply couldn't beat the deserts of Al-Kharid in walking.
I tweaked the walking over a month, easily over hundred hours looking at a fucking DDTM!!
There is 2k lines of code, so somebody else can finish it, though mentioning me in the credits would be nice.
Now, I am making a VEM, which is going pretty okay.
Behold
— NOTE —
This is not a ready script
it will not compile ( I think?)
I implemented the walking part there too…
R.I.P CoalMinerForDesert
I simply couldn't beat the deserts of Al-Kharid in walking.
I tweaked the walking over a month, easily over hundred hours looking at a fucking DDTM!!
There is 2k lines of code, so somebody else can finish it, though mentioning me in the credits would be nice.
Now, I am making a VEM, which is going pretty okay.
Behold
— NOTE —
This is not a ready script
it will not compile ( I think?)
I implemented the walking part there too…
{=========================================================================]
[ CoalMinerForDesert ]
[ ]
[ NAME : CoalMinerForDesert ]
[ WRITER : N3ss3s ]
[ CATEGORY : Mining ]
[ DESCRIPTION : A Coal Miner For Al-Kharid Mine ]
[ USAGE : Collecting coal. ]
[ AUTOCOLOR : Option ]
[ NOTES : Watch the script mine one coal, just incase. ]
[ NOTES2 : Procedure commenting is in the end of the script ]
[ CONTACT : PM n3ss3s at [url]www.SRL-Forums.com[/url] ]
[ ]
[ ]
[=========================================================================]
[ ]
[=========================================================================]
[ Instructions. ]
[=========================================================================]
[ 1. USE Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames and Passwords in DeclarePlayers. ]
[ 4. SET HOWMANYPLAYERS inside DeclarePlayers ]
[ 5. SET Constants Starting From Line 31 ]
[ 6. Place your characters in Al-Kharid bank, about middle. ]
[ 7. Start script Logged In! ]
[=========================================================================}
{=========================================================================]
[ Const 1 - If you are NOT using KYAB, go in the A-K bank, and pick the ]
[ sand color near doors on mm, the one the area has most... ]
[ Const 2 - SRL Stats ID. ]
[ Const 3 - SRL Stats Password. ]
[ Const 4 - Are we using KYAB? ]
[ For KYAB, go to [url]www.KYAB.Asssoft.org[/url] ]
[=========================================================================}
{=========================================================================]
[ If you are using KYAB mode, you need Fixed SRL for KYAB from KYAB Home ]
[ - [url]www.KYAB.Asssoft.org[/url] - else, use regular SRL ]
[=========================================================================}
Program CoalMinerForDesert;
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/KYAB.scar}
{.include SRL/SRL/Skill/Mining.scar}
Const SC = 7516358;
Const SRL_ID = '2759'; // These are stats of the "leecher" acc..
Const SRL_Pass = 'koolminer'; // Yay 4 wizzy!
Const KYAB_Mode = False;
///////////////////////// EXTRA \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Const PowerMode = False;
//\\\\\\\\\\\\\\\\\Only in KYAB mode ////////////////////////////
//// In PowerMode start the script next to the rocks!\\\\\\\\\\\\
//\\ Its a powermining mode, no banking and only for KYAB users//
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
Var CoalTol, CoalArea, CC, Gases, CLS: Integer;
Var InterCX, InterCY, AxesHandled: Integer;
Var PlayerLooper, DCTR, Banked: Integer;
Var RLSC, Stepz, Loads: Integer;
Var CoalSlots: TIntegerArray;
Var NeedNew, FirstW: Boolean;
Var TBP, TMP: TPointArray;
{=========================================================]
[ Declares the SRL Player Array ==========================]
[=========================================================}
Procedure DeclarePlayers;
Begin
HowManyPlayers := 6;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
SRLID := SRL_ID;
SRLPassword := SRL_Pass;
RLSC := SC;
CC := 2122820;
Loads := 33 + Random(6); // Set the loads here.
Players[0].Name := 'Timekiller46';
Players[0].Pass := 'Password';
Players[0].Nick := 'eki';
Players[0].Booleans[0] := False; (* Spare axes? *)
Players[0].Integers[0] := 1; (* If spare axes, what bank slot X? *)
Players[0].Integers[1] := 1; (* If spare axes, what bank slot Y? *)
Players[0].Active := True;
Players[1].Name := 'Username';
Players[1].Pass := 'Password';
Players[1].Nick := 'ser';
Players[1].Booleans[0] := False; (* Spare axes? *)
Players[1].Integers[0] := 1; (* If spare axes, what bank slot X? *)
Players[1].Integers[1] := 1; (* If spare axes, what bank slot Y? *)
Players[1].Active := True;
Players[2].Name := 'Username';
Players[2].Pass := 'Password';
Players[2].Nick := 'ser';
Players[2].Booleans[0] := False; (* Spare axes? *)
Players[2].Integers[0] := 1; (* If spare axes, what bank slot X? *)
Players[2].Integers[1] := 1; (* If spare axes, what bank slot Y? *)
Players[2].Active := True;
Players[3].Name := 'Username';
Players[3].Pass := 'Password';
Players[3].Nick := 'ser';
Players[3].Booleans[0] := False; (* Spare axes? *)
Players[3].Integers[0] := 1; (* If spare axes, what bank slot X? *)
Players[3].Integers[1] := 1; (* If spare axes, what bank slot Y? *)
Players[3].Active := True;
Players[4].Name := 'Username';
Players[4].Pass := 'Password';
Players[4].Nick := 'ser';
Players[4].Booleans[0] := False; (* Spare axes? *)
Players[4].Integers[0] := 1; (* If spare axes, what bank slot X? *)
Players[4].Integers[1] := 1; (* If spare axes, what bank slot Y? *)
Players[4].Active := True;
Players[5].Name := 'Username';
Players[5].Pass := 'Password';
Players[5].Nick := 'ser';
Players[5].Booleans[0] := False; (* Spare axes? *)
Players[5].Integers[0] := 1; (* If spare axes, what bank slot X? *)
Players[5].Integers[1] := 1; (* If spare axes, what bank slot Y? *)
Players[5].Active := True;
End;
{=========================================================]
[ Returns how many hours the script has worked in decimal ]
[=========================================================}
Function HoursWorked: Extended;
Var
I: Integer;
Begin
I := GetTimeRunning;
Result := I / 1000 / 60 / 60;
End;
{=========================================================]
[ Modifies the text for one proggy line ==================]
[=========================================================}
Function FixProg(ST, Max: String): String; // From JuKKas guild miner.
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;
{=========================================================]
[ Progress report ========================================]
[=========================================================}
Procedure ProgressReport; // Modded from JuKKas guild miner.
Var
ActiveT, Longest: String;
Prog: Array[0..5] Of String;
I: Integer;
Begin
Writeln('/----------------------------------------\');
Writeln('| n3ss3s''s Desert coal miner |');
Longest:= ('|------------ Mining Report -------------|');
Writeln(Longest);
Prog[0]:= '| Worked: ' + FloatToStr(HoursWorked)+' hrs.';
Prog[1]:= '| Mined : ' + IntToStr(CLS) + ' Coals';
Prog[2]:= '| Gained: ' + IntToStr(CLS * 50) + ' Exp';
Prog[3]:= '| Banked: ' + IntToStr(Banked) + ' Loads';
Prog[4]:= '| Found : ' + IntToStr(Gases) + ' Gasses';
For I := 0 To 4 Do
Begin
Prog[I]:= FixProg(Prog[I], Longest);
Writeln(Prog[I]);
End;
Writeln('|------------ Players Report ------------|');
For I:= 0 To HowManyPlayers - 1 Do
Begin
If(Players[I].Active)Then
Begin
ActiveT := 'T';
End Else
Begin
ActiveT:= 'F';
End;
Prog[5]:= ('| #: '+IntToStr(I)+ ' Active: '+ActiveT+ ' - Mining Level: '+IntToStr(Players[I].Level[15])+ '; Coal: '+IntToStr(Players[I].Integers[0])+ '; Gained: '+IntToStr(Players[I].Integers[1])+ '; Banked: '+IntToStr(Banked)+ '; Location: '+Players[I].Loc +';');
Writeln(Prog[5]);
End;
Writeln('\----------------------------------------/');
SRLRandomsReport;
End;
{=========================================================]
[ Loads the KYAB paths, even you cant see rest of proc ===]
[=========================================================}
Procedure Paths;
{=========================================================]
[ Finds the sand color in Al-Kharid ======================]
[=========================================================}
// Forgot where to use xD Begin SetArrayLength(TBP,20); SetArrayLength(TMP,18); TBP[0].X:=3302; TBP[0].Y:=3298; TBP[1].X:=3302; TBP[1].Y:=3293; TBP[2].X:=3300; TBP[2].Y:=3288; TBP[3].X:=3301; TBP[3].Y:=3281; TBP[4].X:=3298; TBP[4].Y:=3275; TBP[5].X:=3296; TBP[5].Y:=3265; TBP[6].X:=3296; TBP[6].Y:=3258; TBP[7].X:=3295; TBP[7].Y:=3251; TBP[8].X:=3291; TBP[8].Y:=3245; TBP[9].X:=3290; TBP[9].Y:=3237; TBP[10].X:=3284; TBP[10].Y:=3232; TBP[11].X:=3280; TBP[11].Y:=3226; TBP[12].X:=3282; TBP[12].Y:=3219; TBP[13].X:=3285; TBP[13].Y:=3210; TBP[14].X:=3282;TBP[14].Y:=3203; TBP[15].X:=3281; TBP[15].Y:=3196; TBP[16].X:=3282; TBP[16].Y:=3189; TBP[17].X:=3278; TBP[17].Y:=3180; TBP[18].X:=3275; TBP[18].Y:=3170; TBP[19].X:=3269; TBP[19].Y:=3166; TMP[0].X:=3275; TMP[0].Y:=3168; TMP[1].X:=3278; TMP[1].Y:=3176; TMP[2].X:=3281; TMP[2].Y:=3181; TMP[3].X:=3283; TMP[3].Y:=3191; TMP[4].X:=3285; TMP[4].Y:=3199; TMP[5].X:=3282; TMP[5].Y:=3205; TMP[6].X:=3285; TMP[6].Y:=3211; TMP[7].X:=3281; TMP[7].Y:=3219; TMP[8].X:=3280; TMP[8].Y:=3228; TMP[9].X:=3285; TMP[9].Y:=3234; TMP[10].X:=3285; TMP[10].Y:=3240; TMP[11].X:=3289; TMP[11].Y:=3248; TMP[12].X:=3290; TMP[12].Y:=3255; TMP[13].X:=3293; TMP[13].Y:=3263; TMP[14].X:=3296; TMP[14].Y:=3275; TMP[15].X:=3300; TMP[15].Y:=3285; TMP[16].X:=3301; TMP[16].Y:=3292; TMP[17].X:=3302; TMP[17].Y:=3301; End;
Function FindSandColor: Integer;
Var
X, Y, CTS: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
Result := 0;
If (FindColoredAreaTolerance(X, Y, RLSC, MMX1, MMY1, MMX2, MMY2, 100, 15)) Then
Begin
Result := GetColor(X, Y);
End Else
Begin
Result := SC;
End;
ColorToleranceSpeed(CTS);
End;
{=========================================================]
[ Returns true if we are in kharid bank. Forgot where used]
[=========================================================}
Function Al_Kharid: Boolean;
Var
TPA: TPointArray;
Var
CactusPoints, CTS: Integer;
Begin
If (Not (LoggedIn)) Then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
CactusPoints := 340;
If(Not(GetArrayLength(TPA) <= 1))Then
Begin
FindColorsTolerance(TPA, CC, MMX1, MMY1, MMX2, MMY2, 15);
Repeat
If (GetArrayLength(TPA) >= CactusPoints) Then
Begin
Writeln('Al-Kharid detected by cactuses!');
Result := True;
End Else
CactusPoints := CactusPoints - 1;
Until (CactusPoints <= 325) Or (Result) Or (Not (LoggedIn));
CC := GetColor(TPA[0].x, TPA[0].y);
End;
ColorToleranceSpeed(CTS);
End;
{=========================================================]
[ Finds the bankers on MM and walks to them ==============]
[=========================================================}
Function FindBankers: Boolean;
Var
I, X, Y: Integer;
Var
TB: TBox;
Var
TP, T: TPoint;
Var
TPA, Bankers: TPointArray;
Begin
If (Not (LoggedIn)) Then Exit;
If (Not (AL_Kharid)) Then Exit;
MakeCompass('n');
FindColorsSpiralTolerance(MMCX, MMCY, TPA, 195836, MMX1, MMY1, MMX2, MMY2, 15);
For I := 0 To GetArrayLength(TPA) - 1 Do
Begin
TP := TPA[i];
TB := IntToBox(TP.x - 4, TP.y - 25, TP.x + 4, TP.y + 25);
T := IntToPoint(TB.x1 + ((TB.x2 - TB.x1) / 2), TB.y1 + ((TB.y2 - TB.y1) / 2));
FindColorsSpiralTolerance(T.x, T.y, Bankers, 195836, TB.x1, TB.y1, TB.x2, TB.y2, 15);
If (GetArrayLength(Bankers) >= 6) Then
Begin
If(FindColorTolerance(X, Y, 6392206, T.x - 10, T.y - 10, T.x + 10, T.y + 10, 25))Then
Begin
Mouse(T.x + 6, T.y - 6, 2, 2, True);
Flag;
Result := True;
Exit;
End;
End;
End;
End;
{=========================================================]
[ Opens Kharid bank ======================================]
[=========================================================}
Function OpenKharidBank: Boolean;
Var
TPA, Skip: TPointArray;
Var
I, X, Y, CTS: Integer;
Var
C, Ctr, M: Integer;
Var
Skipp: Integer;
Var
BCMD: Boolean;
Var
TP, T: TPoint;
Begin
If (Not (LoggedIn)) Then Exit;
If BankScreen Then Exit;
CTS := GetColorToleranceSpeed;
M := GetSystemTime;
ColorToleranceSpeed(2);
Repeat
Wait(25);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 5462367, MSX1, MSY1, MSX2, MSY2, 15);
If (GetArrayLength(TPA) <= 0) Then Exit;
For I := 0 To GetArrayLength(TPA) - 1 Do
Begin
Wait(5);
BCMD := False;
TP := TPA[i];
For Skipp := 0 To GetArrayLength(Skip) - 1 Do
Begin
T := Skip[Skipp];
If (PointInBox(TP, IntToBox(T.x - 10, T.y - 10, T.x + 10, T.y + 10))) Then
Begin
BCMD := True;
Break;
End;
End;
If (BCMD) Then Continue;
If (FindColorTolerance(X, Y, 4870227, TP.x - 10, TP.y - 10, TP.x + 10, TP.y + 10, 15)) Then
Begin
Writeln('Bank finding: '+IntToStr(GetSystemTime - M));
MMouse(TP.x, TP.y, 3, 3);
If (IsUpTextMulti('Bank booth', 'Bank bo', 'ank booth')) Then
Begin
GetMousePos(X, Y);
Mouse(X, Y, 1, 1, False);
If (ChooseOption('uickl')) Then
Begin
Repeat
C := C + 1;
Wait(100);
Until (C > 100) Or (BankScreen) Or (Not (LoggedIn));
If (BankScreen) Then
Begin
Result := True;
ColorToleranceSpeed(CTS);
Writeln('Bank opening: '+IntToStr(GetSystemTime - M));
Exit;
End Else
Begin
If (Not (LoggedIn)) Then
Begin
Result := False;
ColorToleranceSpeed(CTS);
Writeln(IntToStr(GetSystemTime - M));
Exit;
End;
End;
SetArrayLength(Skip, GetArrayLength(Skip) + 1);
Skip[GetArrayLength(Skip) - 1] := TPA[i];
End;
End Else
Begin
SetArrayLength(Skip, GetArrayLength(Skip) + 1);
Skip[GetArrayLength(Skip) - 1] := TPA[i];
End;
If (Not (LoggedIn)) Then Exit;
End;
If (Not (LoggedIn)) Then Exit;
End;
Ctr := Ctr + 1;
Until (Result) Or (Not (LoggedIn)) Or (Ctr > 10);
ColorToleranceSpeed(CTS);
Writeln(IntToStr(GetSystemTime - M));
End;
{=========================================================]
[ Returns the DTM of a coal ore ==========================]
[=========================================================}
Function CoalDDTM: Integer;
Var
CoalMP: TDTMPointDef;
Var
CoalSP: Array[0..8] Of TDTMPointDef;
Var
CoalDTMSkel: TDTM;
Begin
CoalMP.x := 622;
CoalMP.y := 300;
CoalMP.AreaSize := 0;
CoalMP.AreaShape := 0;
CoalMP.Color := 2570297;
CoalMP.Tolerance := CoalTol;
CoalSP[0].x := 634;
CoalSP[0].y := 292;
CoalSP[0].AreaSize := CoalArea;
CoalSP[0].AreaShape := 0;
CoalSP[0].Color := 65536;
CoalSP[0].Tolerance := 0;
CoalSP[1].x := 634;
CoalSP[1].y := 298;
CoalSP[1].AreaSize := CoalArea;
CoalSP[1].AreaShape := 0;
CoalSP[1].Color := 65536;
CoalSP[1].Tolerance := 0;
CoalSP[2].x := 632;
CoalSP[2].y := 307;
CoalSP[2].AreaSize := CoalArea;
CoalSP[2].AreaShape := 0;
CoalSP[2].Color := 65536;
CoalSP[2].Tolerance := 0;
CoalSP[3].x := 625;
CoalSP[3].y := 308;
CoalSP[3].AreaSize := CoalArea;
CoalSP[3].AreaShape := 0;
CoalSP[3].Color := 65536;
CoalSP[3].Tolerance := 0;
CoalSP[4].x := 612;
CoalSP[4].y := 307;
CoalSP[4].AreaSize := CoalArea;
CoalSP[4].AreaShape := 0;
CoalSP[4].Color := 65536;
CoalSP[4].Tolerance := 0;
CoalSP[5].x := 605;
CoalSP[5].y := 305;
CoalSP[5].AreaSize := CoalArea;
CoalSP[5].AreaShape := 0;
CoalSP[5].Color := 65536;
CoalSP[5].Tolerance := 0;
CoalSP[6].x := 605;
CoalSP[6].y := 300;
CoalSP[6].AreaSize := CoalArea;
CoalSP[6].AreaShape := 0;
CoalSP[6].Color := 65536;
CoalSP[6].Tolerance := 0;
CoalSP[7].x := 615;
CoalSP[7].y := 290;
CoalSP[7].AreaSize := CoalArea;
CoalSP[7].AreaShape := 0;
CoalSP[7].Color := 65536;
CoalSP[7].Tolerance := 0;
CoalSP[8].x := 624;
CoalSP[8].y := 288;
CoalSP[8].AreaSize := CoalArea;
CoalSP[8].AreaShape := 0;
CoalSP[8].Color := 65536;
CoalSP[8].Tolerance := 0;
CoalDTMSkel.MainPoint := CoalMP;
CoalDTMSkel.SubPoints := CoalSP;
Result := AddDTM(CoalDTMSkel);
End;
{=========================================================]
[ Returns the DTM of a coal ore ==========================]
[=========================================================}
Function CreateCoalDTM(Var TheCDTM: Integer): Boolean;
Var
CoalDTM, X, Y: Integer;
Begin
CoalTol := 10;
Repeat
CoalTol := CoalTol + 1;
Repeat
CoalDTM := CoalDDTM;
If (FindDTM(CoalDTM, X, Y, MIX1, MIY1, MIX2, MIY2)) Then
Begin
Result := True;
TheCDTM := CoalDTM;
Exit;
End;
CoalArea := CoalArea + 1;
Until (CoalArea >= 5);
CoalArea := 0;
Until (CoalTol >= 50);
End;
{=========================================================]
[ Enlarges a TBox to all directions by "Pix" pixels ======]
[=========================================================}
Procedure EnlargeTBox(Var TheBox: TBox; Pix: Integer);
Begin
TheBox.x1 := TheBox.x1 - Pix;
TheBox.y1 := TheBox.y1 - Pix;
TheBox.x2 := TheBox.x2 + Pix;
TheBox.y2 := TheBox.y2 + Pix;
End;
{=========================================================]
[ Returns the coal color =================================]
[=========================================================}
Function GetCC: Integer; // Very useful for getting middle of light and dark
Var
HSL: Array of Array of Extended;
Var
H, S, L: Extended;
Var
Colors: TIntegerArray;
Var
C: Integer;
Begin
Colors := [3032389, 2110002];
SetArrayLength(HSL, 2);
SetArrayLength(HSL[0], 3);
SetArrayLength(HSL[1], 3);
For C := 0 To 1 Do
Begin
ColorToHSL(Colors[c], HSL[c][0], HSL[c][1], HSL[c][2]);
End;
H := HSL[1][0] - ((HSL[1][0] - HSL[0][0])/4);
S := HSL[1][1] - ((HSL[1][1] - HSL[0][1])/4);
L := HSL[1][2] - ((HSL[1][2] - HSL[0][2])/2);
Result := HSLToColor(H, S, L);
End;
{=========================================================]
[ Finds a rock on the main screen rly fast ===============]
[=========================================================}
// Revamped to receive only coords of one rock, realized that dont need more \\
Function FindRockIn(Var RockPoint: TPoint; x1, y1, x2, y2, C: Integer): Boolean;
Var
L, I, CTS, X, Y: Integer;
Var
TPA, TPA2: TPointArray;
Var
TP: TPoint;
Begin
If(Not(LoggedIn))Then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, C, x1, y1, x2, y2, 10);
L := GetArrayLength(TPA) - 1;
For I := 0 To L Do
Begin
TP := TPA[i];
X := TP.x;
Y := TP.y;
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) >= 35)Then
Begin
RockPoint := MiddleTPA(TPA2);
Result := True;
Break;
End;
End;
ColorToleranceSpeed(CTS);
End;
{=========================================================]
[ Waits until coal is present or 50 seconds has passed ===]
[=========================================================}
Function WaitUntilRock(Var Rx, Ry: Integer; Col: Integer): Boolean;
Var
T: Integer;
Var
TP: TPoint;
Begin
T := GetSystemTime;
Repeat
Wait(500);
If (FindRockIn(TP, MSX1, MSY1, MSX2, MSY2, Col)) Then
Begin
Rx := TP.x;
Ry := TP.y;
Result := True;
Exit;
End;
Until ((GetSystemTime - T) > 50000) Or (Not (LoggedIn));
End;
{=========================================================]
[ Follows the coal coordinates when we move ==============]
[=========================================================}
Procedure FollowRock(Var CoalX, CoalY: Integer; Col: Integer);
Var
TP: TPoint;
Begin
If (Not (LoggedIn)) Then Exit;
Case KYAB_Mode Of
False:
Begin
Repeat
Begin
If (FindRockIn(TP, CoalX - 15, CoalY - 15, CoalX + 15, CoalY + 15, Col)) Then
Begin
CoalX := TP.x;
CoalY := TP.y;
End;
Wait(25);
If (Not (LoggedIn)) Then
Begin
CoalX := 0;
CoalY := 0;
Exit;
End;
End;
Until (Not (FlagPresent)) Or (Not (LoggedIn));
End;
True:
Begin
Repeat
Begin
If (FindRockIn(TP, CoalX - 15, CoalY - 15, CoalX + 15, CoalY + 15, Col)) Then
Begin
CoalX := TP.x;
CoalY := TP.y;
End;
Wait(25);
If (Not (LoggedIn)) Then
Begin
CoalX := 0;
CoalY := 0;
Exit;
End;
End;
Until (Not (KYAB_IsMoving)) Or (Not (LoggedIn));
End;
End;
End;
{=========================================================]
[ Returns true if we still have axe head =================]
[=========================================================}
Function GotHead: Boolean;
Var
Head, X, Y: Integer;
Begin
Head := DTMFromString('78DA6374676260F8CC800618914820ED0954F' +
'38D809A00A09A5F04D4F801D5FC25C2AEDF04D45811760F00A41F' +
'07A1');
Result := FindDTM(Head, X, Y, MIX1, MIY1, MIX2, MIY2);
FreeDTM(Head);
End;
{=========================================================]
[ If our pick head has dropped, tries to pick it up ======]
[=========================================================}
Function HandleLostAxe: Boolean;
Var
X, Y, Z, CTS, H, S, I, Q, Px, Py, Hx, Hy: Integer;
Var
TPA, TPA2, TPA3: TPointArray;
Var
C: TIntegerArray;
Var
TP: TPoint;
Begin
If(GotHead) Or (Not(LoggedIn)) Then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
C := [hc1, hc2, hc3, hc4, hc5];
H := GetClientWindowHandle;
S := BitmapFromString2(False, '');
CopyClientToBitmap(S, MSX1, MSY1, MSX2, MSY2);
SetTargetBitmap(S);
For Z := 0 To GetArrayLength(C) - 1 Do
Begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, C[z], MSX1, MSY1, MSX2, MSY2, 15);
For I := 0 To GetArrayLength(TPA) - 1 Do
Begin
TP := TPA[i];
FastSetPixel(s, TP.x, TP.y, 255);
End;
X := MSCX;
Y := MSCY;
FindColorSpiral2(X, Y, 255, MSX1, MSY1, MSX2, MSY2);
FindColorsTolerance(TPA2, 255, X - 5, Y - 5, X + 5, Y + 5, 0);
If(GetArrayLength(TPA2) >= 6)Then
Begin
SetArrayLength(TPA3, GetArrayLength(TPA3) + 1);
TPA3[GetArrayLength(TPA3) - 1] := MiddleTPA(TPA2);
End;
End;
If(Not(GetArrayLength(TPA3) <= 0))Then
Begin
For Q := 0 To GetArrayLength(TPA3) - 1 Do
Begin
MMouse(TPA3[q].x, TPA3[q].y, 2, 2);
If(IsUpTextMulti('ake', 'ick', 'ead'))Then
Begin
If(InvFull)Then
Begin
DropItem(28);
Wait(750 + Random(250));
End;
Mouse(TPA3[q].x, TPA3[q].y, 1, 1, True);
Wait(500 + Random(25));
If(FindBitmapToleranceIn(PickHead, Px, Py, MIX1, MIY1, MIX2, MIY2, 50))
And(FindBitmapToleranceIn(PickHandle, Hx, Hy, MIX1, MIY1, MIX2, MIY2, 50))Then
Begin
Mouse(Px, Py, 2, 2, True);
Wait(50 + Random(25));
Mouse(Hx, Hy, 2, 2, True);
Wait(500 + Random(25));
Result := True;
End Else
Begin
Writeln('Sorry m8, we lost your pick =/ ');
If(Players[CurrentPlayer].Booleans[0])Then
Begin
NeedNew := True;
End;
Exit;
End;
End;
End;
End;
End;
{=========================================================]
[ Clicks an iron rock if found ===========================]
[=========================================================}
Function ClickRock(Iron: Boolean): Boolean;
Var
X, Y, C: Integer;
Var
Txt: Boolean;
Begin
If(Not(LoggedIn))Then Exit;
If(Iron)Then
Begin
C := 2569300;
End Else
Begin
C := GetCC;
End;
If (WaitUntilRock(X, Y, C)) Then
Begin
If(GasFound(X, Y))Then Exit;
Mouse(X, Y, 2, 2, True);
Wait(50);
If(Not(FlagPresent))Then
Begin
If(FindTalk)Then
Begin
Exit;
End;
End;
FollowRock(X, Y, C);
Flag;
If(FTWait(4))Then
Begin
Exit;
End;
If(Not(GotHead))Then
Begin
If(HandleLostAxe)Then
Begin
AxesHandled := AxesHandled + 1;
End Else
Begin
If(Not(LoggedIn))Then
Begin
Logout;
End;
Exit;
End;
End;
Repeat
If(InChat('currently av'))Then
Begin
Result := False;
Txt := True;
Exit;
End;
If(InChat('swing your'))Then
Begin
If (Not (X = 0)) Then
Begin
InterCX := X;
InterCY := Y;
Result := True;
Txt := True;
End;
End;
Until(Txt) Or (Not(LoggedIn));
End;
End;
{=========================================================]
[ Returns true if a rock of RC color is present ==========]
[=========================================================}
Function RockThere(RC: Integer): Boolean;
Var
TP: TPoint;
Begin
Result := FindRockIn(TP, InterCX - 20, InterCY - 20, InterCX + 20, InterCY + 20, RC);
End;
Function CountCoals: Integer; Forward;
{=========================================================]
[ Mines one rock =========================================]
[=========================================================}
Procedure MineRock;
Var
MM, CCC, IC: Integer;
Begin
If(Not(LoggedIn))Then Exit;
IC := CountCoals;
If (ClickRock(False)) Then
Begin
MarkTime(MM);
Case KYAB_Mode Of
False:
Begin
Repeat
FindTalk;
Wait(150 + Random(25));
If(GasFound(InterCX, InterCY))Then
Begin
MouseFindFlag(MMCX, MMCY, -1, - 1);
Wait(18000 + Random(2000));
ReportVars[2] := ReportVars[2] + 1;
Gases := Gases + 1;
SRLRandomsReport;
Exit;
End;
If(FindFight)Then
Begin
RunTo('s', True);
ReportVars[3] := ReportVars[3] + 1;
SRLRandomsReport;
End;
CCC := CCC + 1;
If(CCC Mod 5 = 0)Then
If(FindNormalRandoms)Then Exit;
Wait(250 + Random(250));
Until (Not (RockThere(GetCC))) Or (Not(LoggedIn)) Or (TimeFromMark(MM) > 15000);
End;
True:
Begin
Repeat
FindTalk;
Wait(50 + Random(25));
If(GasFound(InterCX, InterCY))Then
Begin
MouseFindFlag(MMCX, MMCY, -1, - 1);
Wait(18000 + Random(2000));
ReportVars[2] := ReportVars[2] + 1;
Gases := Gases + 1;
SRLRandomsReport;
Exit;
End;
If(FindFight)Then
Begin
RunTo('s', True);
ReportVars[3] := ReportVars[3] + 1;
SRLRandomsReport;
End;
CCC := CCC + 1;
If(CCC Mod 2 = 0)Then
If(FindNormalRandoms)Then Exit;
Wait(250 + Random(250));
Until (Not (GetAnimation = 629)) Or (Not(LoggedIn)) Or (TimeFromMark(MM) > 15000);
End;
End;
End;
If(CountCoals > IC)Then
Begin
ReportVars[0] := ReportVars[0] + 1;
SRLRandomsReport;
End;
End;
{=========================================================]
[ Text sending with less mistakes than SendText2..........]
[=========================================================}
Procedure PlawkxSend(T3etxs: String);
Var
Rands: TStringArray;
Var
I, M: Integer;
Var
T: String;
Begin
Rands := ['1', 'k', 'j', 'v', 't', 'r'];
For I := 0 To Length(T3etxs) - 1 Do
Begin
If(Random(5) > 2) And (M < 4)Then
Begin
T := T + Rands[Random(Length(Rands))];
End Else
Begin
T := T + T3etxs[i];
End;
End;
TypeSend(T);
End;
{=========================================================]
[ Mines iron. [EXTRA] - in powermining mode. Antiban incl.]
[=========================================================}
Procedure PowerMineRocks;
Var
IC, I, Safe, CTR: Integer;
Begin
Repeat
FindNormalRandoms;
Wait(100 + Random(250));
If(ClickRock(True))Then
Begin
FTWait(2);
IC := 0;
IC := CountCoals;
Safe := GetSystemTime;
Repeat
If(Random(4) = 2)Then
Begin
If(Random(8) = 3)Then
Begin
SendText2('Mining lvls? '+IntToStr(GetSkillLevel('mining')) + 'here');
End Else
Begin
Case Random(4) Of
0: MMouse(MSX1, MSY1, MIX2, MIY2);
1: MMouse(MSX1, MSY1, MMX2, MMY2);
2: MMouse(MCX1, MCY1, MMX2, MMY1);
3: Sleep(250 + Random(550));
End;
End;
End;
Wait(150 + Random(50));
CTR := CTR + 1;
If(Not(LoggedIn))Then Exit;
If(GasFound(InterCX, InterCY))Then
Begin
MouseFindFlag(MMCX, MMCY, -2, 2, True);
Wait(20000 + Random(4500));
Break;
End;
Until(Not(RockThere(2569300))) Or (GetSystemTime - Safe >= 10000);
If(CountCoals > IC)Then
Begin
Inc(ReportVars[0]);
Inc(Players[CurrentPlayer].Integers[0]);
End;
End;
Wait(250 + Random(250));
Until(InvFull) Or (Not(LoggedIn));
End;
{=========================================================]
[ Results the amount of coals in inventory ===============]
[=========================================================}
Function CountCoals: Integer;
Var
I, C, X, Y: Integer;
Var
IB: TBox;
Begin
SetArrayLength(CoalSlots, 0);
If (CreateCoalDTM(i)) Then
Begin
For C := 1 To 28 Do
Begin
IB := InvBox(c);
If (FindDTM(I, X, Y, IB.x1, IB.y1, IB.x2, IB.y2)) Then
Begin
SetArrayLength(CoalSlots, GetArrayLength(CoalSlots) + 1);
CoalSlots[GetArrayLength(CoalSlots) - 1] := c;
Result := Result + 1;
End;
End;
FreeDTM(i);
End;
End;
{=========================================================]
[ Waits until flag is present or 3 seconds have passed ===]
[=========================================================}
Procedure UntilFlag;
Var
I: Integer;
Begin
Repeat
Wait(100);
I := I + 1;
Until(FlagPresent) Or (I > 30);
End;
{=========================================================]
[ A shitty radial-style walker for walking on sand =======]
[=========================================================}
Function ShittySandWalk(StartRadial, EndRadial, A: Integer; Var TR: Integer): Boolean; // SSW? :D
// Hmm, slowly this is starting to remind RRW more and more..? :D
// Even DDTMs will be used, I leave this here if someone wants to know
// about how to use Sine and Cose to get a point in angle to some midpoint.
Var
I, X, Y, R, CTS, Q: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
R := 68;
Q := FindSandColor;
If(Not(Q = 0))Then
Begin
RLSC := Q;
End Else
Begin
Exit;
End;
Repeat
Wait(2);
If(StartRadial < EndRadial)Then
Begin
For I := StartRadial To EndRadial Do
Begin
X := Round(R * Sine(I)) + MMCX;
Y := Round(-R * Cose(I)) + MMCY;
If (SimilarColors(GetColor(X, Y), RLSC, 25)) Then
Begin
MouseFindFlag(X + A, Y, 0, + 3);
UntilFlag;
Flag;
Wait(500 + Random(250));
Result := True;
TR := R;
ColorToleranceSpeed(CTS);
Exit;
End Else
Begin
Q := FindSandColor;
If(Not(Q = 0))Then
Begin
RLSC := Q;
End;
End;
End;
End Else
Begin
For I := StartRadial DownTo EndRadial Do
Begin
X := Round(R * Sine(I)) + MMCX;
Y := Round(-R * Cose(I)) + MMCY;
If (SimilarColors(GetColor(X, Y), RLSC, 20)) Then
Begin
MouseFindFlag(X + A, Y, 0, + 3);
UntilFlag;
Flag;
Wait(500 + Random(250));
Result := True;
TR := R;
ColorToleranceSpeed(CTS);
Exit;
End Else
Begin
Q := FindSandColor;
If(Not(Q = 0))Then
Begin
RLSC := Q;
End;
End;
End;
End;
R := R - 1;
Until (R <= 1);
ColorToleranceSpeed(CTS);
End;
{=========================================================]
[ Gets the wall color of mine on MM and returns TPA ======]
[=========================================================}
Function GetWallColor(Var TPA: TPointArray; Xz1, Xz2: Integer): Integer;
Var
X, Y, I, CTS: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
If (FindColorTolerance(X, Y, 6721943, MMX1, MMY1, MMX2, MMY2, 20)) Then
Begin
Result := GetColor(x, Y);
End;
FindColorsTolerance(TPA, Result, Xz1, MMY1, Xz2, MMY2, 10);
For I := 0 To GetArrayLength(TPA) - 1 Do
Begin
If (Not (Rs_OnMinimap(TPA[i].x, TPA[i].y))) Then
Begin
SetArrayLength(TPA, GetArrayLength(TPA) + 1);
TPA[GetArrayLength(TPA) - 1].x := TPA[i].x;
TPA[GetArrayLength(TPA) - 1].y := TPA[i].y;
TPA[i].x := 0;
TPA[i].y := 0;
SetArrayLength(TPA, GetArrayLength(TPA) - 1);
End;
End;
ColorToleranceSpeed(CTS);
End;
{=========================================================]
[ Returns how many "wall pixels" there is ================]
[=========================================================}
Function InMine: Integer;
Var
RTPA: TPointArray;
Begin
GetWallColor(RTPA, MMX1, MMX2);
Result := GetArrayLength(RTPA);
End;
{=========================================================]
[ Gets the horizontal edges of the mine ==================]
[=========================================================}
Procedure GetCaveEdges(Var T1, T2: Integer);
Var
TPA: TPointArray;
Var
C: Integer;
Begin
C := GetWallColor(TPA, MMX1, MMCX);
T1 := TPA[GetArrayLength(TPA) - 1].x;
C := GetWallColor(TPA, MMCX, MMX2);
T2 := TPA[GetArrayLength(TPA) - 1].x;
Writeln(IntToStr(T1) + ' '+IntToStr(t2));
End;
{=========================================================]
[ Walks in the mine by "Radius" - or + ===================]
[=========================================================}
Procedure OutWallWalk(Radius, Left: Integer);
Var
T3: TPoint;
Var
T1, T2: Integer;
Begin
GetCaveEdges(T1, T2);
T3.x := T2 - (T2 - T1);
T3.y := MMCY + Radius;
MouseFindFlag(T3.x - (Random(3) + Left), T3.y + Random(3), -2, -2);
UntilFlag;
Flag;
Wait(500 + Random(250));
End;
{=========================================================]
[ Sets current players loc to lost and logs out ==========]
[=========================================================}
Procedure Lost;
Begin
Players[CurrentPlayer].Loc := 'lost';
Logout;
End;
{=========================================================]
[ Walks to mine ==========================================]
[=========================================================}
// Coming, updating to DDTMs
{=========================================================]
[ Walks to mine ==========================================]
[=========================================================}
Function MineWalk2: Boolean;
Var
L, X, Y, Randomm, D, I: Integer;
Begin
If(Not(LoggedIn))Then Exit;
Begin
L := GetArrayLength(TMP);
For I := 0 To L - 1 Do
Begin
Case Random(2) Of
0: Randomm := -Random(4);
1: Randomm := Random(4);
End;
If(Not(Random(2) = 0)) And (Not(I = (L-1))) Then
Begin
X := TMP[i + 1].x + Randomm;
Y := TMP[i + 1].y + Randomm;
If(Rs_OnMinimap(X, Y))Then
Begin
MouseFindFlag(X, Y, -1, -1);
FFLag(10);
D := 1;
End;
End;
If(Not(D = 1))Then
Begin
NewWalkToTile(TMP[i].x + Randomm, TMP[i].y + Randomm);
End;
End;
If(PointInBox(GetLocation, IntToBox(3300, 3302, 3304, 3297)))Then
Begin
Result := True;
End;
End;
End;
{=========================================================]
[ Handles lake ===========================================]
[=========================================================}
Function HandleLake: Boolean; // Lake didnt want it RRW way, we do it my way :)
Var
CTS, C: Integer;
Var
TPA: TPointArray;
Var
FarAwayLake: TPoint;
Begin
If(Not(LoggedIn))Then Exit;
Begin
CTS := GetColorToleranceSpeed;
C := 0;
C := FindWaterColor;
If(Not(C > 0))Then Exit;
Begin
FindColorsTolerance(TPA, FindWaterColor, MMX1, MMY1, MMX2, MMY2, 2);
SortTPAFrom(TPA, IntToPoint(MMCX, MMCY));
FarAwayLake := TPA[GetArrayLength(TPA) - 1];
MouseFindFlag(FarAwayLake.x, FarAwayLake.y, -2, -2);
UntilFlag;
Flag;
Wait(1000 + Random(250));
Result := True;
End;
ColorToleranceSpeed(CTS);
End;
End;
{=========================================================]
[ Walks to bank ==========================================]
[=========================================================}
// Coming, updating to DDTMs
{=========================================================]
[ Walks to bank ==========================================]
[=========================================================}
Function BankWalk2: Boolean;
Var
I, L, Randomm, X, Y, D: Integer;
Begin
If(Not(LoggedIn))Then Exit;
Begin
L := GetArrayLength(TBP);
For I := 0 To L - 1 Do
Begin
Case Random(2) Of
0: Randomm := -Random(4);
1: Randomm := Random(4);
End;
If(Random(2) = 0) And (Not(I = (L - 1))) Then
Begin
X := TBP[i + 1].x + Randomm;
Y := TBP[i + 1].y + Randomm;
If(Rs_OnMinimap(X, Y))Then
Begin
MouseFindFlag(X, Y, -1, -1);
FFlag(10);
D := 1;
End;
End;
If(Not(D = 1))Then
Begin
NewWalkToTile(TBP[i].x + Randomm, TBP[i].y + Randomm);
End;
End;
If(PointInBox(GetLocation, IntToBox(3269, 3172, 3272, 3164)))Then
Begin
Result := True;
End;
End;
End;
{=========================================================]
[ Walks to mine or bank ==================================]
[=========================================================} {
Procedure WalkTo(Mine: Boolean);
Begin
If(Not(LoggedIn))Then
Exit;
If(KYAB_Mode)Then
Begin
If(Mine)Then
Begin
MineWalk2;
If(Not(LoggedIn))Then
Begin
Exit;
End Else
Writeln('Succesfully walked to mine!');
End Else
Begin
If(BankWalk2)Then
Begin
Writeln('Succesfully walked to bank!');
End;
End;
End Else
Begin
If(Mine)Then
Begin
MineWalk1;
If(Not(LoggedIn))Then
Begin
Exit;
End Else
Writeln('Succesfully walked to mine!');
End Else
Begin
BankWalk1;
If(Not(LoggedIn))Then
Begin
Exit;
End Else
Writeln('Succesfully walked to bank!');
End;
End;
End; }
{=========================================================]
[ Drops all crap (all but coals) from inventory ==========]
[=========================================================}
Procedure CrapOff;
Var
I, C: Integer;
Var
TP: TPoint;
Begin
CountCoals;
If(NeedNew)Then
Begin
C := 1;
End Else
Begin
C := 2;
End;
For I := C To 28 Do
Begin
If(Not(InIntArray(CoalSlots, i)))Then
Begin
If(ExistsItem(i))Then
Begin
TP := ItemCoords(i);
Mouse(TP.x, TP.y, 2, 2, False);
ChooseOption('rop');
End;
End;
End;
End;
{=========================================================]
[ Deposits all coals =====================================]
[=========================================================}
Procedure DepositCoals;
Var
TP: TPoint;
Var
I: Integer;
Begin
If(Not(BankScreen))Then Exit;
I := CountCoals;
CLS := CLS + I;
Players[CurrentPlayer].Integers[2] := I;
Banked := Banked + 1;
TP := ItemCoords(CoalSlots[0]);
Mouse(TP.x, TP.y, 2, 2, False);
ClickOption('ll', 2);
End;
{=========================================================]
[ Withdraws new axe from bank ============================]
[=========================================================}
Procedure NewAxe;
Var
X, Y, Sx, Sy: Integer;
Begin
If(Not(BankScreen))Then Exit;
X := Players[CurrentPlayer].Integers[0];
Y := Players[CurrentPlayer].Integers[1];
Sx := 35 + (X * 49);
Sy := 27 + (Y * 38);
MMouse(Sx, Sy, 2, 2);
If(IsUpText('xe'))Then
Begin
Withdraw(X, Y, 1);
ReportVars[1] := ReportVars[1] + 1;
SRLRandomsReport;
End Else
Begin
Writeln('Shit! Out of spare axes!');
Logout;
Players[CurrentPlayer].Loc := 'nomoreaxes';
End;
End;
{=========================================================]
[ Does the banking part ==================================]
[=========================================================}
Procedure Banking;
Begin
If(Not(LoggedIn))Then Exit;
If(Not(OpenKharidBank))Then
Begin
If(Not(OpenBankQuiet('akbt')))Then
Begin
If(Not(OpenBankGlass('akb', True, True)))Then
Begin
If(Not(OpenBankFast('akb')))Then
Begin
Writeln('Could not find bank!');
Players[CurrentPlayer].Loc := 'lost';
Logout;
Exit;
End Else
Writeln('Found bank with OpenBankFast');
End Else
Writeln('Found bank with OpenBankGlass');
End Else
Writeln('Found bank with OpenBankQuiet');
End Else
Writeln('Found bank with (drumroll) OpenKharidBank! Woo!');
DepositCoals;
If(NeedNew)Then
Begin
NewAxe;
If(Not(Players[CurrentPlayer].Loc = 'nomoreaxes'))Then
Begin
Exit;
End Else
Begin
Logout;
Exit;
End;
End;
CloseBank;
End;
{====== Setup stuff, and function for checking if all players are false ======}
Procedure SetupPick;
Begin
If(Not(FindPickHeadColor))Then
Begin
Writeln('no pick plawkx?');
Logout;
NextPlayer(False);
End;
End;
Procedure AutoRetaliateOff;
Var
X, Y: Integer;
Begin
GameTab(1);
If(Not(FindColorTolerance(X, Y, 1777020, 609, 385, 637, 397, 20)))Then
Begin
GameTab(4);
End Else
Begin
Mouse(620, 390, 10, 10, True);
Wait(1500 + Random(250));
GameTab(4);
End;
End;
Procedure SetupCurrentPlayer;
Begin
SetupPick;
AutoRetaliateOff; // Rock golems throw crap at you nowadays.
FirstW := True;
End;
Function AllPlayersFalse: Boolean; // Couldnt find the one by fawki anywhere?
Var
I: Integer;
Begin
Result := True;
For I := 0 To GetArrayLength(Players) - 1 Do
Begin
If(Players[i].Active)Then Exit;
End;
Result := False;
End;
Procedure SetVariables;
Var
I: Integer;
Begin
For I := 0 To GetArrayLength(Players) - 1 Do
Begin
Players[i].Loc := 'Bank'; // Hopefully :D :D :D
Players[i].Integers[0] := 0;
Players[i].Integers[1] := 0;
Players[i].Integers[2] := 0;
End;
FirstW := True;
End;
Begin
SetupSRL;
ScriptID := '376'; if (SRL_ID = '') or (SRL_Pass = '')then begin ClearDebug; SRLid := '2368'; SrlPassword := 'password'; WriteLn('@@@ Hey! Don''t leech! Get an SRL Stats ID at : '); WriteLn('@@@ [url]http://www.Stats.SRL-Forums.com[/url] !!! '); WriteLn('@@@ And type it in the script'); WriteLn('@@@ Until you do that, the script will not run. '); WriteLn('@@@ Byee! '); TerminateScript; End;
If(KYAB_Mode)Then
Begin
SetupKYAB;
Paths;
End;
DeclarePlayers;
///////////////
{ Mainloop is commented because the walking is being fixed/ DDTMized
but thats somewhat how I would do it
For PlayerLooper := 0 To GetArrayLength(Players) - 1 Do
Begin
SetupCurrentPlayer;
If(Not(PowerMode))Then
Begin
Repeat
If(Not(LoggedIn))Then Break;
WalkTo(True);
If(Not(LoggedIn))Then Break;
Repeat
MineRock;
Wait(500 + Random(550));
FindNormalRandoms;
If(Not(LoggedIn))Then
Begin
Break;
End;
Until(InvFull);
If(Not(LoggedIn))Then Break;
WalkTo(False);
If(Not(LoggedIn))Then Break;
Banking;
X := X + 1;
ProgressReport;
Until(X >= Loads) Or (Not(LoggedIn));
End Else
Begin
Repeat
If(Not(LoggedIn))Then Break;
PowerMineRocks;
If(Not(LoggedIn))Then Break;
CountCoals;
For DCTR := 0 To GetArrayLength(CoalSlots) - 1 Do
Begin
Mouse(CoalSlots[dctr].x, CoalSlots[dctr].y, 3, 3, False);
ChooseOption('rop');
Wait(650 + Random(150));
End;
ProgressReport;
Until(Not(LoggedIn));
End;
If(Not(LoggedIn))Then
Begin
NextPlayer(False);
End Else
Begin
NextPlayer(True);
End;
ProgressReport;
End; }
End.
program New;
{.include SRL/SRL.scar}
Var PDTMs: Array of Integer;
Var PP: Array of TDTM;
Var PPM: Array of TDTMPointDef;
Var PPS: Array of Array of TDTMPointDef;
Procedure LoadPathDTMs;
Begin
SetArrayLength(PP, 8);
SetArrayLength(PPS, 8);
SetArrayLength(PPM, 8);
SetArrayLength(PDTMs, 8);
PPM[0].x := 307;
PPM[0].y := 147;
PPM[0].AreaSize := 0;
PPM[0].AreaShape := 0;
PPM[0].Color := 3371077;
PPM[0].Tolerance := 50;
SetArrayLength(PPS[0], 7);
PPS[0][0].x := 314;
PPS[0][0].y := 159;
PPS[0][0].AreaSize := 3;
PPS[0][0].AreaShape := 0;
PPS[0][0].Color := 7649998;
PPS[0][0].Tolerance := 50;
PPS[0][1].x := 306;
PPS[0][1].y := 157;
PPS[0][1].AreaSize := 3;
PPS[0][1].AreaShape := 0;
PPS[0][1].Color := 7649998;
PPS[0][1].Tolerance := 50;
PPS[0][2].x := 299;
PPS[0][2].y := 152;
PPS[0][2].AreaSize := 3;
PPS[0][2].AreaShape := 0;
PPS[0][2].Color := 7584462;
PPS[0][2].Tolerance := 50;
PPS[0][3].x := 297;
PPS[0][3].y := 142;
PPS[0][3].AreaSize := 3;
PPS[0][3].AreaShape := 0;
PPS[0][3].Color := 7584462;
PPS[0][3].Tolerance := 50;
PPS[0][4].x := 306;
PPS[0][4].y := 134;
PPS[0][4].AreaSize := 3;
PPS[0][4].AreaShape := 0;
PPS[0][4].Color := 7649998;
PPS[0][4].Tolerance := 50;
PPS[0][5].x := 316;
PPS[0][5].y := 137;
PPS[0][5].AreaSize := 3;
PPS[0][5].AreaShape := 0;
PPS[0][5].Color := 7649998;
PPS[0][5].Tolerance := 50;
PPS[0][6].x := 317;
PPS[0][6].y := 149;
PPS[0][6].AreaSize := 3;
PPS[0][6].AreaShape := 0;
PPS[0][6].Color := 7649998;
PPS[0][6].Tolerance := 50;
PP[0].MainPoint := PPM[0];
PP[0].SubPoints := PPS[0];
PDTMs[0] := AddDTM(PP[0]);
PPM[1].x := 643;
PPM[1].y := 48;
PPM[1].AreaSize := 1;
PPM[1].AreaShape := 0;
PPM[1].Color := 3827793;
PPM[1].Tolerance := 50;
SetArrayLength(PPS[1], 5);
PPS[1][0].x := 660;
PPS[1][0].y := 61;
PPS[1][0].AreaSize := 3;
PPS[1][0].AreaShape := 0;
PPS[1][0].Color := 3827793;
PPS[1][0].Tolerance := 50;
PPS[1][1].x := 675;
PPS[1][1].y := 61;
PPS[1][1].AreaSize := 3;
PPS[1][1].AreaShape := 0;
PPS[1][1].Color := 3827793;
PPS[1][1].Tolerance := 50;
PPS[1][2].x := 666;
PPS[1][2].y := 53;
PPS[1][2].AreaSize := 3;
PPS[1][2].AreaShape := 0;
PPS[1][2].Color := 2111865;
PPS[1][2].Tolerance := 50;
PPS[1][3].x := 676;
PPS[1][3].y := 61;
PPS[1][3].AreaSize := 3;
PPS[1][3].AreaShape := 0;
PPS[1][3].Color := 3827793;
PPS[1][3].Tolerance := 50;
PPS[1][4].x := 658;
PPS[1][4].y := 63;
PPS[1][4].AreaSize := 3;
PPS[1][4].AreaShape := 0;
PPS[1][4].Color := 3827793;
PPS[1][4].Tolerance := 50;
PP[1].MainPoint := PPM[1];
PP[1].SubPoints := PPS[1];
PDTMs[1] := AddDTM(PP[1]);
PPM[2].x := 658;
PPM[2].y := 31;
PPM[2].AreaSize := 1;
PPM[2].AreaShape := 0;
PPM[2].Color := 6195597;
PPM[2].Tolerance := 30;
SetArrayLength(PPS[2], 4);
PPS[2][0].x := 666;
PPS[2][0].y := 32;
PPS[2][0].AreaSize := 2;
PPS[2][0].AreaShape := 0;
PPS[2][0].Color := 6195597;
PPS[2][0].Tolerance := 25;
PPS[2][1].x := 666;
PPS[2][1].y := 37;
PPS[2][1].AreaSize := 2;
PPS[2][1].AreaShape := 0;
PPS[2][1].Color := 6195597;
PPS[2][1].Tolerance := 25;
PPS[2][2].x := 673;
PPS[2][2].y := 34;
PPS[2][2].AreaSize := 2;
PPS[2][2].AreaShape := 0;
PPS[2][2].Color := 6195597;
PPS[2][2].Tolerance := 25;
PPS[2][3].x := 669;
PPS[2][3].y := 37;
PPS[2][3].AreaSize := 2;
PPS[2][3].AreaShape := 0;
PPS[2][3].Color := 6195597;
PPS[2][3].Tolerance := 25;
PP[2].MainPoint := PPM[3];
PP[2].SubPoints := PPS[3];
PDTMs[2] := AddDTM(PP[3]);
PPM[3].x := 651;
PPM[3].y := 21;
PPM[3].AreaSize := 1;
PPM[3].AreaShape := 0;
PPM[3].Color := 6919835;
PPM[3].Tolerance := 30;
SetArrayLength(PPS[3], 4);
PPS[3][0].x := 661;
PPS[3][0].y := 19;
PPS[3][0].AreaSize := 1;
PPS[3][0].AreaShape := 0;
PPS[3][0].Color := 6919835;
PPS[3][0].Tolerance := 25;
PPS[3][1].x := 661;
PPS[3][1].y := 62;
PPS[3][1].AreaSize := 1;
PPS[3][1].AreaShape := 0;
PPS[3][1].Color := 12161406;
PPS[3][1].Tolerance := 25;
PPS[3][2].x := 681;
PPS[3][2].y := 51;
PPS[3][2].AreaSize := 1;
PPS[3][2].AreaShape := 0;
PPS[3][2].Color := 12161406;
PPS[3][2].Tolerance := 25;
PPS[3][3].x := 664;
PPS[3][3].y := 59;
PPS[3][3].AreaSize := 2;
PPS[3][3].AreaShape := 0;
PPS[3][3].Color := 12161406;
PPS[3][3].Tolerance := 25;
PP[3].MainPoint := PPM[3];
PP[3].SubPoints := PPS[3];
PDTMs[3] := AddDTM(PP[3]);
PPM[4].x := 658;
PPM[4].y := 30;
PPM[4].AreaSize := 1;
PPM[4].AreaShape := 0;
PPM[4].Color := 5744826;
PPM[4].Tolerance := 30;
SetArrayLength(PPS[4], 3);
PPS[4][0].x := 658;
PPS[4][0].y := 67;
PPS[4][0].AreaSize := 1;
PPS[4][0].AreaShape := 0;
PPS[4][0].Color := 4484723;
PPS[4][0].Tolerance := 30;
PPS[4][1].x := 678;
PPS[4][1].y := 40;
PPS[4][1].AreaSize := 1;
PPS[4][1].AreaShape := 0;
PPS[4][1].Color := 2384951;
PPS[4][1].Tolerance := 30;
PPS[4][2].x := 650;
PPS[4][2].y := 42;
PPS[4][2].AreaSize := 1;
PPS[4][2].AreaShape := 0;
PPS[4][2].Color := 5744826;
PPS[4][2].Tolerance := 30;
PP[4].MainPoint := PPM[4];
PP[4].SubPoints := PPS[4];
PDTMs[4] := AddDTM(PP[4]);
PPM[5].x := 634;
PPM[5].y := 19;
PPM[5].AreaSize := 1;
PPM[5].AreaShape := 0;
PPM[5].Color := 5744826;
PPM[5].Tolerance := 30;
SetArrayLength(PPS[5], 4);
PPS[5][0].x := 659;
PPS[5][0].y := 29;
PPS[5][0].AreaSize := 4;
PPS[5][0].AreaShape := 0;
PPS[5][0].Color := 2384951;
PPS[5][0].Tolerance := 25;
PPS[5][1].x := 634;
PPS[5][1].y := 49;
PPS[5][1].AreaSize := 4;
PPS[5][1].AreaShape := 0;
PPS[5][1].Color := 8490;
PPS[5][1].Tolerance := 25;
PPS[5][2].x := 647;
PPS[5][2].y := 44;
PPS[5][2].AreaSize := 3;
PPS[5][2].AreaShape := 0;
PPS[5][2].Color := 5744826;
PPS[5][2].Tolerance := 25;
PPS[5][3].x := 619;
PPS[5][3].y := 34;
PPS[5][3].AreaSize := 3;
PPS[5][3].AreaShape := 0;
PPS[5][3].Color := 5744826;
PPS[5][3].Tolerance := 25;
PP[5].MainPoint := PPM[5];
PP[5].SubPoints := PPS[5];
PDTMs[5] := AddDTM(PP[5]);
PPM[6].x := 649;
PPM[6].y := 21;
PPM[6].AreaSize := 1;
PPM[6].AreaShape := 0;
PPM[6].Color := 2249059;
PPM[6].Tolerance := 30;
SetArrayLength(PPS[6], 3);
PPS[6][0].x := 636;
PPS[6][0].y := 29;
PPS[6][0].AreaSize := 1;
PPS[6][0].AreaShape := 0;
PPS[6][0].Color := 2777461;
PPS[6][0].Tolerance := 25;
PPS[6][1].x := 658;
PPS[6][1].y := 26;
PPS[6][1].AreaSize := 1;
PPS[6][1].AreaShape := 0;
PPS[6][1].Color := 3041921;
PPS[6][1].Tolerance := 25;
PPS[6][2].x := 648;
PPS[6][2].y := 26;
PPS[6][2].AreaSize := 1;
PPS[6][2].AreaShape := 0;
PPS[6][2].Color := 2711154;
PPS[6][2].Tolerance := 25;
PP[6].MainPoint := PPM[6];
PP[6].SubPoints := PPS[6];
PDTMs[6] := AddDTM(PP[6]);
PPM[7].x := 640;
PPM[7].y := 26;
PPM[7].AreaSize := 0;
PPM[7].AreaShape := 0;
PPM[7].Color := 3224112;
PPM[7].Tolerance := 0;
SetArrayLength(PPS[7], 3);
PPS[7][0].x := 640;
PPS[7][0].y := 31;
PPS[7][0].AreaSize := 0;
PPS[7][0].AreaShape := 0;
PPS[7][0].Color := 3224112;
PPS[7][0].Tolerance := 0;
PPS[7][1].x := 638;
PPS[7][1].y := 32;
PPS[7][1].AreaSize := 0;
PPS[7][1].AreaShape := 0;
PPS[7][1].Color := 4738122;
PPS[7][1].Tolerance := 0;
PPS[7][2].x := 642;
PPS[7][2].y := 19;
PPS[7][2].AreaSize := 0;
PPS[7][2].AreaShape := 0;
PPS[7][2].Color := 4738122;
PPS[7][2].Tolerance := 0;
PP[7].MainPoint := PPM[7];
PP[7].SubPoints := PPS[7];
PDTMs[7] := AddDTM(PP[7]);
End;
{====================================================================]
[ Decreases "Y" until the point FromX/FromY with Y added is on MM ===]
[====================================================================}
Procedure UntilYOnMMFrom(Var Y: Integer; Want, FromX, FromY: Integer);
Begin
Y := Want;
Repeat
Y := Y - 1;
Until(InCircle(FromX, FromY + Y, MMCX, MMCY, 70));
End;
{====================================================================]
[ Walks similar to the system cannon rotates/moves on its stage.=====]
[====================================================================}
Procedure CannonWalk(Radial, TehRandom, Radius: Integer);
Var
X, Y: Integer;
Begin
If(Not(LoggedIn))Then Exit;
X := Round(Radius * Sine(Radial + Random(TehRandom))) + MMCX;
Y := Round(-Radius * Cose(Radial + Random(TehRandom))) + MMCY;
MouseFindFlag(X, Y, + 2, - 2);
Flag;
Wait(250 + Random(250));
End;
{====================================================================]
[ Walks the path DDTMs to mine or bank. =============================]
[====================================================================}
Function WalkDTMs: Boolean;
Var
C, X, Y, AdjX, AdjY, x1, y1, x2, y2: Integer;
Begin
If(Not(LoggedIn))Then Exit;
If(Not(DTMRotated(PDTMs[0], X, Y, MMCX, MMY1, MMX2, MMY2)))Then Exit;
AdjX := 0;
AdjY := 0;
UntilYOnMMFrom(AdjY, 40, X, Y);
MouseFlag(X, Y - AdjY, 2, 2);
CannonWalk(10, 25, 60 + Random(4));
For C := 4 To 7 Do
Begin
Result := False;
x1 := MMX1;
y1 := MMY1;
x2 := MMX2;
y2 := MMCY;
AdjX := 0;
AdjY := 0;
If(C = 2)Then
Begin
CannonWalk(0, 10, 15 + Random(8));
End;
If(C = 7)Then
Begin
MakeCompass('n');
CannonWalk(0, 5, 48 + Random(8));
End;
If(Not(DTMRotated(PDTMs[c], X, Y, x1, y1, x2, y2)))Then
Begin
Exit;
End Else
Begin
Writeln('Found DTM '+IntToStr(c));
Mouse(X, Y + 4, 1, 1, True);
Wait(1250 + Random(250));
Flag;
Result := True;
End;
End;
End;
R.I.P CoalMinerForDesert