The Mayor
2013-03-06 20:44:28
How Long have You Played Runescape?
10 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
N/A
What is your general programming knowledge?
I know a bit of pascal. I wouldn't say I'm an expert.
I used to write programs on my graphics calculator in maths class back in high school. My greatest achievement was making snake, and a 'guess the number' game
Are you a member of any other communities?
The first RS related community I joined was SRL. I joined PB in 2010. I'm pretty sure I joined Sythe in 2009 but I forgot the username and password.
Tell us about yourself…
Please show us one (or multiple) of your scripts.
10 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
N/A
What is your general programming knowledge?
I know a bit of pascal. I wouldn't say I'm an expert.
I used to write programs on my graphics calculator in maths class back in high school. My greatest achievement was making snake, and a 'guess the number' game
Are you a member of any other communities?
The first RS related community I joined was SRL. I joined PB in 2010. I'm pretty sure I joined Sythe in 2009 but I forgot the username and password.
Tell us about yourself…
From: The Mayor
Well, I started playing RuneScape back in 2003 (I'm 22 now) and have played on and off since then. I joined SRL in 2007 (it was actually ’06 but I forgot the username) but never got around to applying for membership for one reason or another. I was either too busy with school/university and didn't want to devote the time towards learning a new programming language. When I did have some free time, I had lost interest in RuneScape.
I finished school in 2008 and ended up getting a scholarship to university based on my academic performance. At the end of 2011 I finished my undergraduate degree and managed to secure another scholarship, so decided to continue with my studies. I began a PGDipHSc (Postgraduate Diploma in Health Science) which I completed last year. At the start of this year I secured another scholarship (awarded based on GPA) and I’m currently finishing off my MHSc (Masters of Health Science) before starting my PhD near the end of this year. I’m also doing some research and teaching work at university around my study.
I think it is easy to see that I like learning new things and expanding my knowledge. I found myself starting to enjoy RuneScape again when I logged in to check on my account in January. I was still on holiday so I could actually devote some of my time towards learning Pascal. I have put together a script which I have been working on over the past few weeks. I decided to make a planker because I could incorporate all of the elements that are necessary for a good membership application (as outlined by Daniel here http://villavu.com/forum/showthread.php?t=74195&highlight=membership). I also thought that a money making script would get a bit of interest from others, which I guess is one of the reasons why you write a script in the first place!.
I have been testing this script extensively over the last week (all you guys on Skype are probably get sick of me posting my latest progress reports!) and it can run for a very long time, especially with the break handler I implemented. If any of you members don’t have an account and would like to test it, I have a trial account with 20K logs at VEB (sorry it can only make 300 at a time). I think I will refrain from posting it in the public scripts section for now, considering there is a big influx of PB leechers who will use this to gold farm (or sell it on PB or Sythe for 1.2b).
After making this I can say that it is a great feeling to see your script in action, especially with debug turned on so you can see what it is ‘thinking’. I now know what you guys mean when you say you will end up enjoying scripting more that the game itself. I’m not pretending to be an expert scripter. This is my first proper script I have ever written and I admit there are probably many things wrong with it. If you choose to vote ‘No’ please say why, and tell me how to improve. Even if you vote ‘Yes’ feedback would be appreciated. Thank you to everyone who helped me make this, I wouldn't have come this far without your willingness to share your expertise.
Cheers
The Mayor
Please show us one (or multiple) of your scripts.
{I tried attaching my Simba script using the 'Manage Attachments' button below, but it says I do not have permission to access this page (bug?). Pasted it here instead.}
program TheMayorsPlankBanker;
{$define SMART8}
{$i srl/srl.simba}
{$i sps/sps.simba}
{$i srl/srl/misc/online.simba}
{$i SRL/SRL/misc/debug.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
{------------------------------------------------------------------------------)
(------------------------------------------------------------------------------)
( .---.. . . .--. . . )
( | | |\ /| | | )| | )
( | |--. .-. | \/ | .-. . . .-. .--..--. |--' | .-. .--. |.-. )
( | | |(.-' | |( ) | |( )| `--. | |( ) | | |-.' )
( ' ' `-`--' ' ' `-'`-`--| `-' ' `--' ' `-`-'`-' `-' `- )
( ; )
( `-' )
( )
( .--. . )
( | ) | )
( |--: .-. .--. |.-. .-. .--. )
( | )( ) | | |-.'(.-' | )
( '--' `-'`-' `-' `-`--'' )
( )
( v. 1.00 )
( )
( Written for SRL Membership Application )
( Completed 7th March 2013 )
(------------------------------------------------------------------------------)
(------------------------------------------------------------------------------}
{8+DNNDNNN8N$O78OD$
$~I8N78N8DD8NDO8O88OZ+
N=7N?OO7$MDNZ$ND8888NMDND8~
M?D8Z8$$$$MMO8$DMN88N88NDND8$~
=O$$OZNN88NMM8$ZMN8N8MDMM$DM88$7~$
O=7OZ8D8NDNDNMNZOZMMMDOMN8D8MZOZ7D$7
8I$$$IIO8NMDDD8NDNDMMMNODDNDDOZ88D8N?
~=OOO$Z$ZI7?8DD8Z8NONNMONDDNND8DNNDDMO7Z
$78OODII?I$77IOZZ8DDD8NNDD8878NNNDON8II
7ZZO77?++?===?+=+77887ZODDND8DNDDDDNNO$7
$OI77???+++~~++=~????77IOZZZ7$88NNMNNN7,
ZO7Z7II?++==~+?+=??????7$Z$77Z?O8DNNND7?
OD77II?+?=+==++++I+?++7$$$$777IIZDDO88Z
O8Z$I?I++====+???=+++?77$$$$$7+?Z8OOZ7O
788$I????=++++??7I+~?7I$$$ZZ$I???Z7O$D8
,88$???+??I+???+II??7+7$$7$$$?7I+:$ZZOZ
~D8++?OZZ8DNNNMI$~~778NNNDD87~+?I$Z$88$:
.8Z++?$$7I7Z8OOO=:ZDNNNNNDNND7~~+$D8Z$~+
ZD~Z=+$?NMINM88$?:,$NNNNNMNNOOO+~~788O8?
?+=O+?+????+ZOZ+::=7MNZ+78ZDMN8$=:?8DD8.
O+?O?+==++II?I=:~~I=MMN$8DDOIIZI+:?NNZDD
??O?++?=~=?+:~~==7I=8M7$ZOZ$$7I=:$Z8:MI
++??I++?=~~,==~=?$7=~NMI7I777?~~=~MNON
7++???+?===:====+$7,7DNO$7$Z$?=~=IMN~.
+=+I???+++=~IMDO8OD7DNN$$$777??=NZ$O
IZ?+++++=+=+~=+8ZZIONNNO$ZZ7I+?+8=
:?+++++++?++=DIOZZIIZNNZ$7+==M$
,=:::+$:????++?+++=I77$I777$+8$II+=
=$~,::...7I??+++7$NNDDNNNNZ8Z7?$??+++::.
I7$::....~I??=?7II7$OZZ$878ND$?+?I?+:,,ZZZ .,.
,:+II7:....Z.7I?IIII$$$OZO88Z$O87?IIII..$$$ZOOZ$7+.
::~+7+II....M..N7I??++??I8NND87$8$III+?.Z$$$ZOZ77$7+~,
~,,I$II77...M..:$7???+++II7$7++I77I7+.+?$777$$I??$ZI:7~:
::=Z$III$,..MN,,~M7????7$7ZZO??77+II, ?Z$$II7+==IOOZ:,I~Z: .
~~=$$Z7??$..ZMM+,.8M$$ZZOO8NOZ7?==O,..:O$I$$++Z=$ZZZ7.:IZZ7~
~~~$$7$7?I$.,MMMM=..MNNDDDNND7I+N~....78Z$$7.OZOOOOZO,.?~OZZ
::~~ZIOZ?I$..=DNMNM.:DN8ZDNDZ$NI,,,...8OZ7?,.OOOOOOZO,.=,OOZ
:,,=?7O8ZI$7.,,MNNNNM,:I=ID8$$+~::,,..777~:.OOOOOZZZZ~::,OZZ
~:::=$OO8ZZO.:.,N.NDMM ZNDODMM::::,,..77?:, OOZZZZZZO7.~=ZZ$
=~::~:,88DOO.,,,,M,.DNMNDMMMMMM$,,,,..+?+?ZOOZZ$$OOZ$$ZZZOO3C
==::+I,$888O$,::,,DII=DMNOMM8OOO7,,..~=?[ The Mayor ]Z}
{------------------------------------------------------------------------------)
Special thanks to:
The SRL community for their tutorials
Everyone on skype who put up with all my questions
My imaginary girlfriend who provided me with the
motivation and determination to see this through.
(------------------------------------------------------------------------------}
{------------------------------------------------------------------------------)
Instructions
(------------------------------------------------------------------------------)
1. Make sure you have logs in your bank in the last column of the 2nd row down.
2. Make sure you have sufficient money in your pouch.
3. Ideally wear light weight clothing (e.g., Boots of lightness, Wicked robes
and cape or spotted/spottier cape).
4. Start at VEB, or anywhere between VEB and the Sawmill (with either Logs
or Planks in your inventory.
5. Fill out the User Setup and Declare Players below.
Note: You make have to run it again after it downloads the SPS map. }
const
{------------------------------------------------------------------------------)
User Setup
(------------------------------------------------------------------------------}
DEBUG = True; // Debugging mode. Will show the status during
// each phase of the script
TYPE_OF_PLANK = 'Oak'; // Type of plank you wish to make.
// Options: 'Normal', 'Oak', 'Teak', or 'Mahogany'.
// Note: Currently only Oak is fully supported.
LOADS_TO_DO = 100; // How many loads of planks do you want to make?
CUT_LOGS_YOURSELF = False; // Did you cut the logs yourself? (alters profit calculation)
DOWNLOAD_SPS_MAP = True; // Downloads the SPS map if you don't already have it.
RESTING = True; // Do you want to rest when low on energy?
{------------------------------------------------------------------------------)
Object DTM declaration - Don't touch this
(------------------------------------------------------------------------------}
ObjBankDTM = '80:82:8:7:7:81:101:7:7:102:88:7:7:102:80:7:7:102:71:7:7:60:88:7:7:60:80:7:7:59:72:0:7:88:73:5:67:90:96:90:95:77:68:77:68:78';
ObjSawMillDTM = '86:27:6:2:7:78:35:1:7:104:50:1:7:91:67:1:7:70:47:1:7:57:21:10:7:84:21:8:96:24:96:48:68:49:68:25:68:24:69:24:71:24:69:25';
ObjAboveSawMillDTM = '71:82:6:1:7:56:104:1:7:45:81:1:7:48:92:1:7:63:49:1:7:103:49:1:7:71:80';
{------------------------------------------------------------------------------)
Global variable declaration - Don't touch this
(------------------------------------------------------------------------------}
var
OakPlank, OakLogs: Integer;
ProfitPerPlank, LoadsDone, PlanksMade, LogsLeft: Integer;
BreakTime, Energy: Integer;
PathToBank, PathToMill: TPointArray;
{------------------------------------------------------------------------------)
Declare your player(s)
(------------------------------------------------------------------------------}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] do
begin
Name := 'Zezima'; // Whoops! I forgot to remove my username.
Pass := 'ZezimaIsCool';
Pin := '';
Nick := '';
Active := True;
//WorldInfo := [44]; //If You Want A Home World
Member := True;
Booleans[0] := True; // Do you want to take breaks
Integers[0] := 50; // Minimum play time before taking a break (minutes)
Integers[1] := 150; // Maximum play time before taking a break (minutes)
Integers[2] := 5; // Minimum time to break for (minutes)
Integers[3] := 35; // Maximum time to break for (minutes)
end;
end;
{------------------------------------------------------------------------------)
END OF SETUP
(------------------------------------------------------------------------------}
{------------------------------------------------------------------------------)
Procedure: Debugging
Description: If Debugging is enabled, prints current status to debug box.
(------------------------------------------------------------------------------}
Procedure DebugBox(ToWrite: String);
begin
if DEBUG = true then
begin
Writeln(ToWrite);
end;
end;
{------------------------------------------------------------------------------)
Procedure: ResetBreakTimer
By: Credit to Inception for his Tutorial
Description: Resets the break timer (after each break).
(------------------------------------------------------------------------------}
Procedure ResetBreakTimer;
begin
BreakTime := GetSystemTime + RandomRange(Players[CurrentPlayer].Integers[0] * 60000,
Players[CurrentPlayer].Integers[1] * 60000);
end;
{------------------------------------------------------------------------------)
Procedure: TimeUntilBreak
By: The Mayor
Description: Prints the remaining time until break to the debug box.
(------------------------------------------------------------------------------}
Procedure TimeUntilBreak;
var
h, m, s, BreakFromNow: Integer;
begin
BreakFromNow := BreakTime - GetSystemTime
ConvertTime(BreakFromNow, H, M, S);
Writeln('We are taking a break in ' + IntToStr(H)+ 'h ' + IntToStr(M)+ 'm ' + IntToStr(S)+ 's ');
end;
{------------------------------------------------------------------------------)
Procedure: TakeBreak
By: Credit to Inception for his Tutorial
Description: Logs out your character for a random amount of time.
(------------------------------------------------------------------------------}
Procedure TakeBreak;
var
H, M, S, T, BreakFor: Integer;
begin
if (GetSystemTime >= BreakTime) and Players[CurrentPlayer].Booleans[0] then
begin
Logout;
BreakFor := RandomRange(Players[CurrentPlayer].Integers[2] * 60000, Players[CurrentPlayer].Integers[3] * 60000);
ConvertTime(BreakFor, H, M, S);
Writeln('We are breaking for: ' + IntToStr(H)+ 'h ' + IntToStr(M)+ 'm ' + IntToStr(S)+ 's ');
MarkTime(T);
Repeat
Wait(1000);
until (BreakFor < TimeFromMark(T))
LogInPlayer;
ResetBreakTimer;
Wait(4000);
FindNormalRandoms;
ExitSquealOfFortune();
end;
end;
{------------------------------------------------------------------------------)
Procedure: LoadDtms
Description: Loads DTMs for use in the main loop.
(------------------------------------------------------------------------------}
Procedure LoadDtms;
begin
OakPlank := DTMFromString('mAAEAAHic42FgYOACYm4gZgdiVgYE4ICKCwIxHxCLADE/EPNA5dmh8iBxSSgWgurjBWImqLqsUGsojzhsxEAaYCQRIwMAk2gCXg==');
OakLogs := DTMFromString('mPwEAAHic42dgYOAHYhEglgRiKSCWAWI5KC0KlecAYkYGCGAGYjaoOA9UDCTHDsRcQMwLxMJQM8WAWALKBqnlhOpnAuIMPz0oi3RsxEA+YKQAowEAnlAC8A==');
end;
{------------------------------------------------------------------------------)
Procedure: FreeTheDtms
Description: Frees the the DTMs. Used when the script terminates.
(------------------------------------------------------------------------------}
Procedure FreeTheDtms;
begin
FreeDtm(OakPlank);
FreeDtm(OakLogs);
end;
{------------------------------------------------------------------------------)
Procedure: LoadSPSPath
Description: Loads SPS paths for use in the main loop.
(------------------------------------------------------------------------------}
Procedure LoadSPSPath;
begin
PathToBank := [Point(267, 73), Point(267, 84), Point(263, 94), Point(260, 106),
Point(254, 116), Point(241, 134), Point(234, 144), Point(228, 158),
Point(218, 172), Point(207, 186), Point(198, 207), Point(193, 226),
Point(187, 242), Point(184, 265), Point(176, 304), Point(172, 314),
Point(158, 314), Point(128, 314), Point(110, 314), Point(89, 317),
Point(88, 327), Point(86, 335)];
PathToMill := [Point(85, 346), Point(85, 338), Point(86, 328), Point(86, 316),
Point(97, 315), Point(112, 315), Point(125, 316), Point(139, 316),
Point(151, 314), Point(165, 314), Point(178, 313), Point(183, 304),
Point(191, 290), Point(198, 273), Point(204, 259), Point(211, 239),
Point(217, 224), Point(221, 200), Point(228, 183), Point(235, 172),
Point(246, 143), Point(252, 133), Point(261, 121), Point(271, 110),
Point(270, 101), Point(267, 100), Point(273, 100)];
end;
{------------------------------------------------------------------------------)
Procedure: ProfitCalculation
By: The Mayor
Description: Retrieves prices from GE and calculates profit per plank.
(------------------------------------------------------------------------------}
Procedure ProfitCalculation;
var
PlankCost, LogPrice, PlankPrice: Integer;
begin
case Lowercase(TYPE_OF_PLANK) of
'normal': PlankCost := 100;
'oak': PlankCost := 250;
'teak': PlankCost := 500;
'mahogany': PlankCost := 1500;
end;
case Lowercase(TYPE_OF_PLANK) of
'normal': LogPrice := GETGEprice(1511);
'oak': LogPrice := GetGEPrice(1521);
'teak': LogPrice := GETGEprice(6333);
'mahogany': LogPrice := GETGEprice(6332);
end;
case Lowercase(TYPE_OF_PLANK) of
'normal': PlankPrice := GETGEprice(960);
'oak': PlankPrice := GETGEprice(8778);
'teak': PlankPrice := GETGEprice(8780);
'mahogany': PlankPrice := GETGEprice(8782);
end;
If CUT_LOGS_YOURSELF = true then
ProfitPerPlank :=(PlankPrice - PlankCost);
If CUT_LOGS_YOURSELF = false then
ProfitPerPlank :=(PlankPrice - (LogPrice + PlankCost));
Writeln((TYPE_OF_PLANK) + ' logs currently cost: ' + IntToStr(LogPrice));
Writeln((TYPE_OF_PLANK) +' Planks currently cost: ' + IntToStr(PlankPrice));
Writeln('Current profit per ' + (TYPE_OF_PLANK) + ' plank: ' + IntToStr(ProfitPerPlank));
end;
{------------------------------------------------------------------------------)
Function: OakPlankInv
By: The Mayor (Thanks to Sjoekeloe for the idea)
Description: Determines if inventory contains Oak planks so the script knows
how to proceed.
(------------------------------------------------------------------------------}
Function OakPlankInv: Boolean;
var
x, y: Integer;
begin
if not GameTab(Tab_inv) then
begin
GameTab(Tab_inv);
end;
if FindDtm(OakPlank, x, y, 685, 428, 728, 463) and findDtm(OakPlank, x, y, 552, 200, 600, 250) then
result := True;
If result = true then
DebugBox('We have Oak Planks in our inventory')
else
end;
{------------------------------------------------------------------------------)
Function: OakLogInv
By: The Mayor (Thanks to Sjoekeloe for the idea)
Description: Determines if inventory contains Oak logs so the script knows
how to proceed.
(------------------------------------------------------------------------------}
Function OakLogInv: Boolean;
var
x, y: Integer;
begin
If not GameTab(Tab_inv) then
begin
GameTab(Tab_inv);
end;
if FindDtm(OakLogs, x, y, 685, 428, 728, 463) and findDtm(OakLogs, x, y, 552, 200, 600, 250) then
result := True;
If result = true then
DebugBox('We have Oak Logs in our inventory')
else
end;
{------------------------------------------------------------------------------)
Function: Failsafe
By: The Mayor (Thanks to Sjoekeloe for the idea)
Description: Terminates the script if any problems are encountered.
(------------------------------------------------------------------------------}
Function Failsafe(Reason: String): Boolean;
begin
LogOut;
Wait(100);
Writeln(Reason);
TerminateScript;
Result := True;
end;
{------------------------------------------------------------------------------)
Procedure(s)SuperWindMouse & HumanMMouse
By: Bandland100 & modified by Ashaman88
Description: Supposedly makes mouse movements human-like.
(------------------------------------------------------------------------------}
Procedure SuperWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,step: Extended;
lastX,lastY,MSP,W: Integer;
sqrt2,sqrt3,sqrt5: Extended;
begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
while hypot(xs - xe, ys - ye) > 1 do
begin
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
if dist >= targetArea then
begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
end else
begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
if (maxStep < 3) then
begin
maxStep:= random(3) + 3.0;
end else
begin
maxStep:= maxStep / sqrt5;
end;
end;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
if hypot(veloX, veloY) > maxStep then
begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
end;
lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;
case Random(50) of
1..25: W := (MSP + (Random((MSP/4))));
26..50: W := (MSP - (RandomRange((MSP/2), MSP-1)));
end;
if (W < 1) then
W := 1;
if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
MoveMouse(Round(xs), Round(ys));
step:= hypot(xs - lastX, ys - lastY);
//W := round((maxWait - minWait) * (step / maxStep) + minWait);
wait(W);
lastdist:= dist;
end;
if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
MoveMouse(Round(xe), Round(ye));
MouseSpeed := MSP;
end;
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: Extended;
X,Y,X2,Y2,j,Dist,MP: Integer;
begin
j := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(j*MP), eX+(j*MP));
Y2 := RandomRange(eY-(j*MP), eY+(j*MP));
SuperWindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := j;
end;
{------------------------------------------------------------------------------)
Procedure: FastClick
By: All credits to Flight
Description: Clicks the mouse "Faster than a speeding bullet!"
(------------------------------------------------------------------------------}
Procedure FastClick(button: variant);
var
x, y, ibutton: Integer;
begin
if VariantIsBoolean(button) then
begin
if (button) then
iButton := mouse_left
else
iButton := mouse_right;
end else
iButton := button;
if (iButton = mouse_move) then Exit;
GetMousePos(x, y);
HoldMouse(x, y, iButton);
Wait(RandomRange(60, 150));
GetMousePos(x, y);
ReleaseMouse(x, y, iButton);
end;
{------------------------------------------------------------------------------)
Procedure: Antiban
By: The Mayor
Description: Antiban called at various stages throughout the script.
(------------------------------------------------------------------------------}
Procedure Antiban;
begin
case Random(50) of
1: PickUpMouse;
2: RandomRClick;
3: SleepAndMoveMouse(1750 + Random(250));
4: ExamineInv;
5: SmallRandomMouse;
6: HoverSkill('construction', False);
7: MMouseOffClient('Random');
8: HoverOnlineFriend;
9: HumanMMouse(Random(MSX2), Random(MSY2), 0, 0);
10: CompassMovement(10, 40, true);
11: HoverMovingObject;
12: BoredHuman;
13: RandomTab(True);
14: HoverOnlineFriend;
end;
MakeCompass('N');
end;
{------------------------------------------------------------------------------)
Function: NeedToRest
By: The Mayor
Description: Basic function to determine if the player is low on energy.
(------------------------------------------------------------------------------}
Function NeedToRest: Boolean;
var
ColorSign: String;
begin
if not RESTING then
exit;
Energy := GetMMLevels('run', ColorSign);
if (Energy) <= 35 then
result := true
end;
{------------------------------------------------------------------------------)
Function: TPAFinderBank
By: Credits to Caotoms. Modified slightly by myself.
Description:
(------------------------------------------------------------------------------}
function TPAFinderBank(Hue, Sat: Extended; Colour, Tolerance, ClickType: Integer; UpText, Options: Array of String): Boolean;
var
CTS, I, x, y: Integer;
Text: String;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue,Sat);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colour, MSX1, MSY1, MSX2, MSY2, Tolerance);
ColorToleranceSpeed(CTS);
if (Length(TPA) < 1) then
Exit;
ATPA := TPAToATPAEx(TPA, 15, 15);
SortATPASize(ATPA, True);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
HumanMMouse(x, y, 5, 5);
Wait(RandomRange(400,500));
if WaitUpTextMulti(UpText, 450) then
begin
Text := GetUpText;
if StrToInt(Between('/ ', ' more', Text)) <= 15 then
begin
ClickMouse2(ClickType);
if WaitOptionMulti(Options, 950) then
begin
Result := True;
Exit;
end else
HumanMMouse(10, 50, 20, 20);
end;
end;
end;
end;
{------------------------------------------------------------------------------)
Function: FindBanker
By: All credit to Wizzup? and Markus. I just made a few changes to suit.
Description: Finds the NPC dots in VEB. This is used as a failsafe.
(------------------------------------------------------------------------------}
Function FindBankers(Var Bank: TPoint; Var Angle: Extended): Boolean;
var
I: Integer;
B, gB: TPointArray;
aTPA: T2DPointArray;
begin
Result := False;
B := GetMiniMapDots('npc');
aTPA := SplitTPA(B, 10);
SortATPASize(aTPA, True);
if Length(aTPA) = 0 then
Exit;
B := aTPA[0];
for I := 0 To High(B) - 1 do
begin
if (Abs(B[I].Y - B[I + 1].Y) < 15) and (Abs(B[I].X - B[I + 1].X) < 60) then
begin
SetLength(gB, Length(gB) + 1);
gB[High(gB)] := B[I];
if High(gB) > 3 then
begin
Bank := MiddleTPA(gB);
Bank.Y := Bank.Y - 5;
Angle := Degrees(ArcTan2(gB[0].y - gB[High(gB)].y, gB[0].x - gB[High(gB)].x)) + 90;
If Angle < 0 then
Angle := 90 - (Angle * -1) + 270;
Result := True;
Exit;
end;
end
else
SetLength(gB, 0);
end;
end;
{------------------------------------------------------------------------------)
Procedure: Rest
By: The Mayor
Description: Rests when low on energy.
(------------------------------------------------------------------------------}
Procedure Rest;
begin
if NeedToRest = true then
begin
if (Random(2) = 1) then
begin
DebugBox('Energy less than 35%, we need to rest')
If not IsResting then
begin
Mouse(715, 95, 10, 10, mouse_right);
if (WaitOption('Rest', 300)) then;
DebugBox('We are currently resting')
repeat
wait(1000)
until (RestUntil(RandomRange(95, 4)));
end;
end;
end;
end;
{------------------------------------------------------------------------------)
Function: LostAboveSawMill
By: The Mayor
Description: On the rare occasion the SPS path walks too far, this function
walks back to Sawmill. I tried multiple SPS paths, modified tollerance and accuracy,
but it still walks up to the wilderness, albiet very, very rare.
(------------------------------------------------------------------------------}
Function LostAboveSawMill: Boolean;
var
cx, cy: Integer;
begin
If ObjDTM_Find(ObjAboveSawMillDTM, cx, cy, True) then
result := true;
If result = true then
begin
DebugBox('Found ObjAboveSawMillDTM - walking back')
ObjDTM_WalkPath(['47:104:3:1:7:33:88:1:7:45:113:1:7:62:88',
'82:131:4:1:7:83:110:1:7:79:93:1:7:54:84:1:7:71:80',
'94:144:6:1:7:104:130:1:7:74:139:1:7:104:119:1:7:84:63:1:7:79:117:0:7:58:119',
'126:101:4:2:7:117:86:1:7:97:71:1:7:83:96:0:7:51:59'], 5, 100, 5, false, true)
DebugBox('Successfully recovered from SPS glitch')
end;
end;
{------------------------------------------------------------------------------)
Function: WalkToPlanker
By: The Mayor
Description: Using a custom SPS map, ObjDTMs, and Symbol finding, walks to
the Sawmill from VEB.
(------------------------------------------------------------------------------}
Function WalkToPlanker: Boolean;
var
x, y, cx, cy, i, WalkPlankTimer: Integer;
begin
If NeedToRest = True
then
Rest;
DebugBox('We are currently walking to the Sawmill (using SPS)')
SPS_WalkPath(PathToMill)
begin
MarkTime(WalkPlankTimer);
repeat
i := i + 1
LostAboveSawMill;
if ObjDTM_Find(ObjSawMillDTM, cx, cy, True) then
begin
DebugBox('We found Planker Object DTM, walking there now');
ObjDTM_Walk(ObjSawMillDTM, 5, 100, 5, True)
DebugBox('Walked to planker using ObjDTM');
result := true;
end else
DebugBox('Failed to find Sawmill Object DTM, finding symbol');
if result = false then
if(FindSymbol(x, y, 'saw mill')) then
begin
DebugBox('Found Sawmill symbol, walking there now')
HumanMMouse(x, y, 2, 3);
wait(50);
Fastclick(true);
result := true;
end;
if result = false then
begin
DebugBox('Failed to find Sawmill Symbol, trying SPS again');
SPS_WalkPath(PathToMill);
end;
until (result = true) or (i >= 6);
If (TimeFromMark(WalkPlankTimer) > 120000) or (i >= 6) then
Failsafe('We failed to walk to the Sawmill within 2 minutes or 5 attempts');
end;
end;
{------------------------------------------------------------------------------)
Function: TPAFinderPlanker
By: Credits to Caotoms. Modified slightly by myself.
Description:
(------------------------------------------------------------------------------}
function TPAFinderPlanker(Hue, Sat: Extended; Colour, Tolerance, ClickType: Integer; UpText, Options: Array of String): Boolean;
var
CTS, I, x, y: Integer;
Text: String;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue,Sat);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colour, MSX1, MSY1, MSX2, MSY2, Tolerance);
ColorToleranceSpeed(CTS);
if (Length(TPA) < 1) then
Exit;
ATPA := TPAToATPAEx(TPA, 15, 15);
SortATPASize(ATPA, True);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
HumanMMouse(x, y, 5, 5);
Wait(RandomRange(400,500));
if WaitUpTextMulti(UpText, 450) then
begin
Text := GetUpText;
if StrToInt(Between('/ ', ' more', Text)) <= 15 then
begin
ClickMouse2(ClickType);
if WaitOptionMulti(Options, 950) then
begin
Result := True;
Exit;
end else
HumanMMouse(10, 50, 20, 20);
end;
end;
end;
end;
{------------------------------------------------------------------------------)
Function: PlankInterface
By: The Mayor
Description: Determines if the plank interface is open
(------------------------------------------------------------------------------}
Function PlankInterface: Boolean;
var
x, y: integer;
begin
if (FindColorTolerance(x, y, 16764672, MSX1, MSY1, MSX2, MSY2, 15)) and
(FindColorTolerance(x, y, 2070783, MSX1, MSY1, MSX2, MSY2, 15)) then
result := true;
if result = true then
DebugBox('We found the plank interface')
end;
{------------------------------------------------------------------------------)
Function: FindPlanker
By: The Mayor
Description: Using a combination of TPA and ACA, returns true if planker is found.
(------------------------------------------------------------------------------}
Function FindPlanker: Boolean;
var
tmpCTS, i, l, r, PlankerAttempts: Integer;
PlankerTPA: TPointArray;
begin
wait(RandomRange(1250, 250));
repeat
inc(PlankerAttempts)
wait(RandomRange(800, 200));
DebugBox('Searching for the Planker using TPAFinderPlanker');
if TPAFinderPlanker(0.16, 1.15, 13675725, 22, 0, ['awmil', 'oper'], ['uy-', 'plank', 'k S']) then
DebugBox('We found the Planker with TPAFinderPlanker');
result := true;
If result = false then
begin
DebugBox('TPAFinderPlanker failed - Searching with PlankerTPA');
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.16, 1.15);
FindColorsTolerance(PlankerTPA, 13675725, MSX1, MSY1, MSX2, MSY2, 22);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(PlankerTPA)
for i := 0 to L do
begin
r := Random(L);
wait(RandomRange(60, 200));
HumanMMouse(PlankerTPA[r].x, PlankerTPA[r].y, 2, 2);
if WaitUpTextMulti(['awmil', 'oper', 'ill o', 'tor'], 300) then
begin
DebugBox('We found the Planker with PlankerTPA');
wait(50)
FastClick(False);
Wait(RandomRange(150, 50));
WaitOptionMulti(['uy-', 'plank', 'k S'], 400);
result := true
end;
end;
end;
until (result = true) or (PlankerAttempts > 10);
if PlankerAttempts > 10 then
Failsafe('We failed to find the Planker in 10 attempts');
end;
{------------------------------------------------------------------------------)
Procedure: WalkToBank
By: The Mayor
Description: Using a custom SPS map combined with ObjDTMs and Symbol finding,
walks to VEB from the Sawmill.
(------------------------------------------------------------------------------}
Function WalkToBank: Boolean;
var
x, y, cx, cy, WalkBankTimer: Integer;
SymbolAccuracy: Extended;
begin
If NeedToRest = True
then
Rest;
DebugBox('We are currently walking to the Bank (using SPS)');
MarkTime(WalkBankTimer);
If SPS_WalkPath(PathToBank) then
begin
repeat
wait(RandomRange(1000, 250));
if ObjDTM_Find(ObjBankDTM, cx, cy, True) then
begin
DebugBox('We found Bank Object DTM, walking there now');
ObjDTM_Walk(ObjBankDTM, 5, 100, 5, True)
result := true
exit;
end;
If result = false then
begin
SymbolAccuracy := 0.5;
DebugBox('Failed to find Bank Object DTM, finding symbol');
If(FindSymbol(x, y, 'bank')) then
begin
DebugBox('Found Bank symbol, walking there now');
HumanMMouse(x, y, 2, 3);
wait(50);
Fastclick(true);
result := true;
end;
SymbolAccuracy := 0.8;
exit;
end;
If result = false then
begin
DebugBox('Failed to find Bank symbol');
SPS_WalkPath(PathToBank);
end;
until (TimeFromMark(WalkBankTimer) > 60000) or (result = true);
end;
If TimeFromMark(WalkBankTimer) > 60000 then
Failsafe('Uh oh, we failed to walk to the Bank');
end;
{------------------------------------------------------------------------------)
Function: FindBanker
By: The Mayor
Description: Using a combination of TPAs, ACA and SRL's OpenBankFast, returns
true if banker is found.
(------------------------------------------------------------------------------}
Function FindBanker: Boolean;
var
tmpCTS, i, l, r, counter, FastBankAttempts, NPCDotAttempts: Integer;
BankerTPA: TPointArray;
P: TPoint;
A: Extended;
//Z: Integer;
begin
marktime(counter);
repeat
repeat
if result = true then
break;
inc(NPCDotAttempts);
repeat
inc(FastBankAttempts);
wait(600 + Random(150));
DebugBox('Searching for the Banker using OpenBankFast');
//for Z := 0 to 2 do
if OpenBankFast('veb') then
begin
if not (BankScreen) or (PinScreen) then
wait(100 + Random(100));
OpenBankFast('veb');
wait(100 + Random(100));
if (BankScreen) or (PinScreen) then
begin
DebugBox('Found Banker using OpenBankFast');
result := true
break
end;
end;
if result = false then
begin
if FindBankers(P, A) then
begin
DebugBox('OpenBankFast failed - walking to banker NPC dots');
Mouse(p.x, p.y, 0, 0, True);
Wait(600 + Random(250));
end;
end;
until (result = true) or (FastBankAttempts > 3);
If(result = false) and (FastBankAttempts > 3) then // this loop is just incase it gets stuck next to the booth
WalkToBank;
until (NPCDotAttempts > 3);
If result = false then
begin
DebugBox('NPCDots backup failed - searching for the Banker using TPAFinderBank');
if TPAFinderBank(0.19, 0.65, 4730678, 13, 0, ['ank', 'ker'], ['ank B']) then
begin
wait(RandomRange(750, 100));
if (BankScreen) or (PinScreen) then
DebugBox('Found Banker using using TPAFinderBanker');
result := true;
break;
end;
If result = false then
begin
DebugBox('TPAFinderBank failed - searching for the Banker using BankerTPA');
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.19, 0.65);
FindColorsTolerance(BankerTPA, 4730678, MSX1, MSY1, MSX2, MSY2, 13);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
SortTPAFrom(BankerTPA, Point(MSCX, MSCY));
L := High(BankerTPA)
for i := 0 to L do
begin
r := Random(L);
wait(RandomRange(60, 200));
HumanMMouse(BankerTPA[r].x, BankerTPA[r].y, 2, 2);
if WaitUpTextMulti(['ank', 'ker'], 300) then
FastClick(False);
Wait(RandomRange(50, 45));
WaitOption('ank B', 400);
DebugBox('We found the Banker using BankerTPA!')
result := true;
break;
end;
end;
end;
if FindNormalRandoms then
if (not(bankscreen or pinscreen)) then
begin
FindBanker;
end;
until (BankScreen) or (PinScreen) or (timefrommark(counter) > 60000);
if timefrommark(counter) > 60000 then
Failsafe('We failed to find the Banker within 60 seconds!');
end;
{------------------------------------------------------------------------------)
Procedure: WithdrawlFromBank
By: The Mayor
Description: Deposits planks, withdrawals logs, and get remaining logs amount.
(------------------------------------------------------------------------------}
Procedure WithdrawlFromBank;
var
BankTimer, BankAttempts: Integer;
begin
if BankScreen or PinScreen then
begin
FindNormalRandoms;
MarkTime(BankTimer)
if PinScreen then InPin(Players[0].Pin);
repeat
repeat
if (ExistsItem(28) or (InvCount > 0)) then
QuickDeposit(SRL_DEPOSIT_ALL);
Wait(500 + Random(75))
until(InvCount = 0)
Wait(100 + Random(50));
if (GetBankItemAmount(9, 1) < 28 )then
Failsafe('You have less than 28 logs in your bank') else
Withdraw(9, 1, 0);
WaitFunc(@OakLogInv, 100, 3000)
inc(BankAttempts)
if ((BankAttempts > 7) or (TimeFromMark(BankTimer) > 20000)) then
Failsafe('Banking procedure failed');
until (OakLogInv)
LogsLeft := GetBankItemAmount(9, 1)
if (Random(3) = 1) then
CloseBank;
end;
end;
{------------------------------------------------------------------------------)
Function: MoneyPouchPinScreen
By: SRL's PinScreen
Description: Returns true if it finds the MoneyPouch PinScreen. See below why I
didn't use PinScreen.
(------------------------------------------------------------------------------}
function MoneyPouchPinScreen: Boolean;
begin
Result := FindTextTPA(2070783, 0, 105, 62, 150, 75, 'Please', UpCharsEx, Nothing);
if result = true then
DebugBox('Found MoneyPouchPinScreen')
end;
{------------------------------------------------------------------------------)
Function: MoneyPouchInPin
By: Modifed by The Mayor
Description: This is a modified version of SRL's InPin function; InPin doesn't
work for the MoneyPouch.
(------------------------------------------------------------------------------}
Function MoneyPouchInPin(Pin: string): Boolean;
var
Tx, Ty, X, Y, H, I, J, Tries, ColorCount : Integer;
Boxes: array of TBox;
begin
Result := False;
if not MoneyPouchPinScreen then Exit;
if (GetNumbers(Pin) <> Pin) then
begin
srl_Warn('InPin', '''' + Pin + ''' is not a valid Pin', warn_AllVersions);
exit;
end;
if (Length(Pin) <> 4) then
begin
srl_Warn('InPin', 'Pin must be 4 digits long', warn_AllVersions);
Exit;
end;
Boxes := [IntToBox(37, 107, 100, 170), IntToBox(127, 107, 190, 170), IntToBox(217, 107, 280, 170), IntToBox(307, 107, 370, 170),
IntToBox(37, 179, 100, 242), IntToBox(127, 179, 190, 242), IntToBox(217, 179, 280, 242),
IntToBox(37, 251, 100, 314), IntToBox(127, 251, 190, 314), IntToBox(217, 251, 280, 314)];
while MoneyPouchPinScreen do
begin
for I := 1 to 4 do
begin
if not MoneyPouchPinScreen then break;
ColorCount := CountColorTolerance(clWhite, 150, 80, 380, 100, 10);
GetMousePos(x, y);
if (FindText(Tx, Ty, Pin[I], UpCharsEx, 30, 100, 383, 319)) then
begin
H := High(Boxes);
for J := 0 to H do
if IntInBox(Tx, Ty, Boxes[J]) then
begin
with Boxes[J] do
if PinScreen then
MouseBox(x1, y1, x2, y2, mouse_left);
Break;
end;
end else
begin
H := High(Boxes);
for J := 0 to H do
if IntInBox(X, Y, Boxes[J]) then
begin
with Boxes[J] do
if MoneyPouchPinScreen then
MouseBox(x1, y1, x2, y2, mouse_left);
Break;
end;
end;
Wait(100);
while (CountColorTolerance(clWhite, 150, 80, 380, 100, 10) = ColorCount) do
Wait(500);
Wait(RandomRange(300, 600));
if not MoneyPouchPinScreen then
begin
Result := True;
Exit;
end;
end;
ClickContinue(True, True);
while not FindColor(Tx, Ty, 0, 7, 460, 69, 474) do
begin
Wait(500);
if not LoggedIn then
Exit;
end;
Inc(Tries);
if Tries > 2 then
begin
Failsafe('Your pin is not the correct Pin')
Exit;
end;
end;
Result := true;
end;
{------------------------------------------------------------------------------)
Procedure: MakePlanks
By: The Mayor
Description: Waits for the plank interface, then makes the chosen type of plank.
(------------------------------------------------------------------------------}
Procedure MakePlanks;
var
PlankerTimer, PlankAttempts: Integer;
begin
MarkTime(PlankerTimer);
If FindPlanker = true then
begin
repeat
DebugBox('Waiting for plank interface');
wait(600 + Random(100)); // this can be decreased, but just to be safe.
if (PlankInterface = true) then
break;
ObjDTM_Walk(ObjSawMillDTM, 5, 100, 5, True);
wait(1500 + Random(200));
FindPlanker;
wait(RandomRange(100, 50));
until (TimeFromMark(PlankerTimer) > 20000) or (PlankInterface = true);
if (TimeFromMark(PlankerTimer) > 20000) then
begin
Failsafe('Couldnt find plank interface')
end;
repeat
inc(PlankAttempts)
wait(500 + Random(150));
case Lowercase(TYPE_OF_PLANK) of
'normal': begin
MouseBox(140, 75, 225, 170, 0);
end;
'oak': begin
MouseBox(300, 135, 354, 183, 0);
end;
'teak': begin
MouseBox(140, 200, 225, 265, 0);
end;
'mahogany': begin
MouseBox(295, 200, 380, 265, 0);
end;
end;
if (WaitOptionMulti(['All', 'll'], 500)) then
begin
wait(750 + Random(250)); // Don't change this wait. It won't find MoneyPouchPinScreen.
If (MoneyPouchPinScreen) then
begin
wait(500 + Random(50));
MoneyPouchInPin(Players[0].Pin);
end;
DebugBox('Logs have been made into planks - going to bank')
end;
until(Waitfunc(@OakPlankInv, 300, 3250)) or (PlankAttempts > 5);
end;
if PlankAttempts > 5 then
Failsafe('Could not use the plank interface');
Inc(LoadsDone);
IncEx(PlanksMade, 28);
end;
{------------------------------------------------------------------------------)
Procedure: DownloadSPSImage, GetSPSMap, & RequirementsCheck
By: Ashaman88, the one and only.
Description: Download and save the SPS .png into the SPS include folder
(------------------------------------------------------------------------------}
Procedure DownloadSPSImage(ImageName: String; Location: String);
var
Image, Path: String;
FP: Integer;
begin
DebugBox('Downloading SPS Map Image');
Image:= GetPage(Location);
Path:= IncludePath + 'SPS\img\runescape_other\' + ImageName + '.png';
Path:= Trim(Path);
FP:= CreateFile(Path);
WriteFileString(FP, Image);
CloseFile(FP);
end;
Function GetSPSMap: Boolean;
var
SPSMMap,SPSMName: String;
begin
SPSMName:= 'plank_test';
SPSMMap:= 'http://img546.imageshack.us/img546/1141/planktest.png';
if DOWNLOAD_SPS_MAP then
begin
if (not FileExists(IncludePath + 'SPS\img\runescape_other\plank_test.png')) then
DownloadSPSImage(SPSMName, SPSMMap);
end;
Result:= (FileExists(IncludePath + 'SPS\img\runescape_other\plank_test.png'));
end;
Procedure RequirementsCheck;
begin
if (not GetSPSMap) then
RaiseException(erCustomError, 'SPS Maps Do Not Exist OR They Are Named Incorrectly!');
end;
{------------------------------------------------------------------------------)
Procedure: ProgressReport
By: The Mayor
Description: Prints necessary information to the debug box.
(------------------------------------------------------------------------------}
Procedure ProgressReport;
var
TimeRun, PlanksPerHour: Integer;
ProfitHour, ProfitMade, ProfitRemaining, ETL: Integer;
begin
TimeRun := (GetTimeRunning / 1000);
PlanksPerHour := ((3600 * PlanksMade)/ TimeRun);
ProfitMade := (PlanksMade * ProfitPerPlank);
ProfitHour := ((3600 * ProfitMade) / TimeRun);
ProfitRemaining := (LogsLeft * ProfitPerPlank);
if PlanksPerHour >= 1 then
begin
ETL := (LogsLeft / PlanksPerHour);
end;
Writeln('--------`~`~` The Mayors Plank Banker `~`~`------');
Writeln('- Time Running: ' + TimeRunning + ' ');
Writeln('- Planks made: ' + IntToStr(PlanksMade) + ' Logs Left: ' + IntToStr(LogsLeft) + ' ');
Writeln('- Planks per Hour: ' + IntToStr(PlanksPerHour) + ' ');
Writeln('- Profit Made: ' + IntToStr(ProfitMade) + ' Loads Done: ' + IntToStr(LoadsDone));
Writeln('- Profit per Hour: ' + IntToStr(ProfitHour) + ' ');
WriteLn('- Time until you run out of logs: ' + IntToStr(ETL) + ' hours' + ' ');
WriteLn('- Money to be made from banked logs: ' + IntToStr(ProfitRemaining) + ' gp');
Writeln('-------------------------------------------------');
end;
{------------------------------------------------------------------------------)
Procedure: MainLoop
By: The Mayor
Description: Runs procedures and functions in the correct order
(------------------------------------------------------------------------------}
Procedure MainLoop;
begin
repeat
if (not LoggedIn) then
begin
LogInPlayer;
SetAngle(SRL_Angle_high);
ExitSquealOfFortune();
end;
SetAngle(SRL_Angle_high);
FindNormalRandoms;
if OakLogInv then
begin
if BankScreen or PinScreen then
begin
CloseBank
end;
WalkToPlanker;
wait(500)
Antiban;
wait(500);
FindPlanker;
wait(500);
MakePlanks;
end;
if OakPlankInv then
begin
if BankScreen or PinScreen then
begin
WithdrawlFromBank;
end;
WalkToBank;
wait(500);
FindBanker;
wait(500);
WithdrawlFromBank;
wait(300);
Antiban;
end else
begin
if BankScreen or PinScreen then
begin
WithdrawlFromBank;
end else
begin
FindBanker;
WithdrawlFromBank;
end;
end;
if not DEBUG then
ClearDebug;
ProgressReport;
TakeBreak;
TimeUntilBreak;
until(LoadsDone = LOADS_TO_DO)
If (LoadsDone = LOADS_TO_DO) then
Failsafe('Completed ' + IntToStr(LOADS_TO_DO) + ' loads - ending script :D')
end;
{------------------------------------------------------------------------------)
Script Setup Procedure
(------------------------------------------------------------------------------}
begin
Smart_FixSpeed := True;
SRL_SixHourFix:= True;
ObjDTM_Setup;
SetupSRL;
LoadDtms;
LoadSPSPath;
SPS_setup(runescape_other,['plank_test']);
SPS_Tolerance := 595.0;
SPS_Accuracy := 4;
RequirementsCheck;
DeclarePlayers;
ResetBreakTimer;
ProfitCalculation;
AddonTerminate('FreeTheDtms');
MainLoop;
end.