Ok got the barbarian course coded in. If you want to run it just start where you would of finished the course(bottom of slide), with camera facing south. 93+ agility only!!!
program BroteinAdvAgile;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
var
X, Y, MMDTM, Obstacle, FailCount : Integer;
XpGained, XpHour, SecondS : Extended;
////////////////////////////////////////////////////////////////////////////////
// Change Constants Here //
////////////////////////////////////////////////////////////////////////////////
const
WHICH_COURSE = 1; //0 = Gnome, 1 = Barbarian
DEBUG_SCRIPT = true; //Enable if you are having issues running script
DEBUG_COLORS = true; //Enable if you are having issues running script
USE_ON_SCREEN = false; //Enable for onscreen progress report
TIMES_TO_FAIL = 1000; //Maximum times the script is allowed to fail before logging out
START_OBSTACLE = 0; //0=log, 1=net, 2=branch1, 3=branch2, 4=sign, 5=post, 6=barrier
//ACA Settings for Log Obstacle
LOG_COLOR = 3164767;
LOG_TOL = 17;
LOG_HUE = 0.06;
LOG_SAT = 0.13;
//ACA Settings for Net Obstacle
NET_COLOR = 4282995;
NET_TOL = 13;
NET_HUE = 0.11;
NET_SAT = 5.49;
//ACA Settings for Branch1 Obstacle
BRANCH1_COLOR = 3821149;
BRANCH1_TOL = 22;
BRANCH1_HUE = 0.04;
BRANCH1_SAT = 0.47;
//ACA Settings for Bracnh2 Obstacle
BRANCH2_COLOR = 2900821;
BRANCH2_TOL = 11;
BRANCH2_HUE = 0.05;
BRANCH2_SAT = 0.19;
//ACA Settings for Sign Obstacle
SIGN_COLOR = 6401217;
SIGN_TOL = 7;
SIGN_HUE = 0.32;
SIGN_SAT = 4.33;
//ACA Settings for Pole Obstacle
POLE_COLOR = 4016464;
POLE_TOL = 18;
POLE_HUE = 0.06;
POLE_SAT = 0.06;
//ACA Settings for Barrier Obstacle
BARRIER_COLOR = 5343664;
BARRIER_TOL = 17;
BARRIER_HUE = 0.07;
BARRIER_SAT = 5.38;
//ACA Settings for Rope Swing Obstacle
ROPE_SWING_COLOR = 207409;
ROPE_SWING_TOL = 5;
ROPE_SWING_HUE = 0.22;
ROPE_SWING_SAT = 1.37;
//ACA Settings for Log Blanace Obstacle
LOG_BALANCE_COLOR = 2239808;
LOG_BALANCE_TOL = 8;
LOG_BALANCE_HUE = 0.12;
LOG_BALANCE_SAT = 0.28;
//ACA Settings for Wall Run Obstacle
WALL_RUN_COLOR = 10149862;
WALL_RUN_TOL = 15;
WALL_RUN_HUE = 0.05;
WALL_RUN_SAT = 2.65;
//ACA Settings for Wall Climb Obstacle
WALL_CLIMB_COLOR = 3757934;
WALL_CLIMB_TOL = 11;
WALL_CLIMB_HUE = 0.06;
WALL_CLIMB_SAT = 0.10;
//ACA Settings for Spring Obstacle
SPRING_COLOR = 12247530;
SPRING_TOL = 18;
SPRING_HUE = 0.20;
SPRING_SAT = 2.60;
//ACA Settings for Balance Beam Obstacle
BALANCE_BEAM_COLOR = 8029064;
BALANCE_BEAM_TOL = 13;
BALANCE_BEAM_HUE = 0.21;
BALANCE_BEAM_SAT = 0.14;
//ACA Settings for Jump Obstacle
JUMP_COLOR = 2118252;
JUMP_TOL = 1;
JUMP_HUE = 0.15;
JUMP_SAT = 0.77;
//ACA Settings for Slide Obstacle
SLIDE_COLOR = 4875636;
SLIDE_TOL = 12;
SLIDE_HUE = 0.06;
SLIDE_SAT = 0.46;
//ACA Setting for Xp Drop/Popup
XP_COLOR = 4040932;
XP_TOL = 2;
XP_HUE = 0.13;
XP_SAT = 2.79;
////////////////////////////////////////////////////////////////////////////////
// Set up your Character info here!!! //
////////////////////////////////////////////////////////////////////////////////
procedure declarePlayers;
begin
setLength(players, 1);
with players[0] do
begin
loginName := ''; //Set username here
password := ''; //Set password here
bankPin := ''; //Set PIN here
world := 1; //Set world here
isActive := true;
isMember := true;
end
currentPlayer := 0;
end;
////////////////////////////////////////////////////////////////////////////////
// Script starts here, Setup Complete! //
////////////////////////////////////////////////////////////////////////////////
// @ Procedure printStatus
// * Used for debugging our script to a log by using print
// * Will draw progress report at all times, and only progress report if we
// are not using the DEBUG_SCRIPT constant.
procedure printStatus(Jamc : String; PrintType : Integer);
begin
if DEBUG_SCRIPT then
begin
if PrintType = 0 then
print(Jamc, TDebug.SUB);
if PrintType = 1 then
print(Jamc, TDebug.HEADER);
if PrintType = 2 then
print(Jamc, TDebug.SUB);
if PrintType = 3 then
print(Jamc, TDebug.FOOTER);
if PrintType = 4 then
print(Jamc, TDebug.ERROR);
if PrintType = 5 then
writeLn(Jamc);
end;
if not DEBUG_SCRIPT then
begin
if PrintType = 0 then
writeLn(Jamc);
end;
end
// @ Procedure takeScreen by Olly
// * Saves a screenshot and blurs out info, safe for upload
procedure takeScreen(Reason : String);
procedure blur(Bmp, Xs, Ys, Xe, Ye: Integer);
var
BmpCopy, Tmp: Integer;
begin
BmpCopy := copyBitmap(Bmp);
cropBitmap(BmpCopy, Xs, Ys, Xe, Ye);
Tmp := convoluteBitmap(BmpCopy, gaussMatrix(6, 3.00));
fastDrawTransparent(Xs, Ys, Tmp, Bmp);
freeBitmaps([BmpCopy, Tmp]);
end;
var
BmpClient, W, H, I: Integer;
Areas: TBoxArray;
begin
getClientDimensions(W, H);
BmpClient := bitmapFromClient(0, 0, W-1, H-1);
Areas := [[actionBar.x1, actionbar.y1, chatBox.x2, chatBox.y2], mainScreen.playerBox,
[tabBackpack.x1-4, tabBackpack.y2 - 40, tabBackpack.x2, tabBackpack.y2],
[mainScreen.x2 - 130, mainScreen.y1, mainScreen.x2, mainScreen.y1 + 75]];
for I := 0 to high(Areas) do
blur(BmpClient, Areas[i].x1, Areas[i].y1, Areas[i].x2, Areas[i].y2);
getMufasaBitmap(BmpClient).drawClippedText('Reason: ' + Reason + 'Time:' + theTime, point(chatBox.x1 + 5, chatBox.y2 - 16), StatChars, true, clLime);
saveBitmap(BmpClient, appPath + 'BroteinAdvAgile' + '.png');
debugBitmap(BmpClient);
freeBitmap(BmpClient);
end;
// @ Function getXP by Ashaman88
// * Gets XP in current xp counter on chat box.
function TRSChatBox.getXP: Integer;
var
B : TBox;
S : String;
TPA : TPointArray;
ATPA : T2DPointArray;
P : Integer;
begin
printStatus('TRSChatBox.getXP: Starting...', 1);
B := self.getBounds();
B.edit( +(B.x2 - B.x1) - 140, +10, -5, -94);
findColorsTolerance(TPA, 14013909, B, 4, colorSetting(2, 0.00, 0.00));
if length(TPA) < 2 then
begin
printStatus('chatBox.getXP(): No XP found', 2);
printStatus('TRSChatBox.getXP: Finished!', 3);
exit;
end;
ATPA := TPA.cluster(10);
ATPA.sortFromFirstPoint(point(B.x2, B.y2));
B := ATPA[low(ATPA)].getbounds;
B.edit(-2, -2, +2, +3);
S := Replace(tesseractgettext(B.x1, B.y1, B.x2, B.y2, FILTER_SMALL_CHARS), ' ', '', [rfReplaceAll]);
P := Pos('x', S);
if P > 0 then
Result := StrToIntDef(ExtractFromStr(Copy(S, P, Length(S)), Numbers), 0)
else
Result := StrToIntDef(ExtractFromStr(S, Numbers), 0);
printStatus('chatBox.getXP(): XP found: ' + tostr(result), 2);
printStatus('TRSChatBox.getXP: Finished!', 3);
end;
// @ Procedure setDTMs
// * Sets our DTM
// # MMDTM
procedure setDTMs
begin
MMDTM := DTMFromString('mWAAAAHicY2FgYBBhZWDgAmJRIBYD4jhGBoZsIM4H4gAg3jZFi6EhSYvhzdM+hhmdiQwaQD3ImBENgwAArpkI8w==');
end;
// @ Procedure releaseDTMs
// * Frees our DTM from memory
// # [MMDTM]
procedure releaseDTMs;
begin
freeDTMs([MMDTM]);
end;
// @ Procedure killScript
// * Kills our script
// # Reason used for Debug
procedure killScript(Reason : String);
begin
printStatus('killScript: Starting...', 0);
takeScreen(Reason);
if isLoggedIn then
players[currentPlayer].logout();
terminateScript;
printStatus('killScript: Finished! Script terminated at time: ' + theTime + ', Script ran for: ' + timeRunning + ', Stopped for reason: ' + Reason, 0);
end;
// @ Function timeRunningShort
// * Same as timeRunning, but uses TIME_SHORT constant
function timeRunningShort(TheType: Integer = TIME_SHORT): string;
begin
Result := msToTime(GetTimeRunning(), TheType);
end;
// @ Proecure progressReport
// * Will display our progress, and increments XpGained by obstacle XP
// # XpGained, XpHour, timeRunning, FailCount
procedure progressReport(IncAmount : Extended);
begin
if not DEBUG_SCRIPT then
clearDebug();
XpGained := XpGained + IncAmount;
SecondS := round((getTimeRunning/1000));
XpHour := round((3600 * XpGained) / (SecondS));
printStatus('*************Progress Report***************', 0);
printStatus('Time Running: ' + timeRunningShort, 0);
printStatus('XP Gained: ' + floatToStr(XpGained), 0);
printStatus('XP/Hour: ' + floatToStr(XpHour), 0);
printStatus('Times Failed: ' + intToStr(FailCount), 0);
printStatus('*******************************************', 0);
end;
// @ Procedure onScreenReport
// * Same as progressReport expect will draw most of the information onscreen
procedure onScreenReport(IncAmount : Extended);
var
ScreenProggy : Integer;
InfoPoints : TPointArray;
begin
progressReport(IncAmount);
if USE_ON_SCREEN then
begin
InfoPoints := [Point(245,509), Point(220,541), Point(442,541), Point(490,500), Point(4,447), Point(240 ,315)];
ScreenProggy := loadBitmap(appPath + 'AdvAgileProg.png');
smartImage.clear();
smartImage.drawBitmap(ScreenProggy, InfoPoints[4]);
smartImage.drawText(timeRunningShort, InfoPoints[0], UpChars, false, 1423591);
smartImage.drawText(floatToStr(XpGained), InfoPoints[1], BigChars, false, 1423591);
smartImage.drawText(floatToStr(XpHour), InfoPoints[2], BigChars, false, 1423591);
smartImage.drawText(intToStr(FailCount), InfoPoints[3], BigChars, false, 1423591);
freeBitmap(ScreenProggy);
end;
end;
// @ Procedure setUsUp
// * Does our intial setup stuff for script during startup
procedure setUsUp;
begin
printStatus('setUsUp: Starting...', 1);
clearDebug();
//autoUpdateMe;
if not DEBUG_SCRIPT then
disableSRLDebug := true;
smartEnableDrawing := true;
setupSRL;
setDTMs;
addOnTerminate('releaseDTMs');
declarePlayers;
Obstacle := START_OBSTACLE;
MouseSpeed := 50;
onScreenReport(0.0);
printStatus('setUsUp: Finished!', 3);
end;
// @ Procedure logUsIn
// * Logs in player when not logged in and closes Treasure popup
procedure logUsIn;
begin
printStatus('logUsIn: Starting...', 1);
if not isLoggedIn then
begin
players[currentPlayer].login();
exitTreasure();
if Obstacle = 0 then
begin
minimap.clickCompass();
mainscreen.setAngle(0);
mainscreen.setZoom(true);
end;
if Obstacle = 1 or Obstacle = 2 or Obstacle = 3 or Obstacle = 4 then
begin
minimap.setAngle(MM_DIRECTION_SOUTH);
mainscreen.setAngle(0);
mainscreen.setZoom(true);
end;
if Obstacle = 5 then
begin
minimap.setAngle(MM_DIRECTION_WEST);
mainscreen.setAngle(0);
mainscreen.setZoom(true);
end;
if Obstacle = 6 then
begin
minimap.clickCompass();
mainscreen.setAngle(0);
mainscreen.setZoom(true);
end;
end;
printStatus('logUsIn: Finished!', 3);
end;
// @ Function findObstacle
// * TPA finding function for the obstacles in our course.
// # ObColor, ObTol, ObCTS, ObHue, ObSat: Fill in with ACA(Color, Tolerance, ColorToleranceSpeed, Hue, Saturation)
// # ATPAW, ATPAH: Width and Height of ATPA
// # ObSort: 0 for sort ATPA by size, 1 for sort ATPA from midpoint(player)
// # RanX1, RanX2, RanY1, RanY2 : Used to set randomrange for point x,y randomness in ATPA
// # IndexLow, IndexHigh : Used for ATPA[i] search
// # SearchBox : Used to set search area
// # ObUpText : UpText for the object as a String Array
function findObstacle(ObColor, ObTol, ObCTS, ATPAW, ATPAH, ObSort, RanX1, RanX2, RanY1, RanY2, IndexLow, IndexHigh, EndWaitTime : Integer; ObHue, ObSat : Extended; SearchBox: TBox; ObUpText : TStringArray) : Boolean;
var
p : TPoint;
px, py, i : Integer;
ObTPA : TPointArray;
ObATPA : T2DPointArray;
begin
if not isLoggedIn then
exit;
printStatus('findObstacle: Starting...', 1);
printStatus('Looking for obstacle', 2);
if findColorsSpiralTolerance(px, py, ObTPA, ObColor, SearchBox, ObTol, colorSetting(ObCTS, ObHue, ObSat)) then
begin
ObATPA := ObTPA.toATPA(ATPAW, ATPAH);
ObATPA.filterBetween(0, 30);
if ObSort = 0 then
ObATPA.sortBySize(true);
if ObSort = 1 then
ObATPA.sortFromMidPoint(mainscreen.playerPoint);
if DEBUG_COLORS then
begin
smartImage.clear;
smartImage.debugTPA(ObTPA, true);
smartImage.debugATPA(ObATPA);
end;
for i := IndexLow to IndexHigh do
begin
p := middleTPA(ObATPA[i]);
p.offset(point(randomRange(RanX1, RanX1 + RanX2), randomRange(RanY1, RanY1 + RanY2)));
mouse(p.x, p.y, MOUSE_MOVE, MOUSE_HUMAN);
printStatus('Point we click on: ' + intToStr(p.x) + ', ' + intToStr(p.y), 2);
wait(randomRange(150, 175));
if isMouseOverText(ObUpText) then
begin
wait(150 + random(50));
fastClick(MOUSE_LEFT);
printStatus('Found Obstacle!', 2);
wait(randomRange(125, 250));
if DEBUG_COLORS then
smartImage.clear();
wait(random(250));
printStatus('Done Waiting', 2);
printStatus('findObstacle: Finished with result: ' + boolToStr(Result), 3);
Result := true;
exit;
end;
end;
wait(EndWaitTime + random(50));
end;
printStatus('findObstacle: Finished with result: ' + boolToStr(Result), 3);
end;
// @ Function checkXpDrop
// * Returns true when xp popup is found on mainscreen, times out at 15 seconds
function checkXpDrop : Boolean;
var
XpTPA : TPointArray;
Timer : TTimeMarker;
begin
if not isLoggedIn then
exit;
printStatus('checkXpDrop: Starting...', 1);
Timer.start;
repeat
if Timer.getTime > 15000 then
begin
printStatus('Waiting too long, increasing fail count',2);
printStatus('checkXpDrop: Finished with Result: ' + boolToStr(Result) + ', Fail Count: ' + intToStr(FailCount), 3);
inc(FailCount);
Timer.reset;
exit;
end;
printStatus('Waiting...', 2);
wait(randomRange(125, 250));
until(findColorsTolerance(XpTPA, XP_COLOR, intToBox(256, 0, 505, 303), XP_TOL, colorSetting(2, XP_HUE, XP_SAT)));
if DEBUG_COLORS then
begin
smartImage.clear;
smartImage.debugTPA(XpTPA, true);
end;
Timer.reset;
Result := true;
wait(randomRange(150, 225));
if DEBUG_COLORS then
smartImage.clear();
printStatus('checkXpDrop: Finished with Result: ' + boolToStr(Result), 3);
end;
// @ Function checkWaterMM
// * Returns true when water is found on minimap, times out at 5 seconds
function checkWaterMM : Boolean;
var
WaterTPA : TPointArray;
Timer : TTimeMarker;
begin
if not isLoggedIn then
exit;
printStatus('checkWaterMM: Starting...', 1);
Timer.start;
repeat
if Timer.getTime > 5000 then
begin
printStatus('Waiting too long, increasing fail count',2);
printStatus('checkWaterMM: Finished with Result: ' + boolToStr(Result) + ', Fail Count: ' + intToStr(FailCount), 3);
inc(FailCount);
Timer.reset;
exit;
end;
printStatus('Waiting...', 2);
wait(randomRange(125, 250));
until(findColorsTolerance(WaterTPA, 8088158, intToBox(732, 14, 794, 151), 10, colorSetting(2, 1.64, 1.93)));
Timer.reset;
Result := true;
wait(randomRange(150, 225));
if DEBUG_COLORS then
smartImage.clear();
printStatus('checkXpDrop: Finished with Result: ' + boolToStr(Result), 3);
end;
// @ Procedure runToStart
// * Stuff
procedure runToStart;
var
Timer : TTimeMarker;
begin
printStatus('runToStart: Starting...', 1);
printStatus('Looking for DTM...', 2);
if(findDTM(MMDTM, X, Y, miniMap.getBounds())) then
begin
Timer.start;
printStatus('Found DTM!', 2);
mouse(X, Y, MOUSE_MOVE, MOUSE_HUMAN);
fastClick(MOUSE_LEFT);
wait(randomRange(500, 750));
repeat
if Timer.getTime > 15000 then
begin
printStatus('Waiting too long, increasing fail count',2);
printStatus('runToStart: Finished with, Fail Count: ' + intToStr(FailCount), 3);
inc(FailCount);
Timer.reset;
exit;
end;
printStatus('Waiting until player stops running...', 2);
wait(randomRange(1000, 1500));
until(not minimap.isPlayerMoving());
end;
printStatus('runToStart: Finished!', 3);
end;
// @ Procedure doLog
// * Completes Log Obstacle
// # Sets camera to face south after clicking on obstacle
// # Increments Obstacle to 1
procedure doLog;
begin
if not isLoggedIn then
exit;
printStatus('doLog: Starting...', 1);
runToStart;
printStatus('Beginning Log Search', 2);
if findObstacle(LOG_COLOR, LOG_TOL, 2, 30, 70, 1, 1, 0, -50, 0, 2, 3, 750, LOG_HUE, LOG_SAT, mainScreen.getBounds(), ['og', 'ala', 'alance', 'Log']) then
begin
printStatus('Setting camera to face South', 2);;
minimap.setAngle(MM_DIRECTION_SOUTH);
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Net Obstacle', 2);
Obstacle := 1;
onScreenReport(7.5);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doLog: Finished', 3);
end;
// @ Procedure doNet
// * Completes Net Obstacle
// # Increments Obstacle to 2
procedure doNet;
begin
if not isLoggedIn then
exit;
printStatus('doNet: Starting...', 1);
printStatus('Beginning Net Search', 2);
if findObstacle(NET_COLOR, NET_TOL, 2, 160, 40, 0, 1, 0, 1, 0, 0, 2, 250, NET_HUE, NET_SAT, mainScreen.getBounds(), ['bstacle', 'net', 'Obstacle', 'Ob']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Branch1 Obstacle', 2);
Obstacle := 2;
onScreenReport(7.5);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doNet: Finished', 3);
end;
// @ Procedure doBranch1
// * Completes First Branch Obstacle
// # Increments Obstacle to 3
procedure doBranch1;
begin
if not isLoggedIn then
exit;
printStatus('doBranch1: Starting...', 1);
printStatus('Beginning Branch1 Search', 2);
if findObstacle(BRANCH1_COLOR, BRANCH1_TOL, 2, 50, 70, 1, 0, 0, 0, 0, 0, 2, 250, BRANCH1_HUE, BRANCH1_SAT, intToBox(162, 77 , 371, 222), ['ree', 'branch', 'Tree', 'Tre']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Branch2 Obstacle', 2);
Obstacle := 3;
onScreenReport(5.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doBranch1: Finished', 3);
end;
// @ Procedure doBranch2
// * Completes Second Branch Obstacle
// # Increments Obstacle to 4
procedure doBranch2;
begin
if not isLoggedIn then
exit;
printStatus('doBranch2: Starting...', 1);
printStatus('Beginning Branch2 Search', 2);
if findObstacle(BRANCH2_COLOR, BRANCH2_TOL, 2, 10, 40, 1, 0, 0, 0, 0, 1, 3, 250, BRANCH2_HUE, BRANCH2_SAT, intToBox(189, 102, 333, 190), ['ree', 'Tree', 'Tre']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Sign Obstacle', 2);
Obstacle := 4;
onScreenReport(25.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doBranch2: Finished', 3);
end;
// @ Procedure doSign
// * Completes Sign Obstacle
// # Sets camera to face east after clicking on obstacle
// # Increments Obstacle to 5
procedure doSign;
begin
if not isLoggedIn then
exit;
printStatus('doSign: Starting...', 1);
printStatus('Beginning Sign Search', 2);
if findObstacle(SIGN_COLOR, SIGN_TOL, 2, 15, 40, 1, 1, 0, 1, 0, 0, 1, 250, SIGN_HUE, SIGN_SAT, mainScreen.getBounds(), ['ign', 'post', 'Sign', 'Signpost']) then
begin
printStatus('Setting camera to face East', 2);
minimap.setAngle(MM_DIRECTION_WEST);
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Pole Obstacle', 2);
Obstacle := 5;
onScreenReport(25.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doSign: Finished', 3);
end;
// @ Procedure doPole
// * Completes Pole Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 6
procedure doPole;
begin
if not isLoggedIn then
exit;
printStatus('doPole: Starting...', 1);
printStatus('Beginning Pole Search', 2);
if findObstacle(POLE_COLOR, POLE_TOL, 2, 30, 200, 0, 1, 0, 1, 0, 0, 1, 250, POLE_HUE, POLE_SAT, mainScreen.getBounds(), ['ole', 'Pole', 'Pol']) then
begin
printStatus('Setting camera to face North', 2);
minimap.clickCompass();
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Barrier Obstacle', 2);
Obstacle := 6;
onScreenReport(25.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doPole: Finished', 3);
end;
// @ Procedure doBarrier
// * Completes Barrier Obstacle
// # Sets camera to face north(high) after clicking on obstacle
// # Resets Obstacle to 0
procedure doBarrier;
begin
if not isLoggedIn then
exit;
printStatus('doBarrier: Starting...', 1);
printStatus('Beginning Barrier Search', 2);
if findObstacle(BARRIER_COLOR, BARRIER_TOL, 2, 40, 40, 0, 1, 0, 1, 0, 0, 2, 250, BARRIER_HUE, BARRIER_SAT, intToBox(206, 106, 330, 192) , ['arr', 'arrier', 'Barrier', 'Bar']) then
begin
printStatus('Setting camera to face North High', 2);
mainscreen.setAngle(0);
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Log Obstacle', 2);
Obstacle := 0;
onScreenReport(25.0);
end
else if checkWaterMM then
begin
printStatus('Water found on MiniMap, moving onto Log Obstacle', 2);
Obstacle := 0;
onScreenReport(25.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doBarrier: Finished', 3);
end;
// @ Procedure doRopeSwing
// * Completes Rope Swing Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 1
procedure doRopeSwing;
begin
if not isLoggedIn then
exit;
printStatus('doRopeSwing: Starting...', 1);
printStatus('Beginning Rope Swing Search', 2);
if findObstacle(ROPE_SWING_COLOR, ROPE_SWING_TOL, 2, 30, 200, 0, 1, 0, 1, 0, 1, 2, 250, ROPE_SWING_HUE, ROPE_SWING_SAT, mainScreen.getBounds(), ['wing', 'Swing', 'On']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Log Balance Obstacle', 2);
Obstacle := 1;
onScreenReport(22.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doRopeSwing: Finished', 3);
end;
// @ Procedure doRopeSwing
// * Completes Rope Swing Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 2
procedure doLogBalance;
begin
if not isLoggedIn then
exit;
printStatus('doLogBalance: Starting...', 1);
printStatus('Beginning Log Balance Search', 2);
if findObstacle(LOG_BALANCE_COLOR, LOG_BALANCE_TOL, 2, 20, 20, 1, 1, 0, 1, 0, 0, 1, 250, LOG_BALANCE_HUE, LOG_BALANCE_SAT, mainScreen.getBounds(), ['alk', 'across', 'Walk', 'Log', 'og', 'balance']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Wall Jump Obstacle', 2);
Obstacle := 2;
onScreenReport(13.7);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doLogBalance: Finished', 3);
end;
// @ Procedure doWallRun
// * Completes Wall Run Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 3
procedure doWallRun;
begin
if not isLoggedIn then
exit;
printStatus('doWallRun: Starting...', 1);
printStatus('Beginning Wall Run Search', 2);
if findObstacle(WALL_RUN_COLOR, WALL_RUN_TOL, 2, 30, 50, 0, 1, 0, 1, 0, 0, 1, 250, WALL_RUN_HUE, WALL_RUN_SAT, mainScreen.getBounds(), ['un', 'Run', 'up', 'Wall']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Wall Climb Obstacle', 2);
Obstacle := 3;
onScreenReport(13.7);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doWallRun: Finished', 3);
end;
// @ Procedure doWallClimb
// * Completes Wall Climb Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 4
procedure doWallClimb;
begin
if not isLoggedIn then
exit;
printStatus('doWallClimb: Starting...', 1);
printStatus('Beginning Wall Climb Search', 2);
if findObstacle(WALL_CLIMB_COLOR, WALL_CLIMB_TOL, 2, 30, 60, 1, 1, 0, 1, 0, 0, 1, 250, WALL_CLIMB_HUE, WALL_CLIMB_SAT, intToBox(311, 185, 342, 251), ['limb', 'Climb', 'up', 'Wall']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Spring Obstacle', 2);
Obstacle := 4;
onScreenReport(15.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doWallClimb: Finished', 3);
end;
// @ Procedure doSpring
// * Completes Spring Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 5
procedure doSpring;
begin
if not isLoggedIn then
exit;
printStatus('doSpring: Starting...', 1);
printStatus('Beginning Spring Search', 2);
if findObstacle(SPRING_COLOR, SPRING_TOL, 2, 80, 60, 0, 1, 0, 1, 0, 0, 0, 250, SPRING_HUE, SPRING_SAT, intToBox(324, 137, 424, 242), ['ire', 'Fire', 'Spring', 'Device']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Barrier Obstacle', 2);
Obstacle := 5;
onScreenReport(15.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doSpring: Finished', 3);
end;
// @ Procedure doBalanceBeam
// * Completes Balance Beam Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 6
procedure doBalanceBeam;
begin
if not isLoggedIn then
exit;
printStatus('doBalanceBeam: Starting...', 1);
printStatus('Beginning Balance Beam Search', 2);
if findObstacle(BALANCE_BEAM_COLOR, BALANCE_BEAM_TOL, 2, 15, 15, 1, 1, 0, 1, 0, 0, 1, 250, BALANCE_BEAM_HUE, BALANCE_BEAM_SAT, mainScreen.getBounds(), ['ross', 'Cross', 'Balance', 'beam']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Barrier Obstacle', 2);
Obstacle := 6;
onScreenReport(15.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doBalanceBeam: Finished', 3);
end;
// @ Procedure doJump
// * Completes Jump Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 7
procedure doJump;
begin
if not isLoggedIn then
exit;
printStatus('doJump: Starting...', 1);
printStatus('Beginning Jump Search', 2);
if findObstacle(JUMP_COLOR, JUMP_TOL, 2, 30, 30, 1, 1, 0, 1, 0, 0, 1, 250, JUMP_HUE, JUMP_SAT, mainScreen.getBounds(), ['ump', 'Jump', 'over', 'Gap']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Slide Obstacle', 2);
Obstacle := 7;
onScreenReport(15.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doJump: Finished', 3);
end;
// @ Procedure doSlide
// * Completes Slide Obstacle
// # Sets camera to face north after clicking on obstacle
// # Increments Obstacle to 0
procedure doSlide;
begin
if not isLoggedIn then
exit;
printStatus('doSlide: Starting...', 1);
printStatus('Beginning Slide Search', 2);
if findObstacle(SLIDE_COLOR, SLIDE_TOL, 2, 50, 100, 0, 1, 0, 1, 0, 0, 1, 250, SLIDE_HUE, SLIDE_SAT, intToBox(213, 165, 245, 242), ['lide', 'Slide', 'down', 'Roof']) then
begin
printStatus('Waiting for XP drop', 2);
if checkXpDrop then
begin
printStatus('XP drop found, moving onto Rope Swing Obstacle', 2);
Obstacle := 0;
onScreenReport(15.0);
end
else
begin
inc(FailCount);
printStatus('No XP drop found, Fail Count: ' + intToStr(FailCount), 2);
end;
end
else
begin
inc(FailCount);
printStatus('Never found obstacle, Fail Count: ' + intToStr(FailCount), 2);
end;
printStatus('doSlide: Finished', 3);
end;
// @ Procedure doGnomeCourse
// * Checks fail count to see if we should log out, otherwise will complete course
procedure doGnomeCourse;
begin
if not isLoggedIn then
exit;
printStatus('doTheCourse: Starting...', 1);
printStatus('FailCount: ' + intToStr(FailCount), 2);
if FailCount > TIMES_TO_FAIL then
begin
printStatus('We failed too many times, logging out!', 2);
printStatus('doTheCourse: Finished!', 3);
killScript('Failed ' + intToStr(FailCount) + ' times');
end;
if Obstacle = 0 then
doLog;
if Obstacle = 1 then
doNet;
if Obstacle = 2 then
doBranch1;
if Obstacle = 3 then
doBranch2;
if Obstacle = 4 then
doSign;
if Obstacle = 5 then
doPole;
if Obstacle = 6 then
begin
doBarrier;
onScreenReport(605.0);
end;
printStatus('doTheCourse: Finished!', 3);
end;
// @ Procedure doBarbCourse
// * Checks fail count to see if we should log out, otherwise will complete course
procedure doBarbCourse;
begin
if not isLoggedIn then
exit;
printStatus('doTheCourse: Starting...', 1);
printStatus('FailCount: ' + intToStr(FailCount), 2);
if FailCount > TIMES_TO_FAIL then
begin
printStatus('We failed too many times, logging out!', 2);
printStatus('doTheCourse: Finished!', 3);
killScript('Failed ' + intToStr(FailCount) + ' times');
end;
if Obstacle = 0 then
doRopeSwing;
if Obstacle = 1 then
doLogBalance;
if Obstacle = 2 then
doWallRun;
if Obstacle = 3 then
doWallClimb;
if Obstacle = 4 then
doSpring;
if Obstacle = 5 then
doBalanceBeam;
if Obstacle = 6 then
doJump;
if Obstacle = 7 then
begin
doSlide;
onScreenReport(615.0);
end;
printStatus('doTheCourse: Finished!', 3);
end;
// @ Procedure doTheCourse
// * Takes contstant WHICH_COURSE to determine which course to complete
procedure doTheCourse;
begin
if WHICH_COURSE = 0 then
doGnomeCourse;
if WHICH_COURSE = 1 then
doBarbCourse;
end;
// @ Main Loop
// * Runs the course
begin
setUsUp;
repeat
logUsIn;
doTheCourse;
until(false);
releaseDTMs;
terminateScript;
end.
Just gotta go through and add in some setup stuff, and fix some errors and it's good to go.