SRL Archive - Archive

therossity - SRL Member Application


Ross

2014-09-21 14:18:08

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?
None! I took a Java and c++ course my freshman year but never went past that. SRL (pascal) is the first time I've ever enjoyed coding.


Are you a member of any other communities?
No


Tell us about yourself…
From: therossity
Hi everyone!

My name is Ross, I'm 21 years old. I go to Kennesaw State in GA, where I'm a member of the Scholar's Program for the College of Business, 1 of 17 of 25,000 students.

I traveled to England for 2 months alone when I turned 18.

I've worked many jobs including: sales, carpet cleaning, adopting out puppies, Apple store retail. I'm currently Head of IT for the Doctorate program at my school.

I started playing Runescape a week after the 2004 Superbowl. My account only has 2 skills that are not maxed (div and dung).


I love movies and have seen almost every T.V. show known to man. I do spray stencils for fun, and I'm getting a lot better every week.


I love the community here. I leeched from rsbuddy and powerbot back in '11-'12 before going on sporadic hiatuses, and created an account on SRL in June of 2012. With the bot nuke in full swing I never used SRL and didn't come back until July 2014. I had to create a new account since I couldn't remember my old password :p

When I came back to SRL I saw how incredible the community was and how eager everyone was to help, and knew immediately that it was a community that I wanted to be a part of and contribute to. I made my first post a few days later and began working on my first script.

Since then I have completed 3 public scripts, and am constantly working on private scripts. A few weeks ago, Daniel was able to merge my current account with my old account (except for the name, Wizzup? pls help) where my post count per day dropped dramatically :p


So that was kind of a wall of text, but tl;dr I love it here and I love the people I have met and can't wait to keep contributing!



Please show us one (or multiple) of your scripts.
program RossitysSlimeSlayer;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}

const

USE_DIRECT_X = true;
DISABLE_DEBUG = true;
COMBAT_MODE = 'momentum'; // type either momentum or revolution
USE_ANTIPOISON = false;
ANTIBAN_CHANCE = 4; //e.g. 10 is a 10% chance for antiban before kill
PRESET_NUM = BANK_BUTTON_PRESET_1;


{Tar Model Loot Array}
TAR1_COLOUR = 21039841;
TAR1_TOL = 0;
TAR1_HUE = 0.00;
TAR1_SAT = 0.00;

{Tar Model 2 Loot}
TAR2_COLOUR = 2302758;
TAR2_TOL = 0;
TAR2_HUE = 0.00;
TAR2_SAT = 0.00;

{Tar Model 3 Loot}
TAR3_COLOUR = 2303014;
TAR3_TOL = 0;
TAR3_HUE = 0.00;
TAR3_SAT = 0.00;

{Tar Model 4 Loot}
TAR4_COLOUR = 2040098;
TAR4_TOL = 0;
TAR4_HUE = 0.00;
TAR4_SAT = 0.00;

{Diamond Loot}
DIA_COLOUR = 8817555;
DIA_TOL = 1;
DIA_HUE = 3.85;
DIA_SAT = 0.11;

{Dragonstone Loot}
DRA_COLOUR = 5906233;
DRA_TOL = 2;
DRA_HUE = 0.87;
DRA_SAT = 0.82;

{Slimes}
SLIME_COLOUR = 3098426;
SLIME_TOL = 2;
SLIME_HUE = 0.82;
SLIME_SAT = 0.72;

{Booth Papers}
BANK_COLOUR = 13624538;
BANK_TOL = 3;
BANK_HUE = 0.64;
BANK_SAT = 1.17;

{Cave Entrance}
ENT_COLOUR = 1774608;
ENT_TOL = 1;
ENT_HUE = 1.52;
ENT_SAT = 3.85;


procedure declarePlayers();
begin
setLength(players, 1);

with players[0] do
begin
loginName := '';
password := '';
isActive := true;
world := -1;
isMember := true;
end

currentPlayer := 0;
end;


var
x, y, i, currentTar, tarPrice, tarAtStart,
dragonstones, dragonstonePrice, tarGathered: integer;
Path : array [0..2] of TPointArray;
tarColour: TIntegerArray = [TAR1_COLOUR, TAR2_COLOUR, TAR3_COLOUR, TAR4_COLOUR];
tarTol: TIntegerArray = [TAR1_TOL, TAR2_TOL, TAR3_TOL, TAR4_TOL];
tarHue: TExtendedArray = [TAR1_HUE, TAR2_HUE, TAR3_HUE, TAR4_HUE];
tarSat: TExtendedArray = [TAR1_SAT, TAR2_SAT, TAR3_SAT, TAR4_SAT];


lockDTM := DTMFromString('mbQAAAHicY2VgYFBiZGCQA2J1KAaxjwDFj0PxQSi+PEmSoSlWiKEkWpChPlGJoStPh0GSARMwYsFgAACnzgoe');
aPoisonDTM := DTMFromString('mbQAAAHicY2VgYNjOxMCwB4h3A/F6IN4MxBsZGRj2AvEpID4JpbtqbICqmVCwJAMmYMSCwQAA3BMI2A==');
buffDTM := DTMFromString('mbQAAAHicY2VgYPABYjsgjoJiEDuDEciG4jIoPmTiwhA1TRIFSzJgAkYsGAwAZAAJCw==');
foodDTM := DTMFromString('mWAAAAHicY2FgYLjBxMBwDYjvAfFFIK5iZGAoBeI6IK4F4q3FaUBVTHAsyYAKGNEwCAAA1mwHCQ==');
cogDTM := DTMFromString('mbQAAAHicY2VgYLBmYmCwAGJbKAaxzzAyMFyE4hNQzCciyRBlzwnEXAwdZZYMneVWDJIMmIARCwYDAIL1CUc=');
tarDTM := DTMFromString('mbQAAAHicY2VgYGhnYmCoB+IeIJ4CxJOBuIKRgaEJiNuBuAGIi4FYQ00NqJoJBUsyYAJGLBgMAO+2Bdw=');

LOCATION_BOX: TBox := intToBox(150, 151, 196, 186);



{******************************************************************************}
{** Frees the DTMS when the script is terminated. **}
{******************************************************************************}

procedure freeAllDTMS();
begin
freeDTMs([lockDTM, aPoisonDTM, buffDTM, foodDTM, cogDTM, tarDTM]);
end;

{******************************************************************************}
{** Loads the Paths that SPS uses. **}
{******************************************************************************}

procedure load_SPSPaths();
begin
Path[0] := [Point(275, 301), Point(288, 365), Point(262, 420), Point(198, 441), Point(152, 481), Point(102, 522), Point(50, 541)];
Path[1] := [Point(276, 304), Point(290, 359), Point(304, 408), Point(281, 468), Point(242, 487), Point(202, 505), Point(152, 530), Point(111, 534), Point(66, 536)];
Path[2] := [Point(137, 60), Point(79, 60), Point(65, 92), Point(95, 129), Point(148, 127), Point(182, 155), Point(178, 171)];
SPSAnyAngle := true;

SPS.setup('CAVES', RUNESCAPE_OTHER);

writeln('Loaded SPS paths successfully');
end;

{******************************************************************************}
{** The loot finding function, returns true if successful based **}
{** on certain constants. Used for a later procedure. **}
{** Idea taken from The Mayor's GAO Script, edited to suit my needs. **}
{******************************************************************************}


function lootFinder(filter: boolean; hue, sat: extended; W, H, colour, tolerance: integer; mouseOverText: array of string): boolean;
var
i, x, y: integer;
p: TPoint;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit(false);

findColorsSpiralTolerance(x, y, TPA, colour, mainScreen.getBounds(), tolerance, colorSetting(2, hue, sat));

if (length(TPA) < 1) then
exit(false);

ATPA := TPA.cluster(W, H);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);

writeln('Found potential loot!');

for i := 0 to high(ATPA) do
begin
if random(10) = 1 then
missMouse(middleTPA(ATPA[i]), true)
else
mouse(middleTPA(ATPA[i]), MOUSE_MOVE, MOUSE_HUMAN);

if isMouseOverText(mouseOverText, 900) then
begin
writeln('Found loot!');
fastClick(MOUSE_LEFT);
smartImage.clear();
tabBackpack.waitforShift(3000);
exit(true);
end

else if isMouseOverText(['ttack', 'ake'], 900) then
begin
writeln('Found loot!');
fastClick(MOUSE_RIGHT);
if chooseOption.optionsExist(['ake Swa']) then
chooseOption.select(['ake Swa']);
if chooseOption.optionsExist(['ragons']) then
begin
chooseOption.select(['ragons']);
inc(dragonstones);
end;
smartImage.clear();
tabBackpack.waitforShift(3000);
exit(true);
end

else
// writeln('The next loot debug is the issue.');
exit(false);
end;
end;

{******************************************************************************}
{** Sets what combat mode to use based on defined constant. **}
{** It is advised to use momentum. **}
{******************************************************************************}

procedure setCombat();
begin
if not isLoggedIn() then
exit;

case lowercase(COMBAT_MODE) of
'momentum' :
begin
if findDTM(cogDTM, x, y, actionBar.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
fastClick(MOUSE_RIGHT);
chooseOption.select(['omentum']);
wait(randomRange(1500,2500));
end;
end;
'revolution' :
begin
if findDTM(cogDTM, x, y, actionBar.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
fastClick(MOUSE_RIGHT);
chooseOption.select(['evolution']);
wait(randomRange(1500,2500));
end;
end
else begin
writeLn('You didn''t enter a valid combat mode.');
terminateScript();
end;
end;
end;

{******************************************************************************}
{** Lodestones and then walks to the bank. Doesn't use SPS Map. **}
{******************************************************************************}

procedure walkToBank();
var
pathToBank: TPointArray;
begin
if not isLoggedIn() then
exit;

minimap.clickCompass();
mainscreen.setAngle(MS_ANGLE_HIGH);
lodestoneScreen.teleportTo(LOCATION_BURTHORPE);
wait(randomRange(16000, 17000));
writeLn('Walking back to Bank');

mouse(point(minimap.CX - 25 - random(15),minimap.CY + 20 + random(10)), MOUSE_LEFT);
wait(gaussRangeInt(2500, 3000));

while minimap.isFlagPresent do
minimap.waitPlayerMoving(250);
end;

{******************************************************************************}
{** Cicks one of the papers on the desk of the bank booth. **}
{******************************************************************************}

procedure findBankBooth();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
BankTimer : TTimeMarker;
begin
if not isLoggedIn() then
exit;

bankTimer.start();

minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);

repeat

findColorsSpiralTolerance(x, y, TPA, BANK_COLOUR, mainScreen.getBounds(), BANK_TOL, colorSetting(2, BANK_HUE, BANK_SAT));

if (Length(TPA) < 1) then
walkToBank;

ATPA := TPA.toATPA(15, 30);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);

writeLn('Opening Bank');
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['ank']) then
begin
fastClick(MOUSE_LEFT);
smartImage.clear();
wait (randomrange(1500,2000));
break;
end;
end;
smartImage.clear();
until bankScreen.isOpen() or (bankTimer.getTime() > 30000);
end;

{******************************************************************************}
{** Withdraws preset inventory. **}
{******************************************************************************}

procedure withdrawSupplies();
begin
if not isLoggedIn() then
exit;

if bankScreen.isOpen() then
bankScreen.clickButton(PRESET_NUM);
end;

{******************************************************************************}
{** Lodestones to Lumbrige and then walks to the cave entrance. **}
{******************************************************************************}

procedure walkToCave();
var
pathToCave: TPointArray;
begin
if not isLoggedIn() then
exit;

lodestoneScreen.teleportTo(LOCATION_LUMBRIDGE);
wait(randomRange(16000, 17000));
minimap.setAngle(MM_DIRECTION_NORTH);

writeLn('Walking to Cave.');

case random(2) of
1 : begin
SPS.walkPath(Path[1]);
end
else
SPS.walkPath(Path[0]);
end;

minimap.waitPlayerMoving(500);

end;

{******************************************************************************}
{** Finds the hole to the cave and clicks it to enter. **}
{******************************************************************************}

procedure enterCave();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
caveTimer : TTimeMarker;
begin
if not isLoggedIn() then
exit;

caveTimer.start();

findColorsSpiralTolerance(x, y, TPA, ENT_COLOUR, mainScreen.getBounds(), ENT_TOL, colorSetting(2, ENT_HUE, ENT_SAT));

if (Length(TPA) < 1) then
begin
writeln('Didn''t find cave entrance.');
walkToCave;
end;

ATPA := TPA.toATPA(15, 15);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);

writeLn('Entering Cave');
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['own', 'ark']) then
begin
fastClick(MOUSE_LEFT);
smartImage.clear();
wait (randomrange(9000,10000));
break;
end;
end;
end;

{******************************************************************************}
{** Checks background colors to make sure it's in the cave. **}
{** Then walks to spot where we kill slimes. **}
{******************************************************************************}

procedure walkToSpot();
var
pathToSpot: TPointArray;
begin
if not isLoggedIn() then
exit;

{if not (minimap.getColorPercent(0, 0) > 5) then
enterCave(); }

minimap.setAngle(MM_DIRECTION_NORTH);
SPS.walkPath(Path[2]);

writeLn('Walking to Spot.');

if SPS.walkPath(Path[2]) then
minimap.waitPlayerMoving(250)
else
writeLn('Path to Spot failed.');

end;


{******************************************************************************}
{** Checks for the DTM of the gold lock that appears when fighting. **}
{** Credits to Clarity, edited to suit my needs. **}
{******************************************************************************}


function areWeFighting: boolean;
var
tries : integer;
begin
if not isLoggedIn then
exit;
// writeln('Checking to see if we are in combat.')
while tries < 4 do
if findDTM(lockDTM, x, y, mainScreen.getBounds()) then
begin
wait(randomRange(1000,1500));
exit(true);
end
else
inc(tries);
//writeln('Not in combat.');
end;

{******************************************************************************}
{** Grabs price strings from the RS Wiki. Used in next procedure. **}
{** This is The Mayor's snippet. **}
{******************************************************************************}


function getPrice(itemString: string): integer;
var
wikiaPage, priceString: string;
begin
wikiaPage := getPage('http://runescape.wikia.com/wiki/Exchange:' + itemString);
priceString := between('GEPrice">', '</span>', wikiaPage);
result := strToIntDef(ExtractFromStr(priceString, numbers), -1);
end;

{******************************************************************************}
{** Defines the prices of certain loot. **}
{******************************************************************************}

procedure definePrices();
begin
tarPrice := getPrice('Swamp_tar');
writeLn('Tar price: '+ toStr(tarPrice));
DragonstonePrice := getPrice('Uncut_dragonstone');
writeLn('Dragonstone price: '+ toStr(DragonstonePrice));
end;


{******************************************************************************}
{** Maths stuff and pastes the Progress Report. **}
{******************************************************************************}

procedure progressReport();
var
profit, profitPerHour, tarPerHour: integer;
begin
tarPerHour := round((tarGathered * (3600.0 / (GetTimeRunning / 1000.0))));
profit := round((tarGathered * tarPrice) + (dragonstones * dragonstonePrice));
profitPerHour := round((profit * (3600.0 / (GetTimeRunning / 1000.0))));

writeln('===========Rossity''s Slime Slayer============');
writeln(' Tar Gathered: ' + (toStr(tarGathered)));
writeln(' Dragonstones Gathered: ' + (toStr(dragonstones)));
writeln(' Profit: ' + (toStr(profit)));
writeln(' Tar per hour: ' + (toStr(tarPerHour)));
writeln(' Profit per hour: ' + (toStr(ProfitPerHour)));
writeLn(' Time running: ' + timeRunning(TIME_SHORT));
writeln('==============================================');
end;

{******************************************************************************}
{** Returns true if player is in defined constant area. **}
{******************************************************************************}

function isInArea(): boolean;
var
pos: TPoint;
begin
pos := SPS.getPlayerPos();
result := pointInBox(pos, LOCATION_BOX);
end;

{******************************************************************************}
{** Checks to see if the Player is in the defined constant area where **}
{** we kill slimes. If not runs back in. **}
{******************************************************************************}

procedure checkLocation();
begin
if not isLoggedIn() then
exit;

if not isInArea() then
begin;
writeLn('Too far out, running back in.');
SPS.walkToPos(LOCATION_BOX.getGaussPoint());
end;
end;

{******************************************************************************}
{** Checks to see how much tar is in inventory. **}
{******************************************************************************}

function getTarAmount(var x, y: integer): integer;
begin
if findDTM(tarDTM, x, y, tabBackpack.getBounds()) then
result := getItemAmount(tabBackPack.getSlotBox(tabBackPack.pointToSlot([x, y])));
end;

{******************************************************************************}
{** Waits for slots stackable number to increase. **}
{** This is The Mayors Snippet. **}
{******************************************************************************}

function waitSlotCount(count, slot, maxWait :integer) : boolean;
var
t: integer;
begin
t := getSystemTime() + maxWait;

while (getSystemTime() < t) and (not result) do
result := (getItemAmount(tabBackpack.getSlotBox(slot)) > count);
end;

{******************************************************************************}
{** Looks for lots of loot models. This is an area where black colors **}
{** are everywhere. Checks location of player after loot function so that **}
{** it doesn't skip any loot. **}
{******************************************************************************}

procedure findLoot();
var
startTar : integer;
begin
if not isLoggedIn() then
exit;

gameTabs.openTab(TAB_BACKPACK);

startTar := getTarAmount(x, y);

//writeln('Found ' + toStr(startTar) + ' tar in slot ' + toStr(tabBackPack.pointToSlot([x, y])));;

for i := 0 to high(tarColour) do
if lootFinder(true, tarHue[i], tarSat[i], 15, 15, tarColour[i], tarTol[i], ['amp ta']) then
begin
if waitSlotCount(startTar, tabBackPack.pointToSlot([x, y]), 5000) then
begin
incEx(tarGathered, (getTarAmount(x, y) - startTar));
wait((300) + 100);
progressReport();
end;
end
else
begin
//writeln('Debug Tar ' + toStr(tarColour[i]));
wait(randomRange(50, 75));
end;

if lootFinder(true, DRA_HUE, DRA_SAT, 15, 15, DRA_COLOUR, DRA_TOL, ['ncut drag']) then
begin
wait((300) + 100);
progressReport();
checkLocation();
end else
begin
//writeln('Debug Dragonstones');
wait(randomRange(50, 75));
checkLocation();
end;

end;

{******************************************************************************}
{**Finds slimes and clicks 'em. Speeds up the mouse cause they're kinda fast.**}
{** Exits if mouseover text isn't found since they're constantly moving. **}
{******************************************************************************}

function attackSlime() : boolean;
var
x1, y1, ms: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
monsterTimer:TTImeMarker;
begin
if not isLoggedIn() then
exit;

ms := mouseSpeed;
mouseSpeed := randomRange(30, 40);
monsterTimer.start();

repeat

findColorsSpiralTolerance(x, y, TPA, SLIME_COLOUR, mainScreen.getBounds(), SLIME_TOL, colorSetting(2, SLIME_HUE, SLIME_SAT));

if (Length(TPA) < 1) then
begin
writeln('Didn''t find any slimes');
findLoot;
if isinArea then
wait(1000)
else
CheckLocation;
exit;
end;

ATPA := TPA.toATPA(30, 30);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);

for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['ttack'], 500) then
begin
fastClick(MOUSE_LEFT);
mouseSpeed := ms;
smartImage.clear();
writeln('Atacking Slime');
wait(randomRange(500, 1000));
minimap.waitPlayerMoving(250);
exit;
end
else
exit;
end;
until areWeFighting() or monsterTimer.getTime() > 45000;
smartImage.clear();
end;

{******************************************************************************}
{** The procedure for banking and walking back. **}
{******************************************************************************}

procedure bankProcedure();
begin
if not isLoggedIn() then
exit;

walkToBank();
findBankBooth();
withdrawSupplies();
walkToCave();
enterCave();
walkToSpot();
end;

{******************************************************************************}
{** Finds AntiPoision DTM in backpack. If the vial is empty, it drops **}
{** it and drinks the next vial that it finds. Banks if no vials found. **}
{******************************************************************************}

function drinkAntiPoison() : boolean;

begin
if not isLoggedIn() then
exit;

if findDTM(aPoisonDTM, x, y, tabBackpack.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
if isMouseOverText(['rink'], 500) then
begin
writeln('Drinking Antipoison');
fastClick(MOUSE_LEFT);
wait(randomRange(1500,2500));
exit();
end
else if isMouseOverText(['ial'], 500) then
begin
fastClick(MOUSE_RIGHT);
chooseOption.select(['rop']);
wait(randomRange(1500,2500));
begin
if findDTM(aPoisonDTM, x, y, tabBackpack.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
if isMouseOverText(['rink'], 500) then
begin
writeln('Drinking Antipoison');
fastClick(MOUSE_LEFT);
wait(randomRange(1500,2500));
exit();
end;
end;
end;
end
end else
writeln('Couldn''t find Antipoison, time to Bank!.');
bankProcedure();
end;

{******************************************************************************}
{**Checks Chatbox for AntiPoison Buff DTM. Chatbox is my personal preference.**}
{******************************************************************************}

procedure checkBuffs();
begin
if not isLoggedIn() then
exit;

if findDTM(buffDTM, x, y, chatBox.getBounds()) then
exit
else
drinkAntiPoison();
end;


{******************************************************************************}
{** Checks your health. If below a randomly defined integer, it eats. **}
{** If no food is found, then it starts the bank procedure. **}
{******************************************************************************}

procedure checkHealth();
var
x, y, i, hpPercent, hpRange : integer;

begin
if not isLoggedIn() then
exit;

hpPercent := actionBar.getHPPercent();
hpRange := (randomRange(40,50));

if hpPercent < hpRange then
begin
if findDTM(foodDTM, x, y, tabBackpack.getBounds()) then
begin
mouse(x, y, 5, 5, MOUSE_MOVE);
fastClick(MOUSE_LEFT);
writeLn('Health less than ' + toStr(hpRange) + '%, eating Food');
end
else
writeln('No food found!');
wait(randomRange(5000, 6000));
bankProcedure();
end;
end;

{******************************************************************************}
{** Antiban **}
{******************************************************************************}

procedure antiBan();
var
i: integer;
begin
closeAdWindow();
exitTreasure();

i := random(100);
if i <= ANTIBAN_CHANCE then
begin
writeln('Doing antiban.');
case random(8) of
0 : pickUpMouse();
1 : mouseOffClient(OFF_CLIENT_RANDOM);
2 : sleepAndMoveMouse(random(3000) + 1500);
3 : begin
writeln('Waiting a few seconds.');
wait(RandomRange(3000, 5000));
end;
4 : mouseMovingObject();
5 : hoverSkill(SKILL_ATTACK);
6 : hoverSkill(SKILL_STRENGTH);
7 : hoverSkill(SKILL_DEFENCE);
end;
tabBackpack.Open;
end;
end;

{******************************************************************************}
{** Downloads the necessary SPS Map. **}
{** 100% Credit to 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('Please restart script!');
terminateScript();
finally
if (progFile > 0) then
closeFile(progFile);
end;
end;


{******************************************************************************}
{** Main Loop **}
{******************************************************************************}

procedure mainLoop;
begin
repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(randomRange(4000, 6000));
mainscreen.setAngle(MS_ANGLE_HIGH);
exitTreasure();
end
else
begin
if not areWeFighting() then
begin
if USE_ANTIPOISON then
checkbuffs();

findLoot();
checkHealth();
antiBan();
attackSlime();
end;
if tabBackpack.isFull() then
bankProcedure();
end;
until false;
end;

{******************************************************************************}
{** Setup **}
{******************************************************************************}

begin
clearDebug();

if USE_DIRECT_X then
smartPlugins := ['d3d9.dll'];
addOnTerminate('freeAllDTMs');

checkForImages('Includes/SPS/img/runescape_other/CAVES.png','http://i.imgur.com/XUDjgrO.png', 'SPS map');

smartEnableDrawing := true;
disableSRLDebug := DISABLE_DEBUG;
smartShowConsole := false;

setupSRL();
load_SPSPaths();
definePrices();

declarePlayers();
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(Randomrange(4000, 6000));
mainscreen.setAngle(MS_ANGLE_HIGH);
end;
exitTreasure();

if not isInArea() then
bankProcedure();


setCombat();
mainLoop();
end.

Ross

2014-09-21 14:24:07

Putting this here so that people can use it for the code below for testing purposes.

Basic info about the script:

Features:
Customizable combat mode, chance for antiban, preset number, and use of super antipoison.

Requirements:
    17 Slayer
    Oil Lantern
    Spiny Helm equipped
    2h weapon equipped (halberd preferred)
    must have already placed a rope on the entrance to Lumbridge Swamp Caves.

Set-up:
    Fill out the constants at the top
    Have your preset either: High-level: or Low-level
    Move your Buff Box to the chatbox, similar to Ashamans chatBox.getXP function. (This is personal preference, you can change the procedure checkBuffs to mainScreen.getBounds instead if you'd like.)
    Hit play!



Let me know if you have any comments or questions! I love getting feedback, good or bad!


Also, here's a proggy from one of my low level accounts.


The Mayor

2014-09-21 16:36:35

Very nice! If you can tell me what is wrong with this procedure I will vote yes:


procedure checkHealth();
var
x, y, i, hpPercent, hpRange : integer;

begin
if not isLoggedIn() then
exit;

hpPercent := actionBar.getHPPercent();
hpRange := (randomRange(40,50));

if hpPercent < hpRange then
begin
if findDTM(foodDTM, x, y, tabBackpack.getBounds()) then
begin
mouse(x, y, 5, 5, MOUSE_MOVE);
fastClick(MOUSE_LEFT);
writeLn('Health less than ' + toStr(hpRange) + '%, eating Food');
end
else
writeln('No food found!');
wait(randomRange(5000, 6000));
bankProcedure();
end;
end;

rj

2014-09-21 16:44:11

voted yes

p.s I live 30-45 mins from you

Ross

2014-09-21 16:51:22

From: The Mayor
…


Hmm, well I unnecessarily did two things.

1) I defined 'i' for no reason. Must have left it in accidentally.
2) hpPercent is not needed.

Here is a better version of the procedure:

procedure checkHealth();
var
x, y, hpRange : integer;

begin
if not isLoggedIn() then
exit;

hpRange := (randomRange(40, 50));

if actionBar.getHPPercent() < hpRange then
begin
if findDTM(foodDTM, x, y, tabBackpack.getBounds()) then
begin
mouse(x, y, 5, 5, MOUSE_MOVE);
fastClick(MOUSE_LEFT);
writeLn('Health less than ' + toStr(hpRange) + '%, eating Food');
end
else
writeln('No food found!');
wait(randomRange(5000, 6000));
bankProcedure();
end;
end;


Is this what you were referring to?

Ross

2014-09-21 16:52:24

From: Robert
voted yes

p.s I live 30-45 mins from you


Thanks! :D

Did you go to Music Midtown over the weekend?

The Mayor

2014-09-21 17:09:43

From: therossity


Is this what you were referring to?


Nope. What happens after you eat food?

Ross

2014-09-21 17:22:01

From: The Mayor
Nope. What happens after you eat food?


Haha, whoops, I'm dumb. It will only do the writeln. It was so simple I looked right over it!

procedure checkHealth();
var
x, y, hpRange : integer;

begin
if not isLoggedIn() then
exit;

hpRange := (randomRange(40, 50));

if actionBar.getHPPercent() < hpRange then
begin
if findDTM(foodDTM, x, y, tabBackpack.getBounds()) then
begin
mouse(x, y, 5, 5, MOUSE_MOVE);
fastClick(MOUSE_LEFT);
writeLn('Health less than ' + toStr(hpRange) + '%, eating Food');
end
else
begin
writeln('No food found!');
wait(randomRange(5000, 6000));
bankProcedure();
end;
end;
end;

The Mayor

2014-09-21 18:43:51

From: therossity
Haha, whoops, I'm dumb. It will only do the writeln. It was so simple I looked right over it!

procedure checkHealth();
var
x, y, hpRange : integer;

begin
if not isLoggedIn() then
exit;

hpRange := (randomRange(40, 50));

if actionBar.getHPPercent() < hpRange then
begin
if findDTM(foodDTM, x, y, tabBackpack.getBounds()) then
begin
mouse(x, y, 5, 5, MOUSE_MOVE);
fastClick(MOUSE_LEFT);
writeLn('Health less than ' + toStr(hpRange) + '%, eating Food');
end
else
begin
writeln('No food found!');
wait(randomRange(5000, 6000));
bankProcedure();
end;
end;
end;


Yep, so now you won't run to the bank after you eat a piece of food :p Voted yes. You have some great potential :)


E: InB4 @NKN and @Justin add to their farm :p

bonsai

2014-09-21 18:46:08

I'm a yes for Ross, he's shown a good community spirit and his scripts improve with each post.

Had some thoughts on the script but will probably just discuss via pm.

NKN

2014-09-21 18:56:51

From: The Mayor
Yep, so now you won't run to the bank after you eat a piece of food :p Voted yes. You have some great potential :)


E: InB4 @NKN and @Justin add to their farm :p


Barnicals my plan has been foiled again!

OT: Voted yes, OP

Ross

2014-09-21 19:13:46

From: The Mayor
Yep, so now you won't run to the bank after you eat a piece of food :p Voted yes. You have some great potential :)


From: bonsai
I'm a yes for Ross, he's shown a good community spirit and his scripts improve with each post.


From: NKN
OT: Voted yes, OP


Thank you everyone!


@bonsai I'd love some ideas, this thing is my baby :p I assume it has something to do with colors (your favorite), and hopefully it has something to do with loot finding!


e: if anyone is curious, this is what the loot(left) looks like compared to the area it's in.
http://puu.sh/bID48/82b5041889.png
Also on the right you can see 4 particularly awful drops (lantern frame, iron boots, iron sword) that have extremely close colors to the tar. This area is horrible for cs2 basically.

Sin

2014-09-21 19:38:02

No.

riwu

2014-09-21 19:40:38

Voted yes. Pretty neat script!

else if isMouseOverText(['ial'], 500) then
fastClick(MOUSE_RIGHT);
chooseOption.select(['rop']);
wait(randomRange(1500,2500));
begin
if findDTM(aPoisonDTM, x, y, tabBackpack.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
if isMouseOverText(['rink'], 500) then
begin
writeln('Drinking Antipoison');
fastClick(MOUSE_LEFT);
wait(randomRange(1500,2500));
exit();
end;
end;
end;
dont forget the begin and end for multiple statement after an if statement!

Wetish

2014-09-21 19:53:27

I like to see activity and contributions to the forum. Even though you have only been here for 2 months, you have managed to release multiple scripts to the public. Yes.

Ross

2014-09-21 19:57:37

From: riwu
…


Thanks! Edited.

Ross

2014-09-21 20:00:08

From: Wetish
I like to see activity and contributions to the forum. Even though you have only been here for 2 months, you have managed to release multiple scripts to the public. Yes.


Thank you! Don't tell anybody where I work that that's what I do all day. :p

Clarity

2014-09-21 20:56:05

Voted yes.
Ross not only has committed a lot of time to scripting, but also has shown incredible drive and desire to learn more and perfect his work. Very happy to see this app.

3Garrett3

2014-09-21 22:05:25

For all of the reasons above I vote yes. I've been interested in your scripts ever since you release your shaft fletcher, which is a script competing directly with what I've been developing for a month now. I think mine will just bank in any public release though. Without going too far off topic, yours gets about 50k more per hour than mine does, so I can't say too much ;). The above script is more advanced than the shaft shaver IMO so again, YES

Ross

2014-09-21 23:12:53

From: Clarity
Voted yes.
Ross not only has committed a lot of time to scripting, but also has shown incredible drive and desire to learn more and perfect his work. Very happy to see this app.


Thank you very much :)

From: 3Garrett3
For all of the reasons above I vote yes. I've been interested in your scripts ever since you release your shaft fletcher, which is a script competing directly with what I've been developing for a month now. I think mine will just bank in any public release though. Without going too far off topic, yours gets about 50k more per hour than mine does, so I can't say too much ;). The above script is more advanced than the shaft shaver IMO so again, YES


Thank you! I didn't add banking because it can run forever (just had a 6 hour proggy myself today), out of curiosity what trees is yours cutting? Feel free to PM me :)

Enslaved

2014-09-23 13:28:38

No , Im a lazy sadistic retard that loves raping the no button.(its also closer to the submit button)

its a yes : ) good job, keep up the good work

Ian

2014-09-23 13:52:23

Yes. Good script, public script releases, good attitude in posts.

Enslaved

2014-09-23 14:22:36

@Justin why am I an old timer and this guy isnt we have the same join date

rj

2014-09-23 15:13:04

From: Enslaved
@Justin why am I an old timer and this guy isnt we have the same join date


OT: Juniors don't get the old timers cup until they are member-ed with the exception of juniors from a long time ago such as https://villavu.com/forum/member.php?u=717 and https://villavu.com/forum/member.php?u=942

The Mayor

2014-09-23 15:46:26

Yeah old timer cup is auto once you become SRL Member

Justin

2014-09-23 19:00:44

@Enslaved; - As above.

The Mayor

2014-09-23 19:32:35

@Daniel @Coh3n Result is fairly clear I'd say :p