Simba Code:
program AdvanceBarbarianAgility;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Developer Log:
Original Author: Anyhow
Rewritten by: Failed4life
Johnnimms13
A hattip to [Nathan] for his skeleton of this script
--------------------------------------------------------------------------------
Version History:
0: Original by Anyhow
v1.0 - Initial Release
v1.01 - DTMs added, antiban fixed
v1.02 - Progress Report added! Thanks RyGuy for the help :)
v1.021 - Pie Support Added!
v1.022 - Bug fixes and SMART Paint added
v1.023 - New gap DMT, Pie Toggle Switch added
v1.03 - Customizable Hp checker, logs out if Hp is low
v1.031 - Bug Fixes
v1.04 - Code Overhaul
v1.05 - faster leaner code and more randomness. TY FootballJDS
v1.051 - more failsafes.
v1.06 - Multiple DTM's and better failsafes.
v1.07 - Standards, StatsGuise, Breaks, Report, ShortCuts, better Pie & Random Support.
v1.08 - Bug fixes from recent SRL updates.
v1.081 - Tweaks.
v1.082 - Tweaks.
v1.083 - Faster runs, Text file report, and tweaks.
-------------------------------------------------------------------------------
Instructions:
Use the Setup and position your player in the agility course by the ropes.
If you wish to use Summer Pies to boost your Agility level, have them in your
inventory.
Note: This Script requires atleast 85 agility to run with boosts, 90 to run
Without boosts, and 93+ to run without mistakes.
I don't recommend you run this with 85 without constant supervision.
The Report will save to simba/scripts apon termination, and will be named
ABBA_Report.Txt. This script is usable with the Script manager.
---------------------------------------SETUP-----------------------------------}
const
//User Options
SERVER = 23; //Replace with desired server number
Username = ''; //Enter your Username
Password = ''; //Enter your Password
Nickname = ''; //Enter 3-4 digits of your Username
Alert = 5; //How many times should it warn you?
SoundP = 'C:/Simba/Scripts/alert.wav'; // Alarm, use your own file, or the one provided
TakeBreaks = True; //Will you take breaks?
WhenBreakMin = 180; //won't take a break before this (In Minutes)
WhenBreakMax = 200; //Maximum time before a Break (In Minutes)
ar = True; //AntiRandom switch, turn of at your own risk.
amount = 100; //How much antiban? --> 5 (highest) <-> 200 (lowest)
PieLevel = 0; //What level would u like to eat a summer pie at? (0 to disable)
PLogOut = False; //True logs out when summer pies are gone
HP = 20; //LogsOut if below this percentage of HP
{-----------------------------------------------------------------------------}
var
x,y:LongInt;
loads, BreakTime, LogTime,
LedgeCount, PF, Sound:Integer;
aFound, EXP:Extended;
myPos: TPoint;
DTM: array [0..9] of integer;
procedure AntiBan;
begin
if not(LoggedIn)then
Exit;
case random(Amount) of
0: HoverSkill('Agility', false);
1: PickUpMouse;
3: RandomRClick;
//4: BoredHuman; Uncomment this at your own risk (moves camera)
//5: Wait(40000 + Random(1000)); This gives you a 'mini break' I just didn't like it.
end;
end;
procedure LogPlayer;
begin
WriteLn('********************************************************************');
WriteLn('Thank you for using Abba! Due to something wrong we are logging out');
WriteLn(' ABBA V 1.07 Johnnimms13, Failed4Life, Anyhow ' );
WriteLn('********************************************************************');
if Alert > 0 then
begin
WriteLn(' Sounding Alarm');
repeat
Playsound(SoundP);
IncEx(Sound, 1);
wait(1025);
until(Sound = Alert);
end;
SRLRandomsReport;
Logout;
TerminateScript;
end;
procedure SetDTMs;
begin
DTM[0] := DTMFromString('mbQAAAHicY2UAAkYGBn4gfgBk/gNiAyB7B5DezgChDwDxViDWUuVhqCtNAGNJMXYwnx8ojo4ZsWAwAAC5iwmk');
DTM[1] := DTMFromString('mWAAAAHicY2FgYHgBxM+h+BAQKzIyMIgDsQ4QqwLx4im9DH6+EgwW5oIMWooyDPxANciYEQ2DAADa9geo');
DTM[2] := DTMFromString('mbQAAAHicY2VgYLgIxLeA+DYQnwLinUDsxcjAEA/EwUAcAcRWQLx86UQGd2sxBj93U4Zkbx2GKeUhDPxAteiYEQsGAwBGHQtq');
DTM[3] := DTMFromString('mggAAAHicY2MAAkYGBm4g/g9kfgNiUSD7FZDeB8RzgHgBEM8H4iVAvAaIXczVGHLCbRmS/MzBOCPYmiElwIKBHyiHDTPiwBAAADIaDKM=');
DTM[4] := DTMFromString('mggAAAHicY2NgYKgD4kVA3AvE/UC8CohnAPEuIN4JxMeBeAUQHwDirUDcU+bHMKEygOHU0fUMTlY6DJ3FPgzNeZ4M/EA5bJgRB4YAAFk6EE0=');
DTM[5] := DTMFromString('mbQAAAHicY2VgYGBmZGB4A6RlGCFsFiC+DeQ/BuInQPwHiE8C8a6tCxm6S3wZ6jLdGG5d2cNwdk0RAz9QHB0zYsFgAAC8QA6x');
DTM[6] := DTMFromString('mggAAAHicY2NgYHBlZGCwBWIbIJYD4lwgbgbitUC59UC8EogrgPglEM8H4iAPc4bw0GCGmqoyhrXLixmig20ZfKzEGfiBctgwIw4MAQANxwzJ');
DTM[7] := DTMFromString('mggAAAHicY2NgYJBiZGAwBGIlINYG4u9AMTUgvRZIrwHio0A8CYgrgZgBKF5SlM8Q7mPFEOsuw+BkJMKwfmUJQ1qMCwMuwIgDQwAAl3MLPQ==');
DTM[8] := DTMFromString('mbQAAAHicY2VgYPjLyMBwCYhrgPglEL8H4hlA8UVA/B6IS4E4C4jd7dQZ9NXlGXh5eBhCfS0YPK0VGPiB4uiYEQsGAwAmrQpK');
DTM[9] := DTMFromString('mlwAAAHicY2dgYDgHxLuB+AWULcbIwHAdSB8EYl0g9gBidyCOBGJXIPYCYh8glpXkYDDSVGSw0FVl8HRzY7A31mJwt1Nn8HTQZOAHyuPCTHgwFAAAvJkLcA==');
end;
procedure StatsGuise(wat:String);
begin
//Ty YoHoJo
Status(wat);
Disguise(wat);
end;
procedure Report;
begin
ClearDebug;
Exp := (Loads * 740.7);
WriteLn('******************************************************************');
WriteLn(' AdvancedBarBarianAgility v1.07 by Johnnimms13 & Co.');
WriteLn('Time: ' + TimeRunning + ' Laps ' + IntToStr(Loads));
WriteLn('We have gained ' + ToStr(Round(Exp)) + ' Agility Experience!');
WriteLn('******************************************************************');
end;
function OnPole: Boolean;
begin
If FindColorTolerance(x, y, SRL_BlackColor, 627, 82, 627, 82, 15) then
result := True;
end;
procedure AntiRandoms;
begin
if ((not LoggedIn) or (ar = False) or (OnPole)) then
Exit;
FindNormalRandoms
AntiBan;
end;
procedure ResetBreakTimer;
begin
BreakTime := GetSystemTime + RandomRange((WhenBreakMin) * 60000, (WhenBreakMax) * 60000);
end;
procedure TakeBreak;
var //ty Inception
H, M, S, T, BreakFor: Integer;
begin
if (GetSystemTime >= BreakTime) and TakeBreaks then
begin
Logout;
BreakFor := RandomRange(10 * 60000, 25 * 60000); // Between 10-25 minutes
ConvertTime(BreakFor, H, M, S);
Writeln('Break for: ' + IntToStr(M)+ 'm:' + IntToStr(S)+ 's');
MarkTime(T);
Repeat
Wait(1000);
until (BreakFor < TimeFromMark(T))
LogInPlayer;
ResetBreakTimer;
Wait(4000);
FindNormalRandoms;
end;
end;
procedure EatPie;
var SPie, HPie, x, y: integer;
begin
if PieLevel > 0 then
begin
SPie := DTMFromString('mlwAAAHicY2dgYPjIxMDwFoi/I9FfgPgDEL9kZGB4xgih3wPxYyB+B8SPgDhLTxGOK9JMGVJCdRiyovQZov00GPiB5uLCjHgwFAAAE+UTaw==');
HPie := DTMFromString('mggAAAHicY2NgYHBhYmAwB2JHIHYCYmsg9gTiB0C5R0D8AojvAPFdIH4MxGGqUgyZkXoMEb7WDLkJtgwJQVoM5Rn+DPxAOWyYEQeGAAAW8Qy0');
if GetSkillInfo('agility', True) < (PieLevel+1) then
begin
StatsGuise('below 91 agility, trying to find pie');
if ExistsItemDTM(spie, x, y) then
begin
StatsGuise('found pie');
mouse(x, y, 2, 2, true);
end else
if ExistsItemDTM(hpie, x, y) then
begin
StatsGuise('found 1/2 pie');
mouse(x, y, 2, 2, true);
end else
begin
StatsGuise('no pies!')
if PLogOut = True then
begin
WriteLn('Logging out: Logout When Pies is ON');
logPlayer;
end;
end;
end else
begin
StatsGuise('No Pie for you!');
end;
freedtm(SPie);
FreeDtm(HPie);
end;
end;
function Wfloor:Integer;
begin
result:= 99;
if((FindColorTolerance(x,y,2247007,633,56,633,56,15) or
FindColorTolerance(x,y,2247007,629,52,629,52,15) or
FindColorTolerance(x,y,2247007,628,60,628,60,15) or
FindColorTolerance(x,y,2247007,634,51,634,51,15) or
FindColorTolerance(x,y,2247007,633,60,633,60,15) or
FindColorTolerance(x,y,2247007,629,49,629,49,15)) and
FindColorTolerance(x,y,395009,634,84,634,84,15) and
(PercentBlackMM > 95)) then
result:= 10;
if((FindColorTolerance(x,y,1655633,615,84,615,84,15) or
FindColorTolerance(x,y,1521998,621,57,621,57,15)) and
(PercentBlackMM > 95)) then
result:= 11;
if((FindColorTolerance(x,y,1853268,630,113,630,113,15) or
FindColorTolerance(x,y,1853268,636,116,636,116,15)) and (PercentBlackMM > 95)) then
result:= 12;
if(FindColorTolerance(x,y,4873321,530,184,530,184,15) and (PercentBlackMM > 95)) then
result:= 13;
if((FindColorTolerance(x,y,2180188,621,113,621,113,15) or
FindColorTolerance(x,y,2180188,625,114,625,114,15) or
FindColorTolerance(x,y,2180188,627,112,627,112,15) or
FindColorTolerance(x,y,2180188,622,113,622,113,15)) and
FindColorTolerance(x,y,393218,643,114,643,114,15) and
FindColorTolerance(x,y,393218,632,114,632,114,15) and
not(FindColorTolerance(x,y,4873321,530,184,530,184,15))and
(PercentBlackMM > 95)) then
result:= 14;
end;
function distanceTo(var point:TPoint): Extended;
var myLoc:TPoint;
begin
myLoc:= SPS_GetMyPos();
Result:= Distance(point.x, point.y, myLoc.x, myLoc.y);
end;
procedure sleepWhileMoving();
var t:Integer;
begin
t := 0;
while((PixelShift(IntToBox(MMCX-75, MMCY-75, MMCX+75, MMCY+75), 500) > 200) and (t < 7)) do
begin
StatsGuise('Sleeping '+tostr(t));
sleep(250+random(5))
t:=t+1;
end;
end;
procedure WBack;
begin
SPS_WalkToPos(Point(2045, 2430));
end;
function getLocation(): integer;
var First, Second, Third, Fourth, Fifth: TPoint;
begin
result := 0;
if (PercentBlackMM > 96) then
result := Wfloor()
else
begin
First := Point(2045, 2430); //Beginning Point
Second := Point(2045, 2445); //After swinging the rope
Third := Point(2005, 2460); //After log balancing
Fourth := Point(1995, 2475); //Before running up the wall
Fifth := Point(2015, 2430); //After Slide
if ((distanceTo(First) <= 6) and (myPos.y < 2435)) then
begin
result:=1;
exit;
end;
if (distanceTo(Second) <= 7) then
begin
result:=2;
exit;
end;
if (distanceTo(Third) <= 10) then
begin
result:=3;
exit;
end;
if (distanceTo(Fourth) <= 10) then
begin
result:=4;
exit;
end;
if (distanceTo(Fifth) <= 10) then
begin
result:=15;
exit;
end;
end;
end;
procedure handleObstacle(spot: integer);
begin
SetDTMs;
begin
case spot of
0:
begin
LedgeCount := 0;
StatsGuise('Walk to beginning');
WBack;
sleepWhileMoving();
end;
1:
begin
begin
if FindDTMRotated(DTM[0], x, y, 135, 135, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
StatsGuise('rope');
Mouse(x, y, 3, 3, True);
sleep(3000+random(175));
sleepWhileMoving();
end;
end
end;
2:
begin
StatsGuise('log');
if FindDTMRotated(DTM[1], x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 3, 3, True);
sleep(1900+random(150));
sleepWhileMoving();
end;
end;
{////////////////////////////////Added by Rice/////////////////////////////////}
3:
begin
StatsGuise('Going To Jump');
MakeCompass('280');
sleep(100 + random(50));
if FindDTMRotated(DTM[2], x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
MMouse(x, y, 0, 0);
wait(10)
clickmouse2(true);
flag;
sleep(3900 + random(50));
sleepWhileMoving();
ClickNorth(SRL_ANGLE_HIGH);
end;
end;
{//////////////////////////////////////////////////////////////////////////////}
4:
begin
StatsGuise('hitting plate');
if FindDTMRotated(DTM[3], x, y, 189, 132, 295, 218, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 3, 3, True);
sleep(3300+random(150));
sleepWhileMoving();
end
end;
10:
begin
IncEx(LedgeCount, 1);
WriteLn(ToStr(LedgeCount));
if LedgeCount > 20 then
begin
WriteLn('Sat at the Ledge too Long, Logging out');
LogPlayer;
end;
MMouse(205, 120, 3, 3);
wait(100 + random(25));
StatsGuise('Climb up Ledge');
if isUptextEx('all') then
begin
ClickMouse2(true);
sleep(4400+random(150));
sleepWhileMoving();
exit;
end
end;
11:
begin
LedgeCount := 0;
case random(5) of
1:
mmouse(142, 177, 3, 3);
2:
mmouse(134, 192, 3, 3);
3:
mmouse(160, 192, 3, 3);
4:
mmouse(147, 202, 3, 3);
5:
mmouse(132, 210, 3, 3);
end;
wait(100 + random(25));
if isuptext('pring') then
begin
StatsGuise('Firing Spring');
clickmouse2(true);
if DidRedClick then
begin
sleep(4600+random(150));
sleepWhileMoving();
end else
begin
WriteLn('blind spring Click Failed... trying first DTM');
if FindDTMRotated(DTM[5], x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 3, 3, True);
sleep(3000+random(150));
sleepWhileMoving();
end else
begin
WriteLn('Second spring DTM failed... Trying second');
if FindDTMRotated(DTM[4], x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 3, 3, True);
sleep(3000+random(150));
sleepWhileMoving();
end;
end;
end;
end;
end;
12:
begin
StatsGuise('Pole');
if FindDTMRotated(DTM[6], x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 0, 0, True);
sleep(2500+random(150));
sleepWhileMoving();
end else
begin
writeln('Pole 2');
if FindDTMRotated(DTM[7], x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 0, 0, True);
sleep(2500+random(150));
sleepWhileMoving();
end else
begin
If PF >= 10 then
LogPlayer;
IncEx(PF, 1);
exit;
end;
end;
end;
13:
begin
StatsGuise('Gap');
case random(3) of
1:
MMouse(267, 176, 5, 5);
2:
MMouse(276, 176, 5, 5);
3:
MMouse(267, 162, 5, 5);
end
PF := 0;
if isUptextEx('ump') then
begin
ClickMouse2(True);
wait(3000+random(100));
end else
exit;
end;
14:
begin
StatsGuise('WEEEEEE!');
IncEx(Loads, 1);
MMouse(330, 178, 10, 10);
wait(50 + random(50));
if isUptextEx('oof') then
begin
ClickMouse2(True);
wait(2500+random(100));
sleepWhileMoving;
wait(200 + random(100));
end;
end;
15:
begin
report;
if FindDTMRotated(DTM[8], x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
StatsGuise('ShortCut');
Mouse(x, y, 3, 3, True);
sleep(600+random(70));
MMouse(255, 185, 5, 5);
sleep(200+random(70));
sleepWhileMoving();
end else
begin
StatsGuise('SPS...');
WBack;
end;
end;
end;
end;
MarkTime(LogTime);
FreeDTMs(DTM);
end;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := Username;
Players[0].Pass := Password;
Players[0].Nick := Nickname;
Players[0].Active := True;
end;
procedure LogMeIn;
begin
LoginPlayer;
end;
{//////////////////////////////////Main Loop///////////////////////////////////}
begin
Smart_Server := SERVER;
Smart_Members := True;
SetupSRL;
DeclarePlayers;
SPS_Setup(RUNESCAPE_SURFACE, ['4_5','4_6']);
ResetBreakTimer;
if not(LoggedIn) then
LogMeIn;
while not(LoggedIn) do
sleep(1000);
ClickNorth(SRL_ANGLE_HIGH);
while(true) do //Main loop
begin
while not(LoggedIn) do
LoginPlayer;
EatPie; // if 93+ agility comment this line to speed up your script.
TakeBreak; // Same if not breaking
AntiRandoms;// Ditto.
handleObstacle(getLocation());
myPos := SPS_GetMyPos();
if TimeFromMark(LogTime) > 100000 Then
begin
WriteLn('Idle Too Long');
LogPlayer;
end;
end;
end.