I've added the dragon pickaxe DTMs to the script, here's a modified version. It's my nooby scripting ofc, so it now reports that pickaxe is in invy when its actually equipped. :redface:
program DuffsUltimateDwarf;//by PatDuffy
{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\stats.simba}
{=============================================================]
[ Duff's Ultimate Dwarf ]
[=============================================================]
[ REQUIREMENTS!!!: ~60 Mining
[ ~45 Dung ]
[ ~Pickaxe in inventory or equipped ]
[=============================================================]
[ Features: ~Mines Mith, Addy, and Rune With Color! ]
[ ~FULLY COLOR!!! WORKS AFTER BOT NUKE!!! ]
[ ~Multiplayer, Player Switching ]
[ ~SRL Stats, Progress Reports ]
[ ~Awesome Printed Progress Report ]
[=============================================================]
[ Set-Up Instruction: 1. Fill out SRL Stats and Players ]
[ 2. Choose a starting location ]
[ 3. Have pick in inventory or equip ]
[ 4. Hit Run and Post Proggy! ]
[=============================================================]
[ Valid Locations: Above Ground ]
[ 'ready': In bank with empty inv ]
[=============================================================}
const
World = 33;
Members = false;
Signed = true;
//just leave the stats as it is if you don't have a username for it
SRLStats_UserID = 'Anonymous';//your SRL stats name
SRLStats_Password = 'anon1337';//your SRL stats password
var
TimePlayer, MithM, AddyM, RuneM,
AntiBanUsed, GemM, Loads,
TMith,TAddy,TRune,TGems: Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //how many players to use
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] do
begin
Name :='';
Pass :='';
Nick :=''; //3-4 lowercase letter in the display name
Loc :='ready';
Active := True;
Integers[2]:=260;//time to mine before next player
Integers[3]:=1;//time between player switches
end;
{//remove the '{' if you want more players
With Players[1] do
begin
Name :='';
Pass :='';
Nick :='';
Loc :='ready';
Active := True;
Integers[2]:=45;//time to mine before next player
Integers[3]:=1;//time between player switches
end;
{ With Players[2] do
begin
Name :='';
Pass :='';
Nick :='';
Loc :='ready';
Active := True;
Integers[2]:=30;//time to mine before next player
Integers[3]:=1;//time between player switches
end;
{
With Players[3] do
begin
Name :='';
Pass :='';
Nick :='';
Loc :='';
Active := True;
Integers[2]:=30;//time to mine before next player
Integers[3]:=1;//time between player switches
end;
With Players[4] do
begin
Name :='';
Pass :='';
Nick :='';
Loc :='';
Active := True;
Integers[2]:=30;//time to mine before next player
Integers[3]:=1;//time between player switches
end;
With Players[5] do
begin
Name :='';
Pass :='';
Nick :='';
Loc :='';
Active := True;
Integers[2]:=30;//time to mine before next player
Integers[3]:=1;//time between player switches
end;
}
end;
function CheckPick:Boolean;//checks to see if theres a pick
//currently uses DTM's
var
PickDTM,PickDTM2,x,y: Integer;
begin
if not LoggedIn then
Exit;
PickDTM := DTMFromString('78DA63FCC7CCC090CEC8800A98C0244C94919' +
'185812193809ABF40738A89302783801A56A09A18026AFE00ED8AC6A' +
'F0600C7A80594');
PickDTM2 := DTMFromString('mrAAAAHic42BgYPBiZmAIBuIgIHYGYkcgtgNibyA2BeJ0RgaGGCAuAOIkIC4C4jyoWDUQ2/JwAE1hwoPxA0YCGAYAIyEGDQ==');
GameTab(tab_Inv);
Wait(1000+Random(500));
if FindDTM(PickDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Players[CurrentPlayer].Booleans[1] := True;//means axe is in inv
Writeln('Pick found in inventory');
Result:=True
FreeDTM(PickDTM);
Exit;
end else
begin
GameTab(tab_Equip);
Wait(1000+Random(200));
if FindDTM(PickDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Players[CurrentPlayer].Booleans[1] := False;
Writeln('Pick found Equipped');
Result:=True
GameTab(tab_Inv);
FreeDTM(PickDTM);
Exit;
end else
if FindDTM(PickDTM2,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Players[CurrentPlayer].Booleans[1] := True;//means axe is in inv
Writeln('Pick found in inventory');
Result:=True
FreeDTM(PickDTM2);
Exit;
end else
begin
GameTab(tab_Equip);
Wait(1000+Random(200));
if FindDTM(PickDTM2,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Players[CurrentPlayer].Booleans[1] := False;
Writeln('Pick found Equipped');
Result:=True
GameTab(tab_Inv);
FreeDTM(PickDTM2);
Exit;
end else
begin
Writeln('Could not find pick');
Result:=False
FreeDTM(PickDTM);
Exit;
end;
end;
end;
GameTab(tab_Inv);
end;
procedure CheckLevel;
begin
GameTab(tab_Stats);
Players[CurrentPlayer].Integers[1] := GetSkillInfo('Mining',False);
Writeln('Players Mining Level is: '+IntToStr(Players[CurrentPlayer].Integers[1]));
GameTab(tab_Inv);
end;
//Camero's walking function
function Walking(Color, Tolerance: Integer; SortFrom: tpoint): Boolean;
var
i, x, y, rx, ry: Integer;
TPA: TPointArray;
begin
if not LoggedIn then Exit;
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, Tolerance);
SortTPAFrom(TPA, SortFrom);
for i := 0 to High(TPA) do
begin
x := TPA[i].x;
y := TPA[i].y;
rx := RandomRange(-6, 6);
ry := RandomRange(-6, 6);
if (not rs_OnMinimap(x + rx, y + ry)) then
Continue;
Mouse(x + rx, y + ry, 0, 0, true);
FFlag(0);
Wait(200 + Random(500));
Result := True;
Break;
end;
end;
//All credit for this goes to BobboHobbo and Nava2(for making some changes)
procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour, Shadow: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
Canvas: TCanvas;
begin
SmartSetDebug(True);
GetClientDimensions(mx,my);
Pic := BitmapFromString(mx,my,'');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], SmallChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1, Shadow);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
FreeBitmap(Pic);
end;
procedure PrintProggy;//prints proggy on screen to look awesome
begin
PrintOnSmart([' Duffs Ultimate Dwarf V1_2'],Point(15, 30), 16760576, 131072);
PrintOnSmart([
'Time Running: ' + TimeRunning,
'Players active: ' + ToStr(PlayersActive) + '/' + ToStr(HowManyPlayers),
'Mined: ' + IntToStr(TMith) + ' Mith',
'Mined: ' + IntToStr(TAddy) + ' Addy',
'Mined: ' + IntToStr(TRune) + ' Rune',
'Gained: ' + IntToStr(TGems) + ' Gems',
'Loads: ' + IntToStr(Loads),
'',
''], Point(20, 60), 16776960, 131072);
end;
procedure SetUpPlayers;//sets up players and checks for pickaxe
begin
if(not(LoggedIn)) then
LoginPlayer;
Wait(2000+Random(1000));
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
SetAngle(True);
SetChat('Hide',1);
SetChat('Friends',2);
if not CheckPick then
Players[CurrentPlayer].Loc:='lost';
CheckLevel;
PrintProggy;
MarkTime(TimePlayer);
end;
function SwitchPlayers:Boolean;//Basic outline used in my SuperChopperDelux
var
BreakTime, BreakFor: Integer;
begin
if (TimeFromMark(TimePlayer) >= (Players[CurrentPlayer].Integers[2]*60000)) then
begin
Writeln('Worked for desired time, breaking');
if (PlayersActive > 0) then
begin
BreakFor:=(Players[CurrentPlayer].Integers[3] + Random(2));
Writeln('Breaking for : ' + MsToTime((BreakFor*60000), Time_Formal));
Wait(6000+Random(5000));
Players[CurrentPlayer].Active := True;
Logout;
MarkTime(BreakTime);
repeat
Wait(30000);
Writeln('Break Ends In : '+MsToTime((BreakFor*60000)-TimeFromMark(BreakTime), Time_Formal));
until(TimeFromMark(BreakTime) > BreakFor*60000)
Writeln('Break Complete!');
NextPlayer(True);
SetUpPlayers;
Result := True;
Exit;
end;
Exit;
end;
Result := False;
Exit;
end;
procedure Walk;
begin
if not LoggedIn or SwitchPlayers then
Exit;
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
SetAngle(True);
if RunEnergy(30) then
SetRun(True);
if Players[CurrentPlayer].Loc ='ready' then
begin
if (Walking(1787389,23,Point(651, 149))) then
begin
Wait(5000+Random(2000));
Writeln('Walked to mine');
Players[CurrentPlayer].Loc :='at ladder';
Exit;
end else
Writeln('Failed to walk to mine');
end else
if Players[CurrentPlayer].Loc ='invfull guild' then
begin
if (Walking(12306372,23,Point(597, 21))) then
begin
Wait(5000+Random(2000));
Writeln('Walked to bank');
Players[CurrentPlayer].Loc :='banking';
Exit;
end else
Writeln('Failed to walk to bank');
end;
end;
procedure CountOre;//counts ores mined before banking
var
MithDTM, AddyDTM,RuneDTM: Integer;
begin
MithDTM := DTMFromString('78DA632C66666050656440069696A10CD2401' +
'A24FA1F44E703D588A0AA61606002933051C624A01A75026A72806A0' +
'C09A8A905AAD1C0AF06005A1D04EE');
AddyDTM := DTMFromString('78DA639CCFCCC0A0CAC8800CEC3DED19A4813' +
'448F43F889E06542381AA868181094CC244197B806AB408A8990D546' +
'34040CD0AA01A25026A1602D588E35703009EFD0685');
RuneDTM := DTMFromString('78DA639CC2CCC050C8C8800CDCC36219B8803' +
'448F43F889E0D549386AA86818109AE060418DB816A3208A8E901AAA' +
'925A0662E504D097E35005DEA0761');
MithM := CountItems('dtm',MithDTM,[]);
AddyM := CountItems('dtm',AddyDTM,[]);
RuneM := CountItems('dtm',RuneDTM,[]);
FreeDTM(MithDTM);
FreeDTM(AddyDTM);
FreeDTM(RuneDTM);
end;
procedure StatsCommit;
begin
IncEx(Players[CurrentPlayer].Integers[5],MithM);
IncEx(Players[CurrentPlayer].Integers[6],AddyM);
IncEx(Players[CurrentPlayer].Integers[7],RuneM);
IncEx(Players[CurrentPlayer].Integers[8],GemM);
IncEx(TMith,MithM);
IncEx(TAddy,AddyM);
IncEx(TRune,RuneM);
IncEx(TGems,GemM);
stats_IncVariable('Mithril Ore (Mined)',MithM);
stats_IncVariable('Adamant Ore (Mined)',AddyM);
stats_IncVariable('Runite Ore (Mined)',RuneM);
stats_IncVariable('Gems (Mined)',GemM);
Stats_Commit;
PrintProggy;
end;
procedure ProgressReport;
var
i:Integer;
begin
ClearDebug;
Writeln('[==================================================================]');
Writeln('[ Duffs Ultimate Dwarf by PatDuffy ]');
Writeln('[==================================================================]');
Writeln('[ Total Time Run: ' + Padr(TimeRunning,41) + ']');
Writeln('[==================================================================]');
if (TMith > 0) then//only writes if mith was mined
Writeln('[ Total Number of Mith Mined: ' + Padr(IntToStr(MithM),37) + ']');
if (TAddy > 0) then//only writes if mith was mined
Writeln('[ Total Number of Addy Mined: ' + Padr(IntToStr(AddyM),37) + ']');
if (TRune > 0) then//only writes if mith was mined
Writeln('[ Total Number of Rune Mined: ' + Padr(IntToStr(RuneM),37) + ']');
if (TGems > 0) then//writes if gems were mined
Writeln('[ Total Number of Gems Mined: ' + Padr(IntToStr(GemM),37) + ']');
Writeln('[ Total Number of Loads: ' + Padr(IntToStr(Loads),42)+ ']');
Writeln('[==================================================================]');
for i:=0 to High(Players) do
begin
Writeln('[ Player: ' + Padr(IntToStr(i),2) + ': ' + Padr(Players[i].Nick,53) + ']');
Writeln('[ Loads: ' + Padr(IntToStr(Players[i].Integers[4]),58) + ']');
Writeln('[ Mith Mined: ' + Padr(IntToStr(Players[i].Integers[5]),53) + ']');
if (Players[i].Integers[6] > 0) then
Writeln('[ Addy Mined: ' + Padr(IntToStr(Players[i].Integers[6]),53) + ']');
if (Players[i].Integers[7] > 0) then
Writeln('[ Rune Mined: ' + Padr(IntToStr(Players[i].Integers[7]),53) + ']');
Writeln('[ Gems Mined: ' + Padr(IntToStr(Players[i].Integers[8]),53) + ']');
Writeln('[ BanHammer Evaded: ' + IntToStr(Players[i].Integers[9]) + Padr(' Times',45) + ']');
Writeln('[ Player Active: ' + Padr(BoolToStr(Players[i].Active),50) + ']');
Writeln('[==================================================================]')
end;
end;
function CountGems:Integer;//checks to see if gems were mined, and counts them
var
GemDTM: Integer;
begin
GemDTM := DTMFromString('78DA633CC6CCC020C5C8800A98C0244C94711' +
'7508D2A0135A7816AF409A8390F54A34440CD1EA01A6DFC6A00F12E0' +
'4BA');
Result := CountItems('dtm',GemDTM,[]);
FreeDTM(GemDTM);
end;
{=========================================]
[ My custom anti-ban procedure that I use ]
[ in all my scripts, with a few edits ]
[ to mesh better with the script ]
[=========================================}
procedure AntiBan;
begin
if (not(LoggedIn)) then
Exit;
Writeln('Performing Anti-BanHammer procedures');
case Random(35) of
0..2: PickUpMouse;
3..5: ExamineInv;
6..8: begin
HoverSkill('woodcutting',false);
Wait(1500+Random(5000));
GameTab(Tab_Inv);
end;
9..11: BoredHuman;
12..14: begin
GameTab(RandomRange(tab_Combat, tab_Notes));
Wait(1800+Random(3000));
GameTab(Tab_Inv);
end;
15..17: RandomRClick;
18..20: RandomAngle(true);
21..23: RandomMovement;
24..26: begin
HoverSkill('fishing',false);
Wait(1000+Random(2500));
GameTab(Tab_Inv);
end;
27..29: PickUpMouse;
30..33: begin
HoverSkill('strength',false);
Wait(1000+Random(4000));
GameTab(Tab_Inv);
end;
34: begin
case Random(6) of//I like a lot to increase variety
0: TypeSend('My hand hurts');
1: TypeSend('only a billion left to mine =p');
2: TypeSend('Awfully botty here today');//I love this one
3: TypeSend('sooo booooreeeddd');
4: TypeSend('...zzz...');
5: begin
TypeSend('lol =p');
Wait(1000+Random(1000));
TypeSend('Oops, meant to be in cc');
end;
end;
end;
end;
SetAngle(True);
Inc(AntiBanUsed);
Inc(Players[CurrentPlayer].Integers[9]);
end;
Procedure CheckVer;
var
Page,NewVer,Version: String;
PostID: Integer;
begin
PostID :=840369;
Version :='1.2';
Page := GetPage('http://villavu.com/forum/showthread.php?p='+IntToStr(PostID)+'');
NewVer := Between('Current version: ', ' Working', Page);
if Version <> NewVer then
ShowMessage('Your script is out of date!')
else
Exit;
end;
function FindLadder: Boolean;//finds the ladder going down
var
LadColors: TIntegerArray;
x,y,i,a,m,curCTS,Fails,xi,yi: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
if not LoggedIn or IsMoving then
Exit;
curCTS := GetColorToleranceSpeed;
LadColors:=[855309,2631722];
for i := 0 to 1 do
begin
if (IsMoving) then Exit;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,LadColors[i],MSX1,MSY1,MSX2,MSY2,6 +(i*2));
if Length(TPA) = 0 then Continue;
ColorToleranceSpeed(1);
ATPA:= TPAtoATPAEx(TPA,6,6);
m := High(ATPA);
for a:=0 to m do
begin
if MiddleTPAEx(ATPA[a],x,y) then
begin
MMouse(x,y,6,6);
if (WaitUpText('limb',100+Random(150))) then
begin
Wait(1000+Random(500));
GetMousePos(x,y);
Mouse(x,y,2,2,True);
if DidRedClick then
begin
Fails:=0;
Result:=True;
Wait(2000+Random(1000));
Exit;
end;
end else
begin
Inc(Fails);
end;
end;
end;
if (Fails >=7) then
Result:=False;
Exit;
end;
end;
function FindMLadder: Boolean;//finds the ladder going up
var
LadColors: TIntegerArray;
x,y,i,a,m,curCTS,Fails: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
if not LoggedIn or IsMoving then
Exit;
curCTS := GetColorToleranceSpeed;
LadColors:=[4673619,4541776];
for i := 0 to 1 do
begin
if (IsMoving) then Exit;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,LadColors[i],MSX1,MSY1,MSX2,MSY2,6 +(i*2));
if Length(TPA) = 0 then Continue;
ColorToleranceSpeed(1);
ATPA:= TPAtoATPAEx(TPA,6,6);
m := High(ATPA);
for a:=0 to m do
begin
if MiddleTPAEx(ATPA[a],x,y) then
begin
MMouse(x,y,6,6);
if (WaitUpText('limb',100+Random(150))) then
begin
Wait(1000+Random(500));
GetMousePos(x,y);
Mouse(x,y,2,2,True);
if DidRedClick then
Fails:=0;
Result:=True;
Wait(2000+Random(2000));
Exit;
end else
begin
Inc(Fails);
end;
end;
end;
if (Fails>=5) then
Result:=False
end;
end;
function FindDDoor: Boolean;//finds the resource dungeon door
var
DoorColors: TIntegerArray;
x,y,i,a,m,curCTS,Fails: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
if not LoggedIn or IsMoving then
Exit;
curCTS := GetColorToleranceSpeed;
DoorColors:=[1978295, 1779654];
for i := 0 to 1 do
begin
if (IsMoving) then Exit;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,DoorColors[i],MSX1,MSY1,MSX2,MSY2,6 +(i*2));
if Length(TPA) = 0 then Continue;
ColorToleranceSpeed(1);
ATPA:= TPAtoATPAEx(TPA,6,6);
m := High(ATPA);
for a:=0 to m do
begin
if MiddleTPAEx(ATPA[a],x,y) then
begin
MMouse(x,y,6,6);
if (WaitUpText('yster',100+Random(150))) then
begin
Wait(1000+Random(500));
GetMousePos(x,y);
Mouse(x,y,2,2,True);
Fails:=0;
Result:=True;
Wait(1000+Random(2000));
Exit;
end else
begin
Inc(Fails);
end;
end;
end;
if (Fails>=5) then
Result:=False
end;
end;
procedure ClimbLadder;//climbs down the ladder at the guild
var
T,Fails:Integer;
begin
if not LoggedIn or SwitchPlayers then
Exit;
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
PrintProggy;
if IsMoving then
Wait(2000+Random(1000));
if not IsMoving then
begin
if FindLadder then
begin
Wait(1500+Random(2000));
MarkTime(T);
if (PercentBlackMM > 60) then
begin
Writeln('Climbed down the ladder');
Players[CurrentPlayer].Loc :='in mine';
Exit;
end else
Exit;
end else
Inc(Fails);
If (Fails > 6) then
begin
Writeln('Player did not climb down ladder');
Players[CurrentPlayer].Loc:='lost';
end;
end;
end;
procedure OpenDDoor;//opens the door to get into the mine
var
x,y: Integer;
begin
if not LoggedIn or SwitchPlayers then
Exit;
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
if FindDDoor then
begin
Wait(1500+Random(2000));
//added a bit of color walking here
if (Walking(5856091,23,Point(659, 134)))then
Mouse(x,y,1,1,True);
MakeCompass('E');
Players[CurrentPlayer].Loc :='at ore';
end else
begin
Writeln('Player did not enter the resource mine');
Players[CurrentPlayer].Loc:='lost';
end;
end;
procedure ExitDDoor;//opens the door to get out of the mine
var
x,y: Integer;
begin
if not LoggedIn or SwitchPlayers then
Exit;
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
x := MMCX;
y := MMCY;
if (Walking(263663,23,Point(607, 76)))then
begin
MakeCompass('N');
SetAngle(True);
if FindDDoor then
begin
Wait(1500+Random(2000));
Players[CurrentPlayer].Loc :='invfull ladder';
Exit;
end;
end else
Writeln('Player did not exit the mine');
Players[CurrentPlayer].Loc:='lost';
end;
procedure ClimbMLadder;//Climbs out of the guild
begin
if not LoggedIn or SwitchPlayers then
Exit;
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
PrintProggy;
if FindMLadder then
begin
Wait(1500+Random(2000));
MakeCompass('N');
Players[CurrentPlayer].Loc :='invfull guild';
end else
begin
Writeln('Player did not climb up ladder');
Players[CurrentPlayer].Loc:='lost';
end;
end;
function MineMith: Boolean;//finds and mines mith with TPA's and ATPA's
var
MithColors: TIntegerArray;
X,Y,I,A,M,curCTS,Fails: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
if not LoggedIn or IsMoving then
Exit;
curCTS := GetColorToleranceSpeed;
MithColors:=[9860211, 9840211];
for I := 0 to 1 do
begin
if (IsMoving) then Exit; //prevents script from attempting to mine even if the player is moving to a rock to mine
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,MithColors[I],MSX1,MSY1,MSX2,MSY2,6 +(i*2));
if Length(TPA) = 0 then Continue;
ColorToleranceSpeed(1);
ATPA:= TPAtoATPAEx(TPA,6,6);
M := High(ATPA);
for A:=0 to M do
begin
if MiddleTPAEx(ATPA[A],X,Y) then
begin
MMouse(X,Y,6,6);
if (WaitUpText('ine',100+Random(150))) then
begin
GetMousePos(X,Y);
Mouse(X,Y,0,0,True);
if DidRedClick then
begin
Result:=True;
ColorToleranceSpeed(curCTS);
Fails:=0;
Exit;
end;
end else
begin
Inc(Fails);
end;
end;
end;
end;
if (Fails > 6) then
Result:=False;
Exit;
end;
function MineAddy: Boolean;//finds and mines addy with TPA's and ATPA's
var
AddyColors: TIntegerArray;
X,Y,I,A,M,curCTS,Fails: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
if not LoggedIn or IsMoving then
Exit;
curCTS := GetColorToleranceSpeed;
AddyColors:=[8295038,60565540];
for I := 0 to 1 do
begin
if (IsMoving) then Exit; //prevents script from attempting to mine even if the player is moving to a rock to mine
SetAngle(False);
MakeCompass('W');
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,AddyColors[I],MSX1,MSY1,MSX2,MSY2,6 +(i*2));
if Length(TPA) = 0 then Continue;
ColorToleranceSpeed(1);
ATPA:= TPAtoATPAEx(TPA,6,6);
M := High(ATPA);
for A:=0 to M do
begin
if MiddleTPAEx(ATPA[A],X,Y) then
begin
MMouse(X,Y,6,6);
if (WaitUpText('ine',100+Random(150))) then
begin
GetMousePos(X,Y);
Mouse(X,Y,0,0,True);
if DidRedClick then
begin
Result:=True;
ColorToleranceSpeed(curCTS);
Fails:=0;
Exit;
end;
end else
begin
Inc(Fails);
end;
end;
end;
end;
if (Fails > 6) then
Result:=False;
Exit;
end;
function MineRune: Boolean;//finds and mines rune with TPA's and ATPA's
var
RuneColors: TIntegerArray;
X,Y,I,A,M,curCTS,Fails: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
if not LoggedIn or IsMoving then
Exit;
curCTS := GetColorToleranceSpeed;
RuneColors:=[15787424,10393977];
for I := 0 to 1 do
begin
if (IsMoving) then Exit; //prevents script from attempting to mine even if the player is moving to a rock to mine
SetAngle(False);
MakeCompass('W');
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,RuneColors[I],MSX1,MSY1,MSX2,MSY2,6 +(i*2));
if Length(TPA) = 0 then Continue;
ColorToleranceSpeed(1);
ATPA:= TPAtoATPAEx(TPA,6,6);
M := High(ATPA);
for A:=0 to M do
begin
if MiddleTPAEx(ATPA[A],X,Y) then
begin
MMouse(X,Y,6,6);
if (WaitUpText('ine',100+Random(150))) then
begin
GetMousePos(X,Y);
Mouse(X,Y,0,0,True);
if DidRedClick then
begin
Result:=True;
ColorToleranceSpeed(curCTS);
Fails:=0;
Exit;
end;
end else
begin
Inc(Fails);
end;
end;
end;
end;
if (Fails > 6) then
begin
Players[CurrentPlayer].Loc :='lost';
Exit;
end;
end;
function RockIsMined:Boolean;//detects if nearest rock(most likely being mined) is gone
var
x,y,a,m,curCTS: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:=False;
if not LoggedIn then
Exit;
curCTS:=GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,9860211,MSX1,MSY1,MSX2,MSY2,28);
if Length(TPA) > 0 then
begin
ColorToleranceSpeed(1);
ATPA:=TPAtoATPAEx(TPA,5,5);
M :=High(ATPA);
SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY));//sorts from middle of screen
for a := 0 to m do
begin
if MiddleTPAEx(ATPA[a],x,y) then
begin
if (Distance(x,y,MSCX,MSCY) > 50) then//if the closest ore is 50 px away from center
begin
Result:=True;
Exit;
end else
Exit;
Break;
end;
end;
end;
ColorToleranceSpeed(curCTS);
end;
{================================================]
[ The Basic Concept of this procedure is from ]
[ my clay softener, with some edits to ]
[ incorporate new techniques and ideas I learned ]
[ since I created the base ]
[================================================}
procedure MineOre;//mines mith only atm, will add addy, possibly rune too
var
MineTime,C,RockTime,PlusOne:Integer;
begin
if not LoggedIn or SwitchPlayers then
Exit;
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
PrintProggy;
MarkTime(MineTime);
if InvFull then
begin
Writeln('Player has full inv, time to bank');
Players[CurrentPlayer].Loc :='invfull mine';
Exit;
end;
repeat
C := InvCount
if SwitchPlayers then
Exit;
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
if RunEnergy(30) then
SetRun(True);
PlusOne:=InvCount+1;
case Players[CurrentPlayer].Integers[1] of
60..69:begin
if MineMith then
begin
MarkTime(RockTime);
Wait(2000+Random(500));
if IsMoving then
Wait(1500+Random(500));
repeat
Wait(500);
if Random(70)=1 then AntiBan;
Wait(500);
until (InvCount = PlusOne) or (TimeFromMark(RockTime) > 60000);
if RockIsMined then
Break;
Wait(1500+Random(1000));
end;
end;
70..84:begin
if MineAddy then
begin
MarkTime(RockTime);
Wait(2000+Random(1000));
if IsMoving then
Wait(1500+Random(500));
repeat
Wait(500);
if Random(70)=1 then AntiBan;
Wait(500);
until (InvCount = PlusOne) or (TimeFromMark(RockTime) > 60000);
if RockIsMined then
begin
Break;
end else
Wait(1500+Random(1000));
end else
if MineMith then
begin
MarkTime(RockTime);
Wait(2000+Random(1000));
if IsMoving then
Wait(1500+Random(500));
repeat
Wait(500);
if Random(70)=1 then AntiBan;
Wait(500);
until (InvCount = PlusOne) or (TimeFromMark(RockTime) > 60000);
if RockIsMined then
Break;
end else
Wait(1500+Random(1000));
end;
85..99:begin
if MineRune then
begin
MarkTime(RockTime);
Wait(2000+Random(1000));
if IsMoving then
Wait(1500+Random(500));
repeat
Wait(500);
if Random(70)=1 then AntiBan;
Wait(500);
until (InvCount = PlusOne) or (TimeFromMark(RockTime) > 60000);
if RockIsMined then
Break;
Wait(1500+Random(1000));
end else
if MineAddy then
begin
MarkTime(RockTime);
Wait(2000+Random(1000));
if IsMoving then
Wait(1500+Random(500));
repeat
Wait(500);
if Random(70)=1 then AntiBan;
Wait(500);
until (InvCount = PlusOne) or (TimeFromMark(RockTime) > 60000);
if RockIsMined then
begin
Break;
end else
Wait(1500+Random(1000));
end else
if MineMith then
begin
MarkTime(RockTime);
Wait(2000+Random(1000));
if IsMoving then
Wait(1500+Random(500));
repeat
Wait(500);
if Random(70)=1 then AntiBan;
Wait(500);
until (InvCount = PlusOne) or (TimeFromMark(RockTime) > 60000);
if RockIsMined then
Break;
end else
Wait(1500+Random(1000));
end;
end;
if (InvCount > C) then
Writeln('Mined Some Ore');
until InvFull or (TimeFromMark(MineTime) > (20*60*1000));
end;
procedure BankOre;//banks at fally east
var
Failures: Integer;
begin
if not LoggedIn or SwitchPlayers then
Exit;
CountOre;
GemM:=CountGems;
PrintProggy;
CheckLevel;
if OpenBankFast('feb') then
begin
Deposit(2,28,true);
CloseBank;
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[4]);
Failures := 0;
stats_IncVariable('Loads Done',1);
StatsCommit;
Players[CurrentPlayer].Loc :='ready';
end else
if OpenBankQuiet('feb') then
begin
Deposit(2,28,true);
CloseBank;
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[4]);
Failures := 0;
stats_IncVariable('Loads Done',1);
StatsCommit;
Players[CurrentPlayer].Loc :='ready';
end else
begin
Writeln('Both banking methods failed');
Inc(Failures);
Wait(200+Random(3000));
Exit;
end;
if (Failures >= 3) then
begin
Writeln('Checking Location, Too many failures');
Players[CurrentPlayer].Loc:='lost';
end;
ProgressReport;
end;
procedure MainLoop;
begin
if not LoggedIn then
SetUpPlayers;
repeat
case Players[CurrentPlayer].Loc of
'ready':Walk;
'at ladder':ClimbLadder;
'in mine':OpenDDoor;
'invfull mine':ExitDDoor;
'at ore':MineOre;
'invfull ladder':ClimbMLadder;
'invfull guild':Walk;
'banking':BankOre;
'lost':begin
Writeln('Player is lost, switching to next player');
NextPlayer(False);
SetUpPlayers;
end;
end;
until AllPlayersInactive;
end;
begin
ClearDebug;
CheckVer;
SetupSRLStats(197,SRLStats_UserID, SRLStats_Password);
Smart_Signed := Signed;
Smart_Server := World
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
SetUpPlayers;
PrintProggy;
AddOnTerminate('ProgressReport');
repeat
MainLoop;
until AllPlayersInactive;
end.