The Spark
2014-11-16 15:31:30
How Long have You Played Runescape?
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
No
What is your general programming knowledge?
Well, I attempted to learn python a few years ago, only learned the basics, but it has really helped me in learning to code with Simba and using SRL.
Are you a member of any other communities?
No
Tell us about yourself…
Please show us one (or multiple) of your scripts.
Third times the charm right? I have written a new script from the last time I applied, I hope you guys like it better than my previous one. If you decide to vote no, please leave a post telling me what I can do better. I like being here, and I hope you all like having me on the forums. Thanks for taking the time to read my application.
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
No
What is your general programming knowledge?
Well, I attempted to learn python a few years ago, only learned the basics, but it has really helped me in learning to code with Simba and using SRL.
Are you a member of any other communities?
No
Tell us about yourself…
From: sparkyownage
Well, my name is Thad. I'm 19 years old, I'm a student, I go to college in California. I'm doing my undergrad at Stanford University, and I hope to get into their medical school in a few years. I am currently studying to become a Cardiac Surgeon, which takes an extremely long time. I spend most of my time studying, my education is probably the #1 most important thing for me . I don't really play or watch any sports, but I really like coding, it's very fascinating and I love the different scripts you can create to solve the same issue. That's pretty much why I'm here, to learn more
Please show us one (or multiple) of your scripts.
program CanifisTanner;
{$DEFINE SMART} // Always have this to load smart
{$I SRL-6/SRL.simba} // To load the SRL include files
{$I SPS/lib/SPS-RS3.Simba} // To load the SPS include files
{
__ __ _ ____
| \/ | | | | _ \
| \ / | __ _ __| | ___ | |_) |_ _
| |\/| |/ _` |/ _` |/ _ \ | _ <| | | |
| | | | (_| | (_| | __/ | |_) | |_| |
|_| |_|\__,_|\__,_|\___| |____/ \__, |
__/ |
|___/
_____ _
/ ____| | |
| (___ _ __ __ _ _ __| | ___ _ _____ ___ __ __ _ __ _ ___
\___ \| '_ \ / _` | '__| |/ / | | |/ _ \ \ /\ / / '_ \ / _` |/ _` |/ _ \
____) | |_) | (_| | | | <| |_| | (_) \ V V /| | | | (_| | (_| | __/
|_____/| .__/ \__,_|_| |_|\_\\__, |\___/ \_/\_/ |_| |_|\__,_|\__, |\___|
| | __/ | __/ |
|_| |___/ |___/
{-----------------------------INSTRUCTIONS: -----------------------------------)
{------------------------------------------------------------------------------)
Have it zoomed all the way out
Start the script with your player in Canifis Bank
Have the dragonhides you want it to withdraw in the 1st bank preset
Have NOTHING in your inventory
If you want the script to work well, go in a world where your ping is good
Fill out your username and password
Fill out at what percent you want to rest at
Press Play or F9
Have fun :)
Written for SRL Membership Application
{------------------------------------------------------------------------------)
{------------------------------------------------------------------------------}
const
VERSION = '1.6';
Location = 'Taverly'; //Supports three locations: Al_Kharid, or Canifis, or Taverly(Case Sensitive).
NumberOfLoads = 500; // How many loads do you want it to complete?
PercentRest = 35; // # at what percent you would like the bot to rest
Type TBankTanInfo = Record
colour, tol: Integer;
hue, sat: Extended;
name, click: String;
end;
Type SparkObject = Record
colour, width, height, tolerance:integer;
hue, sat:extended;
text: TstringArray;
end;
var
loadscomplete : Integer;
rested : Integer;
tanner, bank: TBankTanInfo;
ftanner, fbanker: SparkObject;
const
SBOTT_COLOUR = 2040107;
SBOTT_TOL = 6;
SBOTT_HUE = 0.55;
SBOTT_SAT = 1.09;
CANIFIS_BANK_COLOUR = 1723228;
CANIFIS_BANK_TOL = 5;
CANIFIS_BANK_HUE = 0.04;
CANIFIS_BANK_SAT = 2.74;
KHARID_BANK_COLOUR = 3046218;
KHARID_BANK_TOL = 16;
KHARID_BANK_HUE = 1.04;
KHARID_BANK_SAT = 1.01;
TAN_BUTTON_COLOUR = 8872454;
TAN_BUTTON_TOL = 11;
TAN_BUTTON_HUE = 0.02;
TAN_BUTTON_SAT = 0.26;
ELLIS_COLOUR = 14675955;
ELLIS_TOL = 5;
ELLIS_HUE = 0.21;
ELLIS_SAT = 4.03;
TAV_BANK_COLOUR = 2632741;
TAV_BANK_TOL = 0;
TAV_BANK_HUE = 0.00;
TAV_BANK_SAT = 0.00 ;
JACK_COLOUR = 12635597;
JACK_TOL = 8;
JACK_HUE = 0.63;
JACK_SAT = 0.77;
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := ''; // Put your username in between the apostraphes
password := ''; // Put your password in between the apostraphes
isActive := true;
isMember := true;
end
currentPlayer := 0;
end;
{------------------------------------------------------------------------------)
{------------------------------------------------------------------------------)
{------------------------------------------------------------------------------)
{------------------------------------------------------------------------------)
{------------------------------------------------------------------------------)
{--------------------------END OF SCRIPT SETUP---------------------------------)
(--------------------------DO NOT TOUCH BELOW----------------------------------)
(-------------------UNLESS YOU KNOW WHAT YOU'RE DOING--------------------------)
{------------------------------------------------------------------------------)
(------------------------------------------------------------------------------}
{------------------------------------------------------------------------------)
{------------------------------------------------------------------------------)
{------------------------------------------------------------------------------)
{------------------------------------------------------------------------------)
Procedure: autoUpdateMe
Description: Checks for updated script online, and downloads if avaliable.
Credits: Shuttleu and Ashaman88 and TheMayor (modified by Sparkyownage)
(------------------------------------------------------------------------------}
procedure autoUpdateMe();
var
newFile: integer;
onlineVersion, latestScript, newFileName: string;
begin
writeln('Checking for script updates...');
writeLn('');
onlineVersion := getPage('tannerrs3.googlecode.com/git/version.txt');
writeLn('NOTIFICATION: Current script version: ' + version + ' | Online version: ' + onlineVersion);
if (trim(onlineVersion) > version) then
begin
writeLn('NOTIFICATION: Downloading the newer version from Google Code');
latestScript := GetPage('http://tannerrs3.googlecode.com/git/CanifisTanner.simba');
newFileName := scriptPath+ 'Sparkyownages Canifis Tanner v'+OnlineVersion+'.simba';
newFile := rewriteFile(newFileName, true);
if not writeFileString(newFile, latestScript) then
begin
writeLn('NOTIFICATION: Fatal error writing to ' + newFileName);
terminatescript();
end;
closeFile(newFile);
writeLn('NOTIFICATION: New script downloaded to ' + newFileName + ' | Please use this one!');
writeLn('');
terminateScript();
end else
writeLn('NOTIFICATION: You have the latest version.');
end;
{------------------------------------------------------------------------------)
Procedure: checkForImages
Description: Downloads the SPS map and/or paint picture if you don't have them.
Credits: Kevin
(------------------------------------------------------------------------------}
procedure checkForImages(path, link, item: string);
var
progFile: longInt;
picName: string;
begin
picName := AppPath + path;
try
if not fileExists(picName) then
begin
writeLn('NOTIFICATION: ' + item + ' does not exist - Downloading it now!.');
progFile := createFile(picName);
end else
exit;
closeFile(progFile);
progFile := rewriteFile(picName, false);
writeFileString(progFile, getPage(link));
writeLn('NOTIFICATION: ' + item + ' has been download to Simba folder!');
writeLn('');
finally
if (progFile > 0) then
closeFile(progFile);
end;
end;
{------------------------------------------------------------------------------)
Procedure: scriptTerminate
Description: Logs the player out when something goes wrong)
(------------------------------------------------------------------------------}
procedure scriptTerminate();
begin
writeln('Shutting down: Took a picture, please post the picture in the thread for assistance');
saveScreenshot(scriptPath + timeRunning() + ':' + 'TannerFailure.png');
players[currentPlayer].logout;
terminateScript;
end;
{------------------------------------------------------------------------------)
Procedure: antiban
Description: Does some random (human-like) stuff.
(------------------------------------------------------------------------------}
procedure antiBan();
var
i: integer;
begin
if not isLoggedin() then
exit;
i := random(500);
case i of
1..12: pickUpMouse();
13..18: randomRClickItem();
19..26: sleepAndMoveMouse(random(2000) + 750);
27..32: smallRandomMouse();
33..50: mouseOffClient(OFF_CLIENT_RANDOM);
51..85: randomCompass(random(300), randomrange(10, 100), false);
86..150: hoverRandomSkill();
end;
end;
{------------------------------------------------------------------------------)
Procedure: sparkObject.setVal
Description: Sets the values used in sparkObject.find
(------------------------------------------------------------------------------}
procedure sparkObject.setVal(col, tol, w, ht: integer; h, s: extended; txt: TstringArray);
begin
self.colour := col;
self.tolerance := tol;
self.width := w;
self.height := ht;
self.hue := s;
self.sat := s;
self.text := txt;
end;
{------------------------------------------------------------------------------)
Function: sparkObject.find
Description: Uses values from sparkObject.setVal to find something
(------------------------------------------------------------------------------}
function sparkObject.find(): boolean;
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit;
findColorsSpiralTolerance(x, y, tpa, self.colour, mainScreen.getBounds(), self.tolerance, colorSetting(2, self.hue, self.sat));
if (Length(TPA) < 1) then
exit;
ATPA := TPA.toATPA(self.width, self.height);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(self.text, 500) then
begin
fastClick(MOUSE_LEFT);
smartImage.clearArea(mainscreen.getBounds());
break;
end;
end;
end;
{------------------------------------------------------------------------------)
Procedure: needToRest
Description: Figures out if a player has enough run energy to continue
(------------------------------------------------------------------------------}
function needToRest(): boolean;
var
x, y, i, RunATPA, s, f: integer;
TPA, TPA1: TPointArray;
ATPA: T2DPointArray;
begin
if findColorsSpiralTolerance(x, y, TPA, 14673134, minimap.button[MM_BUTTON_RUN].bounds, 10, colorSetting(2, 0.56, 3.07)) then
ATPA := TPA.toATPA(7, 7);
smartImage.debugATPA(ATPA);
if (Length(ATPA) <= 1) then
writeln('Unable to find the Run Button!')
else
RunATPA := Length(ATPA);
writeln(IntToStr(RunATPA));
if RunATPA <= 2 or not findColorsSpiralTolerance(s, f, TPA1, 3985643, minimap.button[MM_BUTTON_RUN].bounds, 12, colorSetting(2, 0.11, 1.36)) then
result:= true;
end;
{------------------------------------------------------------------------------)
Procedure: Rest
Description: Rests if needed
(------------------------------------------------------------------------------}
procedure rest();
var
x, y: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
RTimer: TTimeMarker;
p: Tpoint;
begin
if needToRest and not minimap.isResting then
begin
RTimer.start;
smartImage.clearArea(minimap.getBounds());
mouse(point(minimap.button[MM_BUTTON_RUN].center.x+random(5), minimap.button[MM_BUTTON_RUN].center.y+random(5)), MOUSE_MOVE);
wait(randomRange(300, 500));
fastClick(MOUSE_RIGHT);
chooseOption.select(['est']);
antiban;
repeat
findColorsSpiralTolerance(x, y, TPA, 14673134, minimap.button[MM_BUTTON_RUN].bounds, 10, colorSetting(2, 0.56, 3.07));
ATPA := TPA.toATPA(7, 7);
until rTimer.getTime >= 16000 or length(ATPA) > 3
if not minimap.isRunEnabled then
begin
mouse(point(minimap.button[MM_BUTTON_RUN].center.x+random(5), minimap.button[MM_BUTTON_RUN].center.y+random(5)), MOUSE_MOVE);
fastClick(MOUSE_LEFT);
exit;
end;
end;
end;
{-----=------------------------------------------------------------------------)
Procedure: findBanker
Description: Locates the Banker
(------------------------------------------------------------------------------}
function findBanker(): boolean;
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit;
case lowercase(location) of
'al_kharid': minimap.setAngle(MM_DIRECTION_NORTH);
'taverly': minimap.setAngle(170);
end;
case lowercase(location) of
'canifis': fbanker.setVal(bank.colour, bank.tol, 30, 30, bank.hue, bank.sat, ['anker', 'ooth']);
'al_kharid': fbanker.setVal(bank.colour, bank.tol, 15, 15, bank.hue, bank.sat, ['anker', 'ooth']);
'taverly': fbanker.setVal(bank.colour, bank.tol, 15, 15, bank.hue, bank.sat, ['anker', 'ooth']);
end;
if fbanker.find() then
result;
end;
{------------------------------------------------------------------------------)
Procedure: takeOutHides
Description: Withdraws 28 Dragonhide using the first preset
(------------------------------------------------------------------------------}
procedure takeOutHides();
begin
if not isLoggedin() then
exit;
if bankscreen.isOpen(5000) then
begin
bankScreen.clickButton(BANK_BUTTON_PRESET_2);
end;
end;
{------------------------------------------------------------------------------)
Procedure: WalktoTanner
Description:Uses SPS to walk from the bank to the tanner
(------------------------------------------------------------------------------}
procedure WalktoTanner();
var
pathtoTanner: TPointArray;
p: TPoint;
begin;
if needToRest() then
rest();
if(tabBackpack.count() = 28) and not bankscreen.isOpen(2500) then
begin
wait(randomRange(400, 550));
case lowercase(location) of
'canifis':
begin
pathtoTanner := [Point(186, 241), Point(164, 234), Point(152, 224), Point(147, 218), Point(141, 212), Point(135, 203), Point(127, 195), Point(119, 191), Point(109, 185), Point(104, 177), Point(101, 171), Point(101, 162), Point(105, 156)];
SPS.walkPath(pathtoTanner);
end;
'al_kharid':
begin
pathtoTanner := [Point(87, 254), Point(104, 269), Point(117, 247), Point(111, 223), Point(125, 208), Point(128, 177), Point(127, 156)];
SPS.walkPath(pathtoTanner);
SPS.blindWalk(Point(105, 153));
end;
'taverly':
begin
pathtoTanner := [Point(111, 119), Point(122, 137), Point(129, 163), Point(129, 193), Point(128, 218), Point(117, 254), Point(100, 257)];
SPS.walkPath(pathtoTanner);
SPS.blindWalk(Point(100, 257));
end;
end;
end;
if(tabBackpack.count() < 28) then
begin;
WriteLn('We do not have enough items in our inventory');
scriptTerminate();
terminateScript();
end;
end;
{------------------------------------------------------------------------------)
Function: insideTanner
Description: Returns true if the player is standing inside the tanner
Returns false if the player is anywhere else
(------------------------------------------------------------------------------}
function insideTanner(): boolean;
var
Tanner := intToBox(80, 140, 120, 165);
begin
result := PointInBox(SPS.GetPlayerPos, Tanner);
if result then
writeLn('We are inside the tanner')
else
begin
writeLn('We are not inside the tanner, something went wrong.');
writeLn('We are attempting to recover');
end;
end;
{------------------------------------------------------------------------------)
Function: WalkBackToSbott
Description: If unable to get to tanner, teleports to lodestone and walks back
(------------------------------------------------------------------------------}
Procedure WalkBackToSbott();
var
pathBackToTanner: TPointArray;
LodestoneTimer: TTimeMarker;
p: TPoint;
begin
if not isLoggedIn() then
exit;
LodestoneTimer.start;
LodestoneScreen.teleportTo(LOCATION_CANIFIS);
Wait(randomRange(17000, 20000));
if LodestoneTimer.getTime > 150000 then
begin;
scriptTerminate();
TerminateScript();
end;
pathBackToTanner := [Point(222, 88), Point(200, 104), Point(182, 125), Point(171, 139), Point(149, 155), Point(119, 182), Point(99, 186), Point(105, 155)];
sps.walkPath(pathBackToTanner)
end;
{------------------------------------------------------------------------------)
Function: findTanner
Description: Locates Sbott or Ellis(The Tanner) in his shop
(------------------------------------------------------------------------------}
function findTanner(): boolean;
var
x, y, i, attempts: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedin() then
exit;
case lowercase(location) of
'canifis':
begin
if insideTanner() = false then
WalkBackToSbott();
minimap.setangle(MM_DIRECTION_EAST);
wait(randomRange(100, 250));
end;
'al_kharid':
begin
if getPixelShiftAverage(mainscreen.getBounds, 250, 500) > 400 then
wait(randomRange(2000, 3500));
minimap.setAngle(275);
end;
'taverly': minimap.setAngle(170);
end;
ftanner.setVal(tanner.colour, tanner.tol, 10, 10, tanner.hue, tanner.sat, [tanner.name]);
repeat
if ftanner.find()then
exit;
inc(attempts)
until attempts = 2;
end;
{------------------------------------------------------------------------------)
Procedure: TanHides
Description: Clicks on the tan option to tan the dragonhide into dragon leather
(------------------------------------------------------------------------------}
procedure tanHides();
var
RoyalBox: TBox;
TPA: TPointArray;
x, y: integer;
begin;
if not isLoggedin() then
exit;
if productionScreen.isOpen(5000) then
productionScreen.clickStart();
end;
{------------------------------------------------------------------------------)
Procedure: WalktoBank
Description: Uses SPS to walk to the bank in Canifis
(------------------------------------------------------------------------------}
procedure WalktoBank();
var
pathtoBanker: TPointArray;
pathtoTanner: TPointArray;
begin;
if not isLoggedin() then
exit;
if needToRest() then
rest();
case lowercase(location) of
'canifis':
begin
pathtoBanker := [Point(107, 148), Point(105, 156), Point(101, 162), Point(101, 171), Point(104, 177), Point(109, 185), Point(119, 191), Point(127, 195), Point(135, 203), Point(141, 212), Point(147, 218), Point(152, 224), Point(164, 234), Point(186, 241), Point(193, 241)];
SPS.walkPath(pathtoBanker);
end;
'al_kharid':
begin
pathtoBanker := [Point(105, 153), Point(127, 156), Point(128, 177), Point(125, 208), Point(111, 223), Point(117, 247), Point(104, 269), Point(87, 254)];
SPS.walkPath(pathtoBanker);
SPS.blindWalk(Point(87, 254));
end;
'taverly':
begin
pathtoBanker := [Point(102, 252), Point(117, 254), Point(128, 218), Point(129, 193), Point(129, 163), Point(122, 137)];
sps.walkPath(pathtoBanker);
sps.blindWalk(Point(111, 119));
end;
end;
end;
{------------------------------------------------------------------------------)
Procedure: SetupSPS
Description: Sets up each SPS Map depending on your location
(------------------------------------------------------------------------------}
procedure SetupSPS();
begin;
if Location = 'Canifis' then
begin
checkForImages('Includes/SPS/img/runescape_other/Canifis_Map.png', 'http://i.imgur.com/f3PvC3s.png', 'SPS map');
SPS.setup('Canifis_Map', RUNESCAPE_OTHER, 5, 775, 0.5)
end;
if location = 'Al_Kharid' then
begin
checkForImages('Includes/SPS/img/runescape_other/Al_KharidTanMap.png', 'http://i.imgur.com/ngz1ofH.png', 'SPS map');
SPS.setup('Al_KharidTanMap', RUNESCAPE_OTHER, 5, 775, 0.5);
end;
if location = 'Taverly' then
begin
checkForImages('Includes/SPS/img/runescape_other/TaverlyTanMap.png', 'http://i.imgur.com/93fbkzH.png', 'SPS map');
SPS.setup('TaverlyTanMap', RUNESCAPE_OTHER, 5, 775, 0.5);
end;
end;
procedure LoadBankTanInfo();
begin
case lowercase(location) of
'taverly': begin
tanner.click := 'hides';
tanner.name := 'Jack';
tanner.colour := JACK_COLOUR;
tanner.tol := JACK_TOL;
tanner.hue := JACK_HUE;
tanner.sat := JACK_SAT;
bank.colour := TAV_BANK_COLOUR;
bank.tol := TAV_BANK_TOL;
bank.hue := TAV_BANK_HUE;
bank.sat := TAV_BANK_SAT;
end;
'al-kharid': begin
tanner.click := 'hide';
tanner.name := 'Ellis';
tanner.colour := ELLIS_COLOUR;
tanner.tol := ELLIS_TOL;
tanner.hue := ELLIS_HUE;
tanner.sat := ELLIS_SAT;
bank.colour := KHARID_BANK_COLOUR;
bank.tol := KHARID_BANK_TOL;
bank.hue := KHARID_BANK_HUE;
bank.sat := KHARID_BANK_SAT;
end;
'canifis': begin
tanner.click := 'ade';
tanner.name := 'Sbott';
tanner.colour := SBOTT_COLOUR;
tanner.tol := SBOTT_TOL;
tanner.hue := SBOTT_HUE;
tanner.sat := SBOTT_SAT;
bank.colour := CANIFIS_BANK_COLOUR;
bank.tol := CANIFIS_BANK_TOL;
bank.hue := CANIFIS_BANK_HUE;
bank.sat := CANIFIS_BANK_SAT;
end;
end;
end;
{------------------------------------------------------------------------------)
Procedure: Report
Description: Displays how many loads have been completed in te debug window
(------------------------------------------------------------------------------}
procedure Report();
var
TannedHides: integer
begin;
TannedHides := loadscomplete * 28
if not isLoggedin() then
exit;
writeLn('{-------------------------------------------------------}');
writeLn('{-------------------------------------------------------}');
writeLn('{-------------------------------------------------------}');
writeLn('{-------------------------------------------------------}');
writeLn('{-------------Canifis Tanner by Sparkyownage------------}');
writeLn(' Script has been running for: ' + timeRunning());
writeLn('{---------------We have completed ' + IntToStr(loadscomplete) + ' loads---------------}');
writeLn('{-----------We have tanned: ' + IntToStr(TannedHides) + ' Hides--------------------}');
writeLn('{-------------------------------------------------------}');
writeLn('{-------------------------------------------------------}');
writeLn('{-------------------------------------------------------}');
end;
{------------------------------------------------------------------------------)
The Main Loop
Description: Puts all of the above procedures and functions together in the
correct order
(------------------------------------------------------------------------------}
// main loop
begin
clearDebug(); // Clear the debug box
autoUpdateMe(); //Automatically updates the script
smartPlugins := ['D3d9.dll', 'opengl32.dll']; // Enables the Direct X plugin
smartEnableDrawing := true; // So we can draw on SMART
setupSRL(); // Load the SRL include files
Loadbanktaninfo();
setupSPS(); // sets up SPS maps depending on your location
declarePlayers(); // Set up your username/pass
if not isLoggedIn() then // If player isn't logged in then
begin
players[currentPlayer].login(); // Log them in
exitSquealOfFortune(); // Exit squeal if found
end;
case lowercase(location) of
'canifis':
begin
minimap.setAngle(MM_DIRECTION_NORTH); // Make compass north and angle high
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
'al_kharid':
begin
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
mainscreen.setZoom(true, 40);
mainscreen.setZoom(false, 30)
end;
'taverly':
begin
mainscreen.setAngle(MS_ANGLE_HIGH);
KeyDown(40);
wait(randomRange(200, 300));
KeyUp(40);
end;
end;
repeat
findBanker();
takeOutHides();
WalktoTanner();
findTanner();
tanHides();
walktoBank();
antiban();
Inc(loadscomplete);
Report();
until(loadscomplete = NumberOfLoads);
end.
program BanannaPicker;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$I SPS/lib/SPS-RS3.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}
const
BC = 712681; // Bank colour, tol, hue, and sat.
BT = 7;
BH = 0.10;
BS = 1.18;
TIME_RUN = 0; // Player Form Integers, used in DeclarePlayers
BAN_COLLECTED = 1;
DRAW_ON_SMART = 2;
var
loadscomplete: integer; // Used in Progress Report
Box: Tbox;
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'Sparkyownages Bananna Collector';
editBoxLabels := ['Minutes to run', 'Loads to Complete'];
editBoxDefaults := ['0', '0', '0'];
editBoxHints := ['Run the script for x amount of time (in minutes)?', ' How many loads of 28 Bananas do you want?'];
checkBoxLabels := ['Draw on SMART'];
checkBoxDefaults := ['False'];
end;
end;
procedure declarePlayers();
var
i: integer;
begin
players.setup(playerForm.players);
currentPlayer := 0;
for i := 0 to high(players) do
with players[i] do
begin
integers[TIME_RUN] := strToInt(playerForm.players[i].settings[0]);
integers[BAN_COLLECTED] := strToInt(playerForm.players[i].settings[1]);
booleans[DRAW_ON_SMART] := strToBool(playerForm.players[i].settings[2]);
end;
end;
procedure antiBan();
var
i: integer;
begin
if not isLoggedin() then
exit;
i := random(350);
case i of
1..12: pickUpMouse();
13..26: sleepAndMoveMouse(random(2000) + 750);
27..32: smallRandomMouse();
33..60: randomCompass(random(300), randomrange(10, 100), false);
end;
end;
procedure WalkToBan();
var
pathToBan: TPointArray;
begin
pathToBan := [Point(251, 154), Point(243, 156), Point(235, 156), Point(225, 155), Point(215, 155), Point(203, 156), Point(189, 151), Point(184, 149), Point(177, 148), Point(174, 148), Point(170, 146), Point(163, 146), Point(154, 146), Point(145, 140), Point(133, 139), Point(118, 138), Point(107, 138), Point(98, 136), Point(94, 129), Point(96, 122), Point(96, 116), Point(98, 106), Point(98, 101), Point(98, 96)];
SPS.walkPath(pathToBan);
SPS.blindWalk(Point(102, 96));
end;
procedure findBananas();
var
x,y, i: integer;
BANTPA, TTPA: TPointArray;
BANATPA, TATPA: T2DPointArray;
begin
Minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
findColorsSpiralTolerance(x, y, TTPA, 819606, mainscreen.getBounds, 8, colorSetting(2, 0.04, 0.19)); // tree finder
TATPA := TTPA.toATPA(20, 75);
TATPA.sortFromMidPoint(mainscreen.playerPoint);
if players[currentPlayer].booleans[DRAW_ON_SMART] then smartImage.debugATPA(TATPA);
for i := 0 to high(TATPA) do
begin
box := GeTTPAbounds(TATPA[I]);
if findColorsSpiralTolerance(x, y, BANTPA, BC, box, BT, colorSetting(2, BH, BS))then // banana finder
begin
if players[currentPlayer].booleans[DRAW_ON_SMART] then smartImage.debugTPA(BANTPA);
mouse(box.getMiddle, MOUSE_MOVE);
if players[currentPlayer].booleans[DRAW_ON_SMART] then smartImage.clearArea(mainscreen.getBounds);
exit();
end;
end;
end;
procedure PickBanannas();
begin
findBananas();
while (isMouseOverText(['ick'], 1000, true))do
begin
multiClick(box.getMiddle, 62, 10); // clicks tree mutliple times to stimulate human-like clicking.
antiban();
wait(300 + Random(200));
minimap.waitPlayerMoving;
if tabBackpack.count = 28 then exit;
end;
end;
procedure TeleAndBank();
var
TeleT: TTimeMarker;
p: Tpoint;
begin
TeleT.start;
LodestoneScreen.teleportTo(LOCATION_EDGEVILLE);
while (not minimap.findSymbol(p, MM_SYMBOL_LODESTONE, Minimap.getBounds)) do begin
wait(1000 + random(500));
end;
if TeleT.getTime > 180000 then terminateScript();
wait(2500 + random(1000));
if minimap.findSymbol(p, MM_SYMBOL_COOKING_RANGE, minimap.getBounds) then Mouse(p, MOUSE_LEFT);
wait(500 + random(500));
Minimap.setAngle(MM_DIRECTION_SOUTH); // best angle to find bankers
KeyDown(40); // makes Mainscreen angle at just about halfway between MS_ANGLE_HIGH and MS_ANGLE_LOW
wait(300);
KeyUp(40);
minimap.waitPlayerMoving;
if minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds) then Mouse(p, MOUSE_LEFT);
wait(500 + random(400));
minimap.waitPlayerMoving;
bankscreen.Open(BANK_NPC_BLUE);
if bankscreen.isOpen(5000) then bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
bankscreen.close;
inc(loadscomplete);
end;
procedure telePS();
var
p: Tpoint;
begin
lodestoneScreen.teleportTo(LOCATION_PORT_SARIM);
while (not minimap.findSymbol(p, MM_SYMBOL_LODESTONE, Minimap.getBounds)) do begin
wait(1000 + random(500));
end;
wait(2500 + random(1000));
if minimap.findSymbol(p, MM_SYMBOL_TRANSPORTATION, minimap.getBounds) then Mouse(p, MOUSE_LEFT);
minimap.waitPlayerMoving;
wait(1000 + random(400));
end;
procedure findSailer();
var
x,y, i: integer;
SAILTPA: TPointArray;
SAILATPA: T2DPointArray;
begin
if findColorsSpiralTolerance(x, y, SAILTPA, 6043433, mainscreen.getBounds, 9, ColorSetting(2, 0.34, 0.64)) then
SAILATPA := SAILTPA.toATPA(30, 30);
if players[currentPlayer].booleans[DRAW_ON_SMART] then smartimage.debugATPA(SAILATPA);
for i := 0 to high(SAILATPA) do mouse(middleTPA(SAILATPA[i]), MOUSE_MOVE);
if isMouseOverText(['to'], 500) then begin
fastClick(MOUSE_RIGHT);
chooseOption.select(['Pay']);
if conversationbox.isOpen(5000) then begin // clicks through the conversation box of the sailer
conversationBox.continue(true, true);
wait(randomRange(500, 900));
conversationBox.selectOption(1);
wait(randomRange(500, 900));
conversationBox.continue(true, true);
wait(6000 + random(2000));
pressKey(27);
wait(6000 + random(2000));
end;
end;
end;
procedure findGangPlank();
var
box: Tbox;
begin
minimap.clickCompass;
wait(gaussRangeInt(300, 500));
mainScreen.setAngle(MS_ANGLE_HIGH);
Box := intToBox(278, 175, 298, 143); // player lands in same spot each time, a tbox gets the job done with the least amount of lines used.
if players[currentPlayer].booleans[DRAW_ON_SMART] then smartImage.drawBox(Box, false, ClRed);
MouseBox(box, MOUSE_MOVE);
if isMouseOverText(['ank'], 5000) then fastClick(MOUSE_LEFT); // failsafe for clicking gangplank, I wouldn't just click a tbox cmon :)
end;
procedure Proggy();
var
bansCollected: Integer;
begin
if not isLoggedin then exit;
bansCollected := loadscomplete * 28;
writeLn('{***-----------------------------***}');
writeLn('{***-----------------------------***}');
writeLn(' Sparkyownages Banana Collecter ');
writeLn(' Script has been running for:' + IntToStr(getSystemTime));
writeLn(' We have collected ' + IntToStr(bansCollected) + 'bananas ');
writeLn('{***-----------------------------***}');
writeLn('{***-----------------------------***}');
end;
begin
initPlayerForm(); // initiate your settings
runPlayerForm(); // run the form
if not playerForm.isScriptReady then terminateScript();
smartEnableDrawing := true;
SetupSRL;
SPS.setup('karamap', RUNESCAPE_OTHER, 5, 775, 0.5);
clearDebug();
repeat
telePS();
findSailer();
findGangPlank();
WalkToBan();
minimap.waitPlayerMoving();
repeat
PickBanannas();
minimap.waitPlayerMoving;
until(tabBackpack.count = 28);
TeleAndBank();
Proggy();
until players[currentPlayer].booleans[TIME_RUN] = getSystemTime or players[currentPlayer].booleans[BAN_COLLECTED] = (loadscomplete)
end.Third times the charm right? I have written a new script from the last time I applied, I hope you guys like it better than my previous one. If you decide to vote no, please leave a post telling me what I can do better. I like being here, and I hope you all like having me on the forums. Thanks for taking the time to read my application.
I sent it to the wrong person by accident and it didn't get judged lol