J_R
2014-12-24 11:43:59
Since I had wanted this script made and noone was doing it, I ended up making this myself. Seeing as noone (that I can see) has posted an Elf Agility Course script yet, after using this to max my least favorite skill in RS, I thought I'd post it to give back to the community that brought me most of the scripts I wanted.
Special Thank You to RlagkRud as I based the two finders off of your fisher
What it does/has:
[INDENT]-completes the Hefin Agility Course in Elf City
-banks the rewards from the light creature (generally before your inventory space runs out, only got full once for me)
-gets 70-80k xp/hr at 92+ agility and more than 55k/hr at minimum reqs (without Voice of Seren, breaks 100k with it at high agi), fastest course in the game
-checks agility xp every few laps
-doesn't move mouse if it sees that it's still on top of the next obstacle
-a progress report every lap[/INDENT]
What it doesn't do:
[INDENT]-velocity (well it will still work but it's a ton buggier and I think it's not even that much faster anyway)
-shortcuts[/INDENT]
Requirements to access course:
[INDENT]-77 Agility
-Completion of Plague's End[/INDENT]
Instructions to setup:
1. Make sure you have all the proper SMART settings, especially the XP counter in the top right corner of the chatbox (this is very important)
2. Pull the chatbox as far down as it can go (it should only be showing 3 or 4 lines of text)
3. Fill in your playerform details in DeclarePlayers, probably want to specify a world too unless you want to be logged in to w2 after six hours
4. Start with camera angled south and all the way up with the red carpet at the start of the course visible (for this reason you probably want to be logged in to start it)
5. Already have your bank pin entered before you start the script or disable it. Will add support for bank pins the next time I update this script.
Everything should look like this before you start it (doesn't matter which tab chat + backpack tab are open to and no familiar but everything else): http://imgur.com/58LQ3T1
99s Achieved
[indent]
-J_R (120 done too)
-3zx
-Clarity
-everve
-uhit
-xiao
-mylastregret
[/indent]
Testimonials:
I've used it to train from 83-99 agility myself and have run it overnight a few times and it still is running when I wake up. Since this mostly uses TBoxes it is inherently a little bottish; however, I've run it for extremely long periods of time (I think 16hrs in a row once) and still haven't been banned so it's probably fine, definitely beats doing it yourself.
Proggy from last night, not too enlightening but I figured I should probably post one (I was using silverhawks during this and didn't keep track of my earlier proggies so it's around 1.5-2x more xp than normal, someone should use it and post a proggy):
——————————–
1297047 XP gained
140928.385368486 XP / HR
running for 552.215366666667 minutes
———————————
A recent double xp proggy of mine:
--------------------------------
1951381 XP gained
200660.803691328 XP / HR
running for 583.486716666667 minutes
---------------------------------
More Proggies (ty 3zx):
--------------------------------
416294 XP gained
93869.1949354701 XP / HR
running for 266.0901 minutes
---------------------------------501091 XP gained
128892.544960403 XP / HR
running for 233.259883333333 minutes564843 XP gained
99420.866495668 XP / HR
running for 340.880216666667 minutesUpdates:
1/29/2015:
[INDENT]
-Made the script look for the carpet towards the bottom and middle of the screen (to hopefully reduce the likelihood of people wearing red at the bank throwing the script off etc…)
-Fixed a bug where every time you would receive an item from completing the course, the proggy would get messed up since the reward dialogue blocks the xp counter (also tried to fix the starting xp to work correctly if you start the script without logging in)
-Added a failsafe to banking so that it doesn't try to deposit stuff when your invent is empty and forced it to deposit when the backpack was full (ty Clarity)
-Added a few login checks that ought to have been there before
[/INDENT]
Script:
program JRElfAgility;
{$DEFINE SMART}
{$I SRL-6/SRL.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}
{$I SPS/lib/SPS-RS3.Simba}
var
startxp, blueColor, currentxp, mainLoopIterations, repeats, oldxp, redCarpetColor, cathedralPipeLight, roofTileBoundary, bankCircleColor: integer;
scriptTimer, bankTimer: TTimeMarker;
xpcheckflag : boolean;
bottomOfScreenPt : Tpoint; //used to focus the ATPA to sort from a point at the bottom of the screen (suggested by Clarity)
stringArr: array of string;
procedure setupMyVariables()
begin
redCarpetColor := 922725;
bankCircleColor := 561649;
stringArr := ['eap', 'cale', 'rave', 'ault', 'lid', 'erge']; //all possible actions on the course
startxp := chatbox.getXPBar; //start script logged in with xp visible so this works
write('startxp is ');
writeln(startxp);
scriptTimer.start;
oldxp := 0;
xpcheckflag := false;
bottomOfScreenPt.x := 245;
bottomOfScreenPt.y := 320;
mainLoopIterations := 0;
end
procedure DeclarePlayers;
begin
Players.Setup(['name'], 'default');
SetLength(Players, 1);
with players[0] do
begin
IsActive := True;
World := 2; //change to your world
end;
CurrentPlayer := 0;
end;
//prints my progress report, has xp gained, xp/hr, and runtime in minutes
procedure progressReport();
begin
if not isLoggedIn then
exit;
if startxp = 0 then //in order to correctly do xp/hr calculations if start xp got messed up because you weren't logged in
begin
startxp := chatbox.getXPBar;
exit;
end
currentxp := chatbox.getXPBar;
if currentxp = 0 then //this means we can't find the xp, try again later
begin
xpcheckflag := true; //let the rest of the script know to make a proggie on the next obstacle
exit;
end
write('current xp is ');
writeln(currentxp);
writeLn('--------------------------------');
write(currentxp - startxp);
writeln(' XP gained');
write((currentxp - startxp) / (scriptTimer.getTime) * 1000 * 3600);
writeln(' XP / HR');
write('running for ');
write(scriptTimer.getTime / 1000 / 60);
writeln(' minutes');
writeln('---------------------------------');
end
//finds and clicks an object of a certain color if it has the desired mouse over text
//also waits for a random amount of time after clicking if the arguments are provided
function ClickObject(color: integer; mouseOverText: array of string; waitLow: integer = 0; waitHigh: integer = 10; pt : TPoint = mainScreen.playerPoint): Boolean
var
x, y, i: integer;
Coords: TBox;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn then
exit;
Coords := mainScreen.getBounds();
Coords.x1 := Coords.x1 + 200;
Coords.y1 := Coords.y1 + 100;
if findColorsSpiralTolerance(x, y, TPA, color, Coords, 20, colorSetting(2, 0.05, 0.52)) then
begin
ATPA := TPA.toATPA(10, 10);
ATPA.sortFromMidPoint(pt); //sorts ATPA from closest to this pt
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(mouseOverText) then
begin
FastClick(Mouse_Left);
wait(randomRange(1500 + waitLow, 2000 + waitHigh));
Exit(True);
end
if i > 5 then
exit(false);
end
Exit(True);
end
else
begin
Exit(False)
end
end
//this clicks inside a square given with bottom left corner x,y and side length diff
//it will click and return true if it finds the desired mouseover text in the box on the screen
//lastly, if it finds the object the waitLow and waitHigh arguments are the boundaries of the random range you want to wait for after you click
function BoxFinder(mouseOverText: array of string; x: integer; y: integer; diff: integer; waitLow: integer = 0; waitHigh: integer = 10): boolean;
begin
if not isLoggedIn then
exit;
if(xpcheckflag) then //this means that we need to make a progress report since we got a reward on the last lap
begin
progressReport();
xpcheckflag := false;
end
//if our mouse is already over the obstacle then just click it (usually works for at least first 3 obstacles)
if isMouseOverText(mouseOverText) then
begin
fastClick(mouse_left);
wait(randomRange(waitLow, waitHigh));
exit(true);
end
if mainscreen.isPlayerAnimating then
begin
wait(randomRange(1000, 1500));
result := BoxFinder(mouseOverText, x, y, waitLow, waitHigh);
exit
end
mouse(x + random(diff), y + random(diff), mouse_move);
if isMouseOverText(mouseOverText) then
begin
fastClick(mouse_left);
wait(randomRange(waitLow, waitHigh));
exit(true);
end
else
exit(false);
end
//deposits the entire inventory into the bank
function doBanking(): boolean;
begin
if not isLoggedIn then
exit;
writeLn('banking time!');
if (bankScreen.isOpen()) then
begin
writeLn('depositing all');
bankScreen.quickDeposit(0);
wait(700 + Random(200));
bankScreen.close();
wait(random(900, 1200));
exit(true);
end
exit(false);
end
//finds and opens a prifidinas bank chest on the screen, it uses the color of the oval on the bank chest to find it
procedure openBank();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn then
exit;
bankTimer.start();
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_SOUTH);
writeln('banking time!');
repeat
if findColorsSpiralTolerance(x, y, TPA, bankCircleColor, mainScreen.getBounds, 20, colorSetting(2, 0.05, 0.52)) then
begin
ATPA := TPA.toATPA(10, 10);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['se Ban']) then
begin
fastClick(MOUSE_LEFT);
wait(2500 + Random(1000));
Exit;
end
end
end
else
begin
writeLn('did not find a bank box, waiting and trying again');
write('bank timer is ');
writeLn(bankTimer.getTime());
wait(2000 + Random(500));
Exit;
end;
until (bankScreen.isOpen() or bankTimer.getTime() > 30 * 1000);
end
//this is the agility course logic, mostly just finding objects or clicking in boxes and waiting
procedure mainLoop();
var
x, y, banktries: integer;
pt: Tpoint;
begin
if not isLoggedIn then
exit;
if ((random(500) > 475) and (not tabBackpack.isEmpty)) or (tabBackpack.isFull) then
begin
openBank;
doBanking;
end;
oldxp := currentxp;
ClickObject(redCarpetColor, stringArr, 5500, 7500, bottomOfScreenPt);
writeln('clicked red carpet');
BoxFinder(stringArr, 288, 226, 25, 6000, 8000);
writeln('found traverse cliff');
BoxFinder(stringArr, 288, 226, 35, 10800, 11600);
writeln('clicked scale cathedral');
BoxFinder(stringArr, 288, 226, 25, 8000, 9500);
BoxFinder(stringArr, 250, 193, 12, 8000, 9500);
writeln('slid line');
BoxFinder(stringArr, 318, 180, 8, 6000, 7500);
mainLoopIterations := mainLoopIterations + 1;
end
//elementary failsafe, ends script if you havent gained xp in too long
function failSafeCheck(): boolean;
begin
if not isLoggedIn then
exit(true);
if mainLoopIterations < 10 then
exit(true);
if oldxp = currentxp then
repeats := repeats + 1
else
repeats := 0;
if repeats > 10 then
begin
writeLn('gained no xp for at least 10 iterations, something is wrong)');
exit(false)
end
else
exit(true);
end
//13% chance to check your agility xp after a lap
procedure antiban();
begin
if not isLoggedIn then
exit;
if not gameTabs.isTabActive(TAB_BACKPACK) then
exit;
if random(100) > 87 then
hoverSkill(SKILL_AGILITY);
end
begin
clearDebug();
DeclarePlayers;
setupSRL();
DisableSRLDebug := True;
smartEnableDrawing := true;
setupMyVariables();
repeat
if not IsLoggedIn then
begin
if not Players[0].Login then
TerminateScript;
MainScreen.SetAngle(MS_ANGLE_HIGH);
MiniMap.setAngle(MM_DIRECTION_SOUTH);
end;
mainLoop();
progressReport();
antiban();
if not failSafeCheck then
TerminateScript;
until (False);
Exit;
end.
Download (if you don't just want to paste the above in):[ATTACH=CONFIG]24922[/ATTACH]