SRL Archive - First Scripts

RyGuy's Advanced Gnome Agility


RyGuy

2011-12-30 22:59:21

MOVED TO AGILITY SCRIPTS SECTION, ANY NEW UPDATES WILL BE ONLY THERE
Link: http://villavu.com/forum/showthread.php?t=72785





RyGuy's Advanced Gnome Agility!


STATUS: Working!!!

About This Script.

This is my first script. I know it has it's bugs that need to be worked out, but i thought i'd get an initial release out to see what you guys thought. EDIT: Not many bugs left, if you find any please post them!

You can begin running the course at level 85 agility, however you have a chance at failing the signpost until level 89. There is no support for failing the signpost as i did not have an account with a low enough agility to test it. EDIT: However, the way i have it coded, the script may work with failing the signpost, just a bit slower. If you have 85-88 agility please test it and let me know :)

So, if you have 89+ agility try out my script, and let me know what you think. I'm very open to suggestions!

Start it at the log balance, and please babysit! Not really needed anymore


Make sure Game Chat is set to All!

Versions

0.10 - Initial Release

0.15 - Some small changes made

0.20 - Finds Branch#2 much better than before
- Worked on some standards
- More Stable than previous versions

0.30 - SPS added to walk back to beginning
- Failsafes added

0.35 - Changed a DTM that would fail occasionally

0.50 - Rewrote most parts of the script to try making it more reliable. I think i was successful for the most part :P

0.60 - Fixed the barrier

0.70 - Fixed the first branch

0.80 - Added time running, xp, and xp/h

Known Bugs:
- Occasionally fails to detect when successfully completes log

Time: 41 Minutes and 0 Seconds
Laps done: 47
Exp Gained: 34075
Exp/Hr: 49865

program AdvancedGnomeAgility;
//////////////////////////WRITTEN BY RYGUY//////////////////////////////

////////////////////////////VERSION 0.80////////////////////////////////
{$DEFINE SMART}
{$DEFINE SRL5}
{$loadlib sps}
{$i SRL/srl.simba}
{$i sps/sps.simba}

var
Log, Branch1, Branch2, Post, Hurdle, TimeBegan, StartingXP: integer;
aFound: extended;

///////////////////////////PLAYER SETUP//////////////////////////////////
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active:=True;
end;
////////////////////DO NOT TOUCH BELOW THIS LINE/////////////////////////



procedure SetDTMs;
begin
Log := DTMFromString('mlwAAAHicY2dgYFBjZGDgB2JpINYEYkUgVgViHSDeDJQ/BsSbgHgVEM8A4lNAvA2IixwFGHLiFRkKHPgZ0qz4GLwtxRnCnaQYcuz4GdiA8rgwIx4MBQAxWws7');
Branch1 := DTMFromString('mbQAAAHicY2VgYNBjZGBQAmILIPYC4kQgngMUnwnEM5BwfqgSQ02KOUNxjDFDfqQhmOYHinOhYUYsGAwAfOwJcQ==');
Branch2 := DTMFromString('mKgEAAHic42NgYOACYm4g9gRiOyA2YYAAViDmAWIZIBYBYkGoOnaoHBsQS0BpmBl8UD0wdSA5RgYEAOlL91dg8LaWYkjykWdI8JID4yhXGYYYd1mGOA85huwgJYbMAEWGwnBlhvxQCAbp4QDqJQczkolRAQDIyg2R');
Hurdle := DTMFromString('mQwAAAHicY2ZgYJBlZGBQBmJtIK4A8quAuBKI/95dwfDr9jKG7zeWMHAB+TDMiISBAABdxglu');
Post := DTMFromString('mQwAAAHicY2aAAA4g5oRiaajYxj4/hu6uVoaSknwGNiAfhhmRMBAAAKdUBMw=');
end;



procedure FreeDTMs;
begin
FreeDTM(Log);
FreeDTM(Branch1);
FreeDTM(Branch2);
FreeDTM(Hurdle);
FreeDTM(Post);
end;



procedure Report;
var
Exp, ExpHr, TimeRan: integer;
begin
TimeRan := (1+((GetSystemTime - TimeBegan) / 1000));
Exp := (GetXPBarTotal - StartingXP);
ExpHr := Round((Exp * 3600) / (TimeRan));
WriteLn('Time: ' + TimeRunning);
WriteLn('We have gained ' + IntToStr(Exp) + ' Agility Experience!');
WriteLn('We are gaining ' + IntToStr(ExpHr) + ' Agility Experience per Hour!');
end;




procedure AntiBan;
begin
if not(LoggedIn)then
Exit;
FindNormalRandoms;
LevelUpEx(True, True);
case Random(300)of
0: HoverSkill('Agility', false);
1: PickUpMouse;
2: RandomMovement;
3: RandomRClick;
end;
end;



procedure LogBalance;
var
x, y: integer;
begin
repeat
if FindDTMRotated(Log, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)then
WriteLn('Found Log');
Mouse(x, y, 5, 5, True);
Wait(500+random(50));
until(IsMoving);
while(IsMoving) do
WaitNone;
AntiBan;
end;



procedure ObstacleNet;
var
x, y: integer;
begin
x := MSCX;
y := MSCY;
if FindObjTPA(x, y, 466484, 5, 1, 50, 150, 200, ['over'])then
begin
ClickMouse2(True);
WriteLn('Found Net');
AntiBan;
Wait(4000+random(100));
end;
end;



procedure TreeBranch1;
var
x, y: integer;
begin
x := MSCX;
y := MSCY;
FindDTMRotated(Branch1, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)
Mouse(x, y, 4, 4, True);
if DidRedClick then
begin
WriteLn('Found Branch 1');
AntiBan;
SetAngle(SRL_ANGLE_LOW);
end;
end;



procedure TreeBranch2;
var
x, y: integer;
begin
if FindDTM(Branch2, x, y, MSX1, MSY1, MSX2, MSY2)then
Mouse(x, y, 4, 4, True);
WriteLn('Found Branch 2');
AntiBan;
Wait(3000+random(50));
end;



procedure Signpost;
var
x, y: integer;
begin
if FindDTMRotated(Post, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)then
Mouse(x, y, 4, 4, True);
WriteLn('Found Signpost');
AntiBan;
Wait(3000+random(50));
end;



procedure Pole;
var
x, y: integer;
begin
ClickNorth(SRL_ANGLE_NONE);
Wait(100+random(50));
if FindObjTPAMulti(x, y, [4541520, 2566185], 4, 1, 220, 7, 200, ['Swing'])then
ClickMouse2(True);
WriteLn('Found Pole');
AntiBan;
Wait(12000+random(100));
end;



procedure Barrier;
var
x, y: integer;
begin
if FindDTM(Hurdle, x, y, MSX1, MSY1, MSX2, MSY2)then
begin
MMouse(x, y, 3, 4);
ClickMouse2(True);
if DidRedClick then
begin
WriteLn('Found Barrier');
AntiBan;
Wait(6500+random(100));
Report;
end;
end;
end;



procedure BackToLog;
begin
repeat
case Random(3) of
0: SPS_WindWalk(Point(1736, 2910));
1: SPS_WindWalk(Point(1736, 2912));
2: SPS_WindWalk(Point(1734, 2910));
end;
WriteLn('Attempting To Run Back To Log')
until (IsMoving);
begin
MakeCompass('E');
SetAngle(SRL_ANGLE_HIGH);
end;
end;



procedure WhereAreWe;
var
x, y: integer;
begin

if FindDTMRotated(Log, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)then
begin
WriteLn('Trying Balence');
LogBalance;
end;

if FindBlackChatMessage('other')then
begin
WriteLn('Trying Net');
ObstacleNet;
end;

if FindBlackChatMessage('netting')then
begin
WriteLn('Trying First Branch');
TreeBranch1;
end;

if FindBlackChatMessage('above')then
begin
WriteLn('Trying Second Branch');
TreeBranch2;
end;

if FindDTMRotated(Post, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)then
begin
WriteLn('Trying Signpost');
Signpost;
end;

if FindColoredAreaTolerance(x, y, 6270424, MSX1, MSY1, MSX2, MSY2, 600, 5)then
begin
WriteLn('Trying Pole');
Pole;
end;

if FindDTM(Hurdle, x, y, MSX1, MSY1, MSX2, MSY2)then
begin
WriteLn('Trying Barrier');
Barrier;
end;

if FindColoredAreaTolerance(x, y, 10129284, MMX1, MMY1, MMX2, MMY2, 100, 10)then
begin
WriteLn('Trying Walk Back To Log')
BackToLog;
end;
end;



begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetUpSRL;
SPS_Setup(RUNESCAPE_SURFACE, ['4_7']);
ActivateClient;
DeclarePlayers;
LoginPlayer;
TimeBegan := GetSystemTime;
ToggleXPBar(True);
StartingXP := (GetXPBarTotal);
WriteLn('We are starting with ' + IntToStr(StartingXP) + ' xp');
ClickNorth(SRL_ANGLE_HIGH);
MakeCompass('E');
repeat
SetDTMs;
WhereAreWe;
FreeDTMs;
until(false);
end.

putonajonny

2011-12-31 09:58:51

You should paste it into the main body of the thread in
 tags.

You should work on your standards a bit:[SIMBA]
Wait(500+random(100));
until
IsMoving;
begin
MakeCompass('E');
Flag;
AntiBan;
Wait(1900+random(100));
end;
should be:

Wait(500+random(100));
until (IsMoving);
begin
MakeCompass('E');
Flag;
AntiBan;
Wait(1900+random(100));
end;
but that isn't really a big deal.


Here:
      x :=MSCX;
y :=MSCY;
if FindObjTPA(x, y, 932970, 10, 1, 40, 20, 300, ['across'])then
Why are you setting x and y then changing then on the third line without doing anything with them?

    ClickMouse2(True);
WriteLn('Attempting pole!');
Wait(50+random(50));
until
DidClick(True, 500);
On a laggy computer that DidClick might return false because of that wait, I would move the wait to the start of the loop.

Change this
WriteLn('Time: ' + TimeRunning);
to:
WriteLn('Time: ' + GetTimeRunning);
that way it nicely formats it into minutes and seconds for you.

It won't compile for me but I guess that is because you use SRL 5.

Overall good but you have no checks that you actually reached the end of an obstacle, you need to do this or it could go crazy

RyGuy

2011-12-31 11:18:21

Here:

x :=MSCX;
y :=MSCY;
if FindObjTPA(x, y, 932970, 10, 1, 40, 20, 300, ['across'])then
Why are you setting x and y then changing then on the third line without doing anything with them?


Doesn't setting x and y to the center of the screen make it search the center of the screen first? If i get rid of that in my TreeBranch1 procedure, it finds the colors on the left side of the screen first, but with them, it finds the branch first.

ClickMouse2(True);
WriteLn('Attempting pole!');
Wait(50+random(50));
until
DidClick(True, 500);
On a laggy computer that DidClick might return false because of that wait, I would move the wait to the start of the loop.


Ah i did not know this. Thanks! :) will remove when next version is uploaded.

Change this
WriteLn('Time: ' + TimeRunning);
to:
WriteLn('Time: ' + GetTimeRunning);


Tried that and got an error. Maybe it's SRL5?

Overall good but you have no checks that you actually reached the end of an obstacle, you need to do this or it could go crazy


Yeah, it happens sometimes. I'm not sure how to add checks though. Any advice on this is greatly appreciated!

Thank you for looking over my script!

onilika

2011-12-31 17:23:36

Elah! Nice to see an advanced gnome script! Now to get strange rock will be a piece of cake. well done! Hope to see improvements on the script!

~onilika

putonajonny

2012-01-01 10:13:01

From: RyGuy
Doesn't setting x and y to the center of the screen make it search the center of the screen first? If i get rid of that in my TreeBranch1 procedure, it finds the colors on the left side of the screen first, but with them, it finds the branch first.


This may well be true sorry.


Ah i did not know this. Thanks! :) will remove when next version is uploaded.
You are welcome



Tried that and got an error. Maybe it's SRL5?

Yeah maybe

LemonHaze

2012-01-01 15:10:55

maybe you can make a file of the script. I'll test it soon and post a proggy :)

RyGuy

2012-01-01 17:28:26

I'll have version 0.30 up soon.. uses sps to walk back to the log… helps a bug where it would not begin running :)

ministone28

2012-01-02 05:42:37

how do i paste so its not all on one line?

LemonHaze

2012-01-02 12:56:06

From: ministone28
how do i paste so its not all on one line?


same problem…
thats why you should make a file of it :)
E: thx for the file mate, I'll try this script tomorrow and will post a proggy.

RyGuy

2012-01-02 22:33:38

From: lordvolt
same problem…
thats why you should make a file of it :)
E: thx for the file mate, I'll try this script tomorrow and will post a proggy.


Np.. new one is version .30.. added some failsafes. still gets caught in a loop sometimes.. still trying to learn new methods and improve it. this script gets about 45-50k an hour as of right now

LemonHaze

2012-01-03 09:49:32

Exception in Script: Unable to find file 'SRL/srl.simba' used from ''
I need some help :p

RyGuy

2012-01-03 11:22:26

It uses SRL5.. how to convert is in the first post :)

LemonHaze

2012-01-03 12:19:53

From: RyGuy
It uses SRL5.. how to convert is in the first post :)


still doesn't work :(
It gives the same error.

Destined2bGreat

2012-01-08 12:45:34

EDIT: Errors fixed, will post proggies.

Suggestion: Humanlike camera movement. The 90 degree camera pivots look very botlike. Also fails to click next object very often.

parker yo

2012-01-09 15:54:38

I will test this out after i run out of runes at the livid farm xD
Will post any bugs, errors or compliments within the night.

parker yo

2012-01-09 16:58:37

I am getting this error and can't seem to fix it.

[Error] (67:10): Unknown identifier 'SPS_WindWalk' at line 66
Compiling failed.

Any suggestions? I've looked all over the forums and can't find what is exactly wrong with it.

RyGuy

2012-01-10 18:40:33

http://villavu.com/forum/showthread.php?t=70505&highlight=windwalk

RyGuy

2012-01-12 21:25:37

Version 0.50 is out! Rewrote most parts of the script. Took out the report because of how I wrote it. I plan on adding exp gained and xp/h using the xp counter, but i am not yet sure how to do this. Should be added in a later version. Try it out or check out the code and leave a comment!

Destined2bGreat

2012-01-14 23:08:07

This script really has trouble running longer than 1-5 laps. It will get stuck on an obstacle and keep trying to click in the wrong spot.

RyGuy

2012-01-16 02:44:17

From: Destined2bGreat
This script really has trouble running longer than 1-5 laps. It will get stuck on an obstacle and keep trying to click in the wrong spot.


Thank you for trying it out :) I've been doing a little bit more testing/tweaking on this script and the version that is on here mainly gets stuck at the barrier and the first tree branch. I've fixed the barrier issue, but i am still having trouble getting the first tree branch to work correctly. Looking for some advice on how to find it from anyone…otherwise i'll keep experimenting and see what i can come up with.

Destined2bGreat

2012-01-16 16:00:22

Those are the two obstacles id get stuck on, besides it repeating the log over and over.

RyGuy

2012-01-16 17:10:07

From: Destined2bGreat
Those are the two obstacles id get stuck on, besides it repeating the log over and over.


I haven't run into it repeating the log over and over, but it is probably a problem with finding the net. I'll mess around with the first branch and try to release a fix tonight, as im guessing people will want this with the skoll boots being released today.

Destined2bGreat

2012-01-17 00:07:55

Yeah I'm currently stuck using ape atoll with skoll lol.

RyGuy

2012-01-17 19:02:48

Version 0.70 up! Ran for 30 minutes and is stable! If using the skoll boots, the first time through will do the log balance twice because of the black chat message. Enjoy and post any bugs you find!

Destined2bGreat

2012-01-17 23:47:33

Too bad my skoll boots are already wasted :( Looking forward to trying this out, I hope it can be stable for multiple hours at a time.

RyGuy

2012-01-18 00:14:07

Been running for 3 hours straight now, no issues :) Need to add xp/h and possibly signpost failing support

Destined2bGreat

2012-01-18 11:26:04

Thanks a bunch for this. This will save me from doing ape atoll to 99 lol. Gave you some rep. I had one small problem where if the bot clicks the gnome trainer, it will stop.

RyGuy

2012-01-19 03:08:03

Version 0.80 up. Added time running, xp. and xp/h!

seraphim585

2012-02-26 09:46:19

i too am having some trouble with the SPS_WindWalk
any suggestions on how to fix it?
btw great script otherwise
i tried just cutting the "return to log" function and it ran beautifully =P