PatDuffy
2011-03-31 15:43:09
How Long have You Played Runescape?
7 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
N/A
What is your general programming knowledge?
~Very, very little flash
~A decent amount of Pascal(all of which I learned here)
~Other than that none, but I learn quickly
Are you a member of any other communities?
I have an account at Sythe, Powerbot, and RSBuddy.
Tell us about yourself…
Please show us one (or multiple) of your scripts.
7 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
N/A
What is your general programming knowledge?
~Very, very little flash
~A decent amount of Pascal(all of which I learned here)
~Other than that none, but I learn quickly
Are you a member of any other communities?
I have an account at Sythe, Powerbot, and RSBuddy.
Tell us about yourself…
From: PatDuffy
I am a 16 year old highschool junior, with above average intelligence. Throughout my life I have been obsessed with various games(Mario, Pokemon, Runescape, and now Xbox in general) and this sparked my interest in learning how games operate. From this interest, my ambition to learn to program started. In a way, this is odd for the type of person I am, my life goal is to become a Marine Biologist, and I spend almost every weekend playing some type of sport.
I stumbled upon SRL by accident when I was researching SCAR after my interest in RuneScape was re-kindled by a friend. The community seemed pleasant, so I began to learn how to write scripts to benefit others(I enjoy helping others). A few months later here I am, asking to become an official member, using the knowledge I have learned from others.
Please show us one (or multiple) of your scripts.
program DuffsGuildMiner;//by PatDuffy
{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i Reflection\Reflection.simba}
{$i SRL\SRL\Misc\stats.simba}
{=============================================================]
[ Duff's Guild Miner ]
[=============================================================]
[ REQUIREMENTS!!!: ~60 Mining ]
[ ~Pickaxe in inventory or equipped ]
[=============================================================]
[ Features: ~Mines Coal With Color ]
[ ~Multiplayer, Player Switching ]
[ ~SRL Stats, Progress Reports ]
[ ~Doesn't follow the Bot Swarm! ]
[ ~Avoids the Bot Swarm!!! ]
[ ~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 ]
[ 'at ladder':at ladders above guild ]
[ 'invfull guild':at ladders with full inv ]
[ 'banking': at bank with full inv ]
[ In Mine ]
[ 'in mine':at ladders in mine, empty inv ]
[ 'at ore': anywhere in guild with ore ]
[ 'invfull mine':inv full anywhere in guild]
[ 'at mladder':at ladders with full inv ]
[=============================================================]
[ Other: This is my SRL Members Application Script so ]
[ I really tried to go all-out in trying to show ]
[ what I have learned from the community in my few ]
[ months at SRL. Currently the script only mines ]
[ coal, but I plan on expanding the script to mine ]
[ everything else in the mine. Thank you for trying ]
[ my Script! =D ]
[=============================================================}
const
World = 0;
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, MLadCol,CoalM, TExp,
AntiBanUsed, Loads, GemM: Integer;
CoalCol, GLadCol: TIntegerArray;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //how many players to use
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] 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;
{//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,x,y: Integer;
begin
if not LoggedIn then
Exit;
PickDTM := DTMFromString('78DA63CC65666098CDC8800A98C0244C94310' +
'3A866210135E94035CB09A8C906AA594C400DC83D7D04D45400D54C2' +
'1A0261EA866227E35001698075D');
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
FreeDTM(PickDTM);
Exit;
end else
begin
Writeln('Could not find pick');
Result:=False
FreeDTM(PickDTM);
Exit;
end;
end;
GameTab(tab_Inv);
end;
procedure SetUpPlayers;//sets up players and checks for pickaxe
begin
if(not(LoggedIn)) then
LoginPlayer;
Wait(2000+Random(1000));
SetAngle(True);
R_FindRandoms;
if not CheckPick then
Players[CurrentPlayer].Loc:='end';
MarkTime(TimePlayer);
end;
procedure FindLocation;//finds location if lost
var
x,y: Integer;
begin
if not LoggedIn then
Exit;
if (FindSymbol(x,y,'bank')) then
begin
Players[CurrentPlayer].Loc :='ready';
Writeln('Found player at Bank!');
Exit;
end else
if (DistanceFrom(Tile(3021,3340)) < 8) then
begin
Players[CurrentPlayer].Loc :='at ladder';
Writeln('Found Player at Enterance to Guild!');
Exit;
end else
if (DistanceFrom(Tile(3021,9739)) < 8) then
begin
Players[CurrentPlayer].Loc :='in mine';
Writeln('Found player in the mine');
Exit;
end else
if (DistanceFrom(Tile(3041,9740)) < 25) then
begin
Players[CurrentPlayer].Loc :='at ore';
Writeln('Found player in the middle of rocks');
Exit;
end else
begin
Writeln('Player could not be found');
Players[CurrentPlayer].Loc :='lost';
Exit;
end;
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;
FindLocation;
Result := True;
Exit;
end;
Exit;
end;
Result := False;
Exit;
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
TExp:=(CoalM*50);
PrintOnSmart([' Duffs Guild Miner'],Point(15, 30), 16760576, 131072);
PrintOnSmart([
'Time Running: ' + TimeRunning,
'Players active: ' + ToStr(PlayersActive) + '/' + ToStr(HowManyPlayers),
'Mined: ' + IntToStr(CoalM) + ' Coal',
'Gained: ' + IntToStr(GemM) + ' Gems',
'Gained: ' + IntToStr(TExp) + ' Mining Experience',
'Loads: ' + IntToStr(Loads),
'',
''], Point(20, 60), 16776960, 131072);
end;
function CountOre:Integer;//counts coal mined before banking
var
CoalDTM: Integer;
begin
CoalDTM := DTMFromString('78DA63EC676660F0626440054C601226CA388' +
'D083593806AC209A86906AAF127A0663A508D3D01350B806A3C09A86' +
'903AA71C3AF0600754E0638');
Result := CountItems('dtm',CoalDTM,[]);
FreeDTM(CoalDTM);
end;
function CountGems:Integer;//checks to see if gems were mined, and counts them
var
GemDTM: Integer;
begin
GemDTM := DTMFromString('78DA639CC0CCC0D0CDC8800A98C0244C94713' +
'A504D2F0135B3816AA61350D30754339F809A76A09AC9F8D50000677' +
'605E1');
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[5]);
end;
function IsMining:Boolean;//very basic...checks to see if character is mining
begin
if not LoggedIn or CharacterMoving then
Exit;
if CharacterAnimating then
Wait(200+Random(200));
if CharacterAnimating then
begin
Result:=True;
end else
Result:=False;
end;
procedure ProgressReport;//fully operational, sometimes is mislined at Ban-Hammer evaded
var
i:Integer;
begin
ClearDebug;
Writeln('[==================================================================]');
Writeln('[ Guild Miner by PatDuffy ]');
Writeln('[==================================================================]');
Writeln('[ Total Time Run: ' + Padr(TimeRunning,41) + ']');
Writeln('[==================================================================]');
if (CoalM > 0) then//only writes if coal was mined
Writeln('[ Total Number of Coal Mined: ' + Padr(IntToStr(CoalM),37) + ']');
if (GemM > 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('[ Total Number of Experience Gained: ' + Padr(IntToStr(TExp),30) + ']');
Writeln('[ BanHammer Evaded : ' + IntToStr(AntiBanUsed) + Padr(' Times',43) + ']');
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('[ Coal Mined: ' + Padr(IntToStr(Players[i].Integers[1]),53) + ']');
Writeln('[ Gems Mined: ' + Padr(IntToStr(Players[i].Integers[6]),53) + ']');
Writeln('[ BanHammer Evaded: ' + IntToStr(Players[i].Integers[5]) + Padr(' Times',44) + ']');
Writeln('[ Player Active: ' + Padr(BoolToStr(Players[i].Active),50) + ']');
Writeln('[==================================================================]')
end;
Stats_Commit;
PrintProggy;
end;
procedure BankOre;//banks at fally east
var
Failures,VarExp: Integer;
begin
if not LoggedIn or SwitchPlayers then
Exit;
PrintProggy;
R_FindRandoms;
VarExp:=(CountOre*50);
IncEx(CoalM,CountOre);
IncEx(Players[CurrentPlayer].Integers[1],CountOre);
IncEx(GemM,CountGems);
IncEx(Players[CurrentPlayer].Integers[6],CountGems);
stats_IncVariable('Coal Ore (Mined)',CountOre);
stats_IncVariable('Total EXP Gained',VarExp);
stats_IncVariable('Gems (Mined)',CountGems);
if OpenBankFast('feb') then
begin
Deposit(2,28,true);
CloseBank;
Failures := 0;
stats_IncVariable('Times Banked',1);
Players[CurrentPlayer].Loc :='ready';
end else
if OpenBankQuiet('feb') then
begin
Deposit(2,28,true);
CloseBank;
Failures := 0;
stats_IncVariable('Times Banked',1);
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');
FindLocation;
Exit;
end;
Inc(Loads);
Inc(Players[CurrentPlayer].Integers[4]);
ProgressReport;
end;
procedure Walk;//handles ALL walking
var
WalkTime,i:Integer;
GPath,MPath:TPointArray;
begin
if not LoggedIn or SwitchPlayers then
Exit;
PrintProggy;
R_FindRandoms;
MarkTime(WalkTime);
SetAngle(True);
if RunEnergy(30) then
SetRun(True);
case Players[CurrentPlayer].Loc of
'ready','invfull guild':
begin
GPath:=[Point(3012,3356), Point(3024,3353),Point(3021,3340)];
Writeln('Walking');
if (Players[CurrentPlayer].Loc='invfull guild') then
InvertTPA(GPath);
WalkPath(GPath);
if (Players[CurrentPlayer].Loc='ready') then
Players[CurrentPlayer].Loc:='at ladder';
if (Players[CurrentPlayer].Loc='invfull guild') then
Players[CurrentPlayer].Loc:='banking';
end;
'invfull mine','in mine':
begin
MPath:=[Point(3021,9739), Point(3034,9738),Point(3041,9740)];
Writeln('Walking');
if (Players[CurrentPlayer].Loc='invfull mine') then
InvertTPA(MPath);
WalkPath(MPath);
if (Players[CurrentPlayer].Loc='in mine') then
Players[CurrentPlayer].Loc:='at ore';
if (Players[CurrentPlayer].Loc='invfull mine') then
Players[CurrentPlayer].Loc:='at mladder';
end;
end;
if (TimeFromMark(WalkTime) > 60000 + Random(30000)) then
begin
Writeln('Failed to walk, checking location');
FindLocation;
Exit;
end;
Exit;
end;
function FindLadder: Boolean;//finds the ladder going down
var
LadColors: TIntegerArray;
x,y,i,a,m,curCTS,Fails: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
R_FindRandoms;
if not LoggedIn or CharacterMoving then
Exit;
curCTS := GetColorToleranceSpeed;
LadColors:=[4548733,3491935];
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);
if (DistanceFrom(Tile(3021,9739)) < 8 ) then
Exit;
Mouse(x,y,2,2,True);
Result:=True;
Wait(1000+Random(1000));
Exit;
end else
begin
Inc(Fails);
end;
end;
end;
if (Fails >=7) then
Result:=False
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;
R_FindRandoms;
if not LoggedIn or CharacterMoving then
Exit;
curCTS := GetColorToleranceSpeed;
LadColors:=[4278347,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);
if (DistanceFrom(Tile(3021,3340)) < 8 ) then
Exit;
Mouse(x,y,2,2,True);
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
begin
if not LoggedIn or SwitchPlayers then
Exit;
PrintProggy;
if FindLadder then
begin
Wait(3500+Random(2000));
if (DistanceFrom(Tile(3021,9739)) < 8 ) then
begin
Writeln('Player is in mine');
Players[CurrentPlayer].Loc :='in mine';
Exit;
end;
end else
begin
Writeln('Player did not climb down ladder');
FindLocation;
end;
end;
procedure ClimbMLadder;//Climbs out of the guild
begin
if not LoggedIn or SwitchPlayers then
Exit;
PrintProggy;
if FindMLadder then
begin
Wait(3500+Random(2000));
if (DistanceFrom(Tile(3021,3340)) < 8 ) then
begin
Writeln('Player is out of mine');
Players[CurrentPlayer].Loc :='invfull guild';
Exit;
end;
end else
begin
Writeln('Player did not climb up ladder');
FindLocation;
end;
end;
function MineCoal: Boolean;//finds and mines coal with TPA's and ATPA's
var
ColColors: TIntegerArray;
X,Y,I,A,M,curCTS,Fails: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
R_FindRandoms;
if not LoggedIn or CharacterMoving then
Exit;
curCTS := GetColorToleranceSpeed;
ColColors:=[2503218,2239532];
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,ColColors[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);
case Random(100) of //I like to add a 50/50 chance of right or left click for anti-ban
0..49: begin
Mouse(X,Y,0,0,True);
if DidRedClick then
Result:=True;
ColorToleranceSpeed(curCTS);
Fails:=0;
Exit;
end;
50..100: begin
Mouse(X,Y,0,0,False);
ChooseOption('ine');
Result:=True;
ColorToleranceSpeed(curCTS);
Fails:=0;
Exit;
end;
end;
end else
begin
Inc(Fails);
end;
end;
end;
end;
if (Fails > 6) then
begin
WalkToTile(Tile(3041,9740),2,2);
Writeln('Moving player away from the bot swarm');
Players[CurrentPlayer].Loc:='at ore';
Exit;
end;
end;
function RockIsMined:Boolean;//detects if nearest rock(most likely being mined) is gone
var
x,y,a,i,ii,m,curCTS: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:=False;
R_FindRandoms;
if not LoggedIn then
Exit;
curCTS:=GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,2634548,MSX1,MSY1,MSX2,MSY2,11);
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 coal only atm, will add mith, possibly addy too
var
x,y,MineTime,C,Fails:Integer;
begin
if not LoggedIn or SwitchPlayers then
Exit;
PrintProggy;
R_FindRandoms;
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 RunEnergy(30) then
SetRun(True);
if (DistanceFrom(Tile(3047,9754)) < 6) then
begin
WalkToTile(Tile(3041,9740),2,1);
Writeln('Saved from player becoming stuck');
end;
if (DistanceFrom(Tile(3052,9745)) < 4) then
if not IsMining then
begin
Wait(1000+Random(200));
if not IsMining or not CharacterMoving then
WalkToTile(Tile(3041,9740),2,1);
end;
if MineCoal then
begin
if CharacterMoving then
Wait(1500+Random(500));
if RockIsMined then
begin
Break;
end else
if IsMining then
begin
Writeln('Mining Coal');
case Random(100) of
0..89: Wait(2000+Random(3000));
90..100:AntiBan;
end;
end;
end;
if (InvCount > C) then
Writeln('Mined Some Coal');
until InvFull or (TimeFromMark(MineTime) > (20*60*1000));
end;
procedure MainLoop;
begin
if not LoggedIn then
SetUpPlayers;
repeat
if SwitchPlayers then
Exit;
case Players[CurrentPlayer].Loc of
'ready':Walk;
'at ladder':ClimbLadder;
'in mine':Walk;
'at ore':MineOre;
'invfull mine':Walk;
'at mladder':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;
SetupSRLStats(74,SRLStats_UserID, SRLStats_Password);
Smart_Signed := Signed;
Smart_Server := World
Smart_SuperDetail := False;
SetupSRL;
SetupReflection;
DeclarePlayers;
SetUpPlayers;
PrintProggy;
AddOnTerminate('ProgressReport');
repeat
MainLoop;
until false or AllPlayersInactive;
end.