SRL Archive - First Scripts

Grim's GnomeAgility


Grimtoker

2011-12-20 20:24:06

This is my first script written with no previous scripting knowledge, so please be gentle with me! I wanted to create something that is not overly done such as Mining, Chopping etc so decided to try script the Gnome Agility Course. I would greatly appreciate any feedback/help with this, I'm trying to learn and become better.

It's an easy way to get level 1-35+ Agility on members accounts without doing all the repetitive clicking.
Current script works on my 24th Dec update. I'm pretty much done testing this for now as it's in a working state, although not perfect. Please post feedback and i'll try to keep updating it after christmas/new year.

********************************************
Grims Gnome Agility
********************************************
Script Ran For: 29 Minutes and 42 Seconds
********************************************

NOTE: It is advised to babysit if you're going to use this at the moment.

Updated v1.3:
Re-written procedures with TPA's to make them more reliable, this is now running pretty smoothly (currently watching it run for 30 minutes plus)
Multiple color/search/random timing tweaks to make it better, may still need a little tweaking!)

Update log:
Antiban, Antirandom [added]
Failsafes [added, possibly needs more?]
Progress Report [added]
Declare Players [added]
TPA's [added]
Suggestions/help please!

Enjoy! :)

program GrimsGnomeAgility;
{$I SRL/SRL/misc/smart.scar}
{$I SRL/SRL.scar}

//Start the script standing within a few squares of Balancing log
//Quiet world and minimal lag is best for this to work

var
x, y, i, Time, StartTime:Integer;
LoopBegin:Integer;ClickRed : Boolean;
MyTPA : TPointArray;
MyPoint : TPoint;

Const
NumbOfPlayers= 1;
StartPlayer= 0;
Version= '1.3';

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

Players[0].Name := 'name here';
Players[0].Pass := 'pass here';
Players[0].Active := True;
end;

procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end;

procedure ProgressReport;
begin
ClearDebug;
WriteLn('********************************************');
WriteLn(' Grims Gnome Agility');
WriteLn('********************************************');
WriteLn('Script Ran For: ' + TimeRunning);
WriteLn('********************************************');
end;

procedure AntiBan;
begin
case random(250) of //Increase number for less AntiBans
0: RandomRClick;
1: PickUpMouse;
2: HoverSkill('strength', False);
3: HoverSkill('attack', False);
4: HoverSkill('agility', False);
5: HoverSkill('thieving', False);
6: HoverSkill('constitution', False);
7: HoverSkill('mining', False);
8: ExamineInv;
end;
end;

procedure AntiRandoms;
begin
FindNormalRandoms;
end;


function RopeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.12);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 5140878, MSX1, MSY1, MSX2, MSY2, 9);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);

if (R >= 115) and (R <= 169) and (G >= 91) and (G <= 135) and (B >= 63) and (B <= 94) then
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 11.94) and (X <= 26.67) and (Y >= 11.72) and (Y <= 26.19) and (Z >= 6.47) and (Z <= 14.02) then
begin
Result := arC[i];
Break;
end;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Procedure Log;
Begin
SetAngle(True);
MarkTime(LoopBegin);
begin
FindColorsTolerance(MyTPA, 999018, 150, 129, 363, 272, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 5, 5);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(6500+Random(500));
WriteLn('Log done..');
Break;
end;
end;
end;
End;

Procedure Net;
Begin
FindColorsTolerance(MyTPA, 1064812, 118, 312, 158, 336, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 5, 5);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(4500+Random(500));
WriteLn('Net done..');
Break;
end;
end;
End;

Procedure BranchUp;
Begin
FindColorsTolerance(MyTPA, 2051430, 326, 180, 351, 207, 7);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 2, 2);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(4000+Random(500));
WriteLn('Branch up done..');
Break;
end;
end;
End;

Procedure Rope;
Begin
Mouse(456,157,10,10, true);
wait(2000 + random(500));
begin
FindColorsTolerance(MyTPA, 5733788, 283, 165, 307, 190, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 0, 0);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(6000+Random(500));
WriteLn('Rope walk done..');
Break;
end;
end;
end;
End;

Procedure BranchDown;
Begin
FindColorsTolerance(MyTPA, 1919327, 359, 202, 384, 221, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 5, 5);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(5500+Random(500));
WriteLn('Branch down done..');
Break;
end;
end;
End;

Procedure Net2;
Begin
SetAngle(False);
Wait(1500+Random(250));
begin
FindColorsTolerance(MyTPA, 932969, 277, 6, 307, 35, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 3, 3);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('net');
ClickRed := DidRedClick;
if ClickRed then
Wait(5000+Random(500));
WriteLn('Net2 done..');
Break;
end;
end;
end;
End;

Procedure Pipe;
Begin
FindColorsTolerance(MyTPA, 7763579, 235, 64, 286, 96, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 5, 5);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(6000+Random(500));
WriteLn('Pipe done..');
Break;
end;
end;
End;

Procedure WalkToStart;
Begin
FindNormalRandoms;
Mouse(576, 93, 2, 2, True);
SetAngle(True);
Wait(4000+Random(500));
WriteLn('Walk to start done.. Yay!');
End;


Begin
SetupLogin;
SetupSRL;
DeclarePlayers;
ActivateClient;
StartTime:= GetSystemTime;
Time := (GetSystemTime-StartTime);
repeat
MarkTime(LoopBegin);
Log;
Net;
BranchUp;
Rope;
BranchDown;
Net2;
Pipe;
WalkToStart;
ProgressReport;
if TimeFromMark(LoopBegin) > 90000 then
TerminateScript;
until(false);
End.

anyhow

2011-12-21 00:26:12

Nice^^
I'll try it later and let you know what happened

Im auz

2011-12-21 04:20:44

will test soon!

qingqinghd

2011-12-21 04:36:01

will test soon!

uz3

2011-12-21 09:13:34

Hmm, you based yours off finding objects instead of colors like mine, wish I knew about that before! Haha.

Also, before you Mouse(x, y, 5, 5, True); I'm pretty sure you should have MMouse(x,y,5,5);
So it would look like this

MMouse(x,y,5,5);
Mouse(x, y, 5, 5, True);

Doing that makes your mouse appear more human than without. Unless GetMousePos(x, y); makes it look human? I don't know, I've never tried…

You should possibly add your "waits" in your individual procedures instead of the main begin/end. It would be easier to read.

Here is a link to my gnome agility. It is currently down because it isn't working the way I want it to but I think I know the problem.
http://villavu.com/forum/showthread.php?t=68861
Not to be a thread jack but here is how I did mine (Script doesn't work fully anyway)
program Uz3sGnomeAgility;
{$include srl/srl/misc/smart.scar}
{$include srl/srl.scar}

var
x,y,lap,laps,exp,Tempx,Tempy: integer;


procedure TotalExp;
begin
laps:= lap + 1;
laps:= lap - 1;
exp:= lap * 86;
end;

procedure ProgressReport;
begin
ClearDebug;
WriteLn('--------------------------------------');
WriteLn(' Uz3s Gnome Agility v1.2.2');
WriteLn('--------------------------------------');
WriteLn('Script Ran For: ' + TimeRunning);
WriteLn('Laps: ' + IntToStr(laps));
WriteLn('Experience gained...'+ IntToStr(exp));
WriteLn('Multiply laps by .5 and add it to experience gained for real exp');
WriteLn('--------------------------------------');
end;

procedure AntiBan;
begin
case random(300) of //do a random number so it won't always perform the antiban
0: RandomRClick;
1: PickUpMouse;
2: RandomRClick;
3: HoverSkill('agility', False);
4: ExamineInv;
end;
end; //Antiban

procedure AntiRandoms;
begin
FindNormalRandoms; // Whenever this is called, the script will check to see if your character is in a random event
LampSkill := 'agility'; // If you set the script to choose an experience lamp from a random event box, it will use the exp on the woddcutting skill
LevelUp; // This is an Antiban procedure, but I find it more useful when called here because AntiRandoms is usually called more often than Antiban
end; //antirandoms

procedure LogBalance;
begin
MakeCompass('N');
repeat
wait(500 + random(100));
if (FindColorSpiralTolerance(x,y,732235, 182, 212, 360, 271, 3))
then
MMouse(x,y,3,5);
until (IsUpText('Log'));
begin
WriteLn('Walking across log balance!');
if (IsUpText('Log'))
then
Mouse(x,y,3,5, true);
if (FindColorSpiralTolerance(x,y,65278, msx1, msy1, msx2, msy2, 1)) // begin misclick failsafe (What I did here is it checks for when you don't click any object in particular so it gives you a yellow 'X' where you clicked. If I clicked on an object, it would be red)
then
repeat
WriteLn('Misclick, readjusting!');
wait(500 + random(100));
if (FindColorSpiralTolerance(x,y,998761, msx1, msy1, msx2, msy2, 5))
then
MMouse(x,y,5,5);
if (IsUpText('Log'))
then
Mouse(x,y,5,5, true);
until (IsUpText('Log')); // end misclick failsafe
wait(25 + random(50));
MakeCompass('S');
wait(1000 + random (255));
AntiRandoms;
AntiBan;
wait(3500+random(50));
end;
end;//Logbalance

procedure ObstacleNet1;
begin
repeat
wait(100 + random(50));
if (FindColorSpiralTolerance(x,y,2043192, 245, 37, 313, 50, 10))
then
MMouse(x,y,5,5);
until (IsUpText('net'));
begin
WriteLn('Climbing up obstacle net!');
if (IsUpText('net'))
then
Mouse(x,y,5,5, true);
MakeCompass('E');
wait(1000 + random (255));
MakeCompass('E');
AntiRandoms;
AntiBan;
wait(2500+random(100));
end;
end; //Obstacle Net

procedure ClimbBranchUp;
begin
repeat
wait(100 + random(50));
if (FindColorSpiralTolerance(x,y,1323328, 301, 140, 338, 290, 3))
then
MMouse(x,y,10,10);
until (IsUpText('branch'));
begin
WriteLn('Climbing up tree branch!');
if (IsUpText('branch'))
then
Mouse(x,y,5,5, true);
wait(500 + random (255));
MMouse(543,25,5,5);
Mouse(543,25,5,5, true);
AntiRandoms;
AntiBan;
wait(1500+random(100));
end;
end; // climb branch up

procedure BalancingRope;
begin
wait(100 + random(10));
if (FindColorSpiralTolerance(x,y,1255991, 495, 191, 511, 195, 3))
then
MMouse(x,y,5,3);
Mouse(x,y,5,3, true);
repeat
wait(3000 + random(100));
MMouse(304,196,10,1);
until (IsUpText('rope'));
begin
if (IsUpText('rope'))
then
repeat
wait(100 + random (50));
Mouse(304,196,5,0, true);
until(FindBlackChatMessage('carefully'));
WriteLn('Walking across rope!');
wait(500 + random (255));
end;
AntiRandoms;
AntiBan;

end; //obstacle rope

procedure ClimbBranchDown;
begin
repeat
wait(500 + random(100));
if (FindColorSpiralTolerance(x,y,2183786, 472, 192, 504, 208, 3))
then
MMouse(x,y,5,5);
until (IsUpText('branch'));
begin
WriteLn('Walking across log balance!');
if (IsUpText('branch'))
then
Mouse(x,y,5,5, true);
AntiRandoms;
AntiBan;
wait(2500+random(100));
end;
end;

procedure ObstacleNet2;
begin
repeat
wait(100 + random(50));
if (FindColorSpiralTolerance(x,y,2636103, 193, 26, 220, 40, 5))
then
MMouse(x,y,5,5);
until (IsUpText('net'));
begin
WriteLn('Climbing up obstacle net!');
if (IsUpText('net'))
then
Mouse(x,y,15,5, true);
wait(1000 + random (255));
AntiRandoms;
AntiBan;
wait(5000+random(100));
end;
end; //Obstacle Net 2

procedure ObstaclePipe;
begin
repeat
if (FindColorSpiralTolerance(x,y,855309, 126, 72, 178, 108, 5))
then
MMouse(x,y,5,5);
until (IsUpText('pipe'));
begin
WriteLn('Climbing in obstacle pipe!');
if (IsUpText('pipe'))
then
Mouse(x,y,10,5, true);
end;
begin
wait(500);
if (FindBlackChatMessage('is being used'))
then
WriteLn('Pipe in use, waiting!');
wait(1000 + random (100));
MMouse(256,132,15,15);
Mouse(x,y,5,5, true);
end;

wait(1500 + random (255));
lap:= lap + 1;
AntiRandoms;
AntiBan;
wait(4500+random(100));
MMouse(589,89,5,5);
Mouse(589,89,5,5, true);
end;

procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players, for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // Don't touch
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;// declare players

procedure SetupLogin;
begin
ClearDebug;
// Setting up SMART;
Smart_Server := 123;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer; // Logging in...
end; // setup login

begin //main function
SetupLogin;
SetupSRL;
DeclarePlayers;
ActivateClient;
repeat
LogBalance;
ObstacleNet1;
ClimbBranchUp;
BalancingRope;
ClimbBranchDown;
ObstacleNet2;
ObstaclePipe;
TotalExp
ProgressReport;
until(false)
end.//main function






Best of luck to you sir!

Grimtoker

2011-12-21 11:34:16

Thank you very much for sharing your code with me uz3, I was eager to see it but noticed it was not currently in your thread. Will play with it shortly and hopefully smooth out some flaws in my script with the help of yours.

Would be cool to chat and see how we can improve. PM or MSN me :)

putonajonny

2011-12-21 11:53:20

Try to think about fail safes, here:
Procedure Pipe;
Var
x, y, LoopBegin:Integer;

Begin
MarkTime(LoopBegin);
Repeat
FindObjEx(x, y, ['bstacle', 'ipe'], [7763579, 6645098, 8684938], 5, 50, 235, 64, 286, 96)
GetMousePos(x, y);
Mouse(x, y, 5, 5, True);
until (TimeFromMark(LoopBegin) > 250);
End;
You are going to spam click very quickly at lots of different locations on the Pipe for 0.25 seconds, if it can't find the pipe then it is stuck and if it does it is going to look very bot like, you then move onto the next procedure without checking if it succeeded, look into ObjectDTMs for checking location, if there is an ncp standing at the end of an obstacle that is wearing weirdly coloured clothes then maybe check for those colours.



Try using:
function DidRedClick: boolean;

for example:

Procedure Pipe;
Var
x, y, LoopBegin:Integer;
ClickRed : Boolean;

Begin
MarkTime(LoopBegin);
Repeat
FindObjEx(x, y, ['bstacle', 'ipe'], [7763579, 6645098, 8684938], 5, 50, 235, 64, 286, 96)
GetMousePos(x, y);
Mouse(x, y, 5, 5, True);
ClickRed := DidRedClick;
Wait(200+Random(100));
until ((TimeFromMark(LoopBegin) > 250) or ClickRed);
End;
This will make it stop after it finds that it clicks red

Grimtoker

2011-12-21 11:57:18

From: putonajonny
Try to think about fail safes, here:
Procedure Pipe;
Var
x, y, LoopBegin:Integer;

Begin
MarkTime(LoopBegin);
Repeat
FindObjEx(x, y, ['bstacle', 'ipe'], [7763579, 6645098, 8684938], 5, 50, 235, 64, 286, 96)
GetMousePos(x, y);
Mouse(x, y, 5, 5, True);
until (TimeFromMark(LoopBegin) > 250);
End;
You are going to spam click very quickly at lots of different locations on the Pipe for 0.25 seconds, if it can't find the pipe then it is stuck and if it does it is going to look very bot like, you then move onto the next procedure without checking if it succeeded, look into ObjectDTMs for checking location, if there is an ncp standing at the end of an obstacle that is wearing weirdly coloured clothes then maybe check for those colours.


Thanks for the feedback and I fully understand the problem you're pointing out, I will look into ObjectDTM's. At the moment it does not spam click because the loop is so small, definitely needs a failsafe or different approach though. I just highered the loop time when it was having difficulty finding the objects (so it would attempt more than once). Is there a better way for it to search multiple times?

putonajonny

2011-12-21 12:05:35

From: Grimtoker
Thanks for the feedback and I fully understand the problem you're pointing out, I will look into ObjectDTM's. At the moment it does not spam click because the loop is so small, definitely needs a failsafe or different approach though. I just highered the loop time when it was having difficulty finding the objects (so it would attempt more than once). Is there a better way for it to search multiple times?



btw have a look at my edit ;)

DarkCoder

2011-12-21 12:06:36

If I can grab sometime tonight I will test this, for future reference could you lose the gap between procedures, for example:


Procedure WalkToStart;

Begin
MoveMouse(579, 90);
Mouse(576, 93, 1, 1, True);
End;

Becomes…

Procedure WalkToStart;
Begin
MoveMouse(579, 90);
Mouse(576, 93, 1, 1, True);
End;

As it makes the script that tad bit more easier to read, but otherwise a very nice first script ;) keep up the good work!

Grimtoker

2011-12-21 12:21:36

New updated script thanks to the help of people posting above, updated the code in my OP. I think this new edit is much more reliable than it's beginning state now :)

One problem I'm having is that it's struggling to find the Rope, since it needs a very accurate click on a very small area. Any help here would be greatly appreciated. Although it does work.

Im auz

2011-12-22 00:42:33

Did a few runs, then just starts clicking off randomly..*sigh*

Grimtoker

2011-12-24 11:16:40

Ok! Updated my OP main code again. Script is working well enough now.

********************************************
Grims Gnome Agility
********************************************
Script Ran For: 29 Minutes and 42 Seconds
********************************************

It's still not perfect but it gets the job done. I'll probably start working on a Barbarian Course next for level 35+ Agility. Although I will try to update this one too as my scripting knowledge grows!

Please post feedback or suggestions and let me know how this new script goes for you :)

Dexx

2011-12-24 20:26:52

Hey mister :)
I found it got to the second net, clicked on the very top, and then decided to run awawy. dany know whats up w/ dat

Grimtoker

2011-12-24 21:26:16

From: Dexx
Hey mister :)
I found it got to the second net, clicked on the very top, and then decided to run awawy. dany know whats up w/ dat


Hey sorry for the inconvenience. I noticed this happened to me too when I was playing around with lowering the timings on the procedures to speed the laps up. I have now increased the wait times around that procedure in the main code, try again and hopefully that will fix it. Remember to use a world with little lag :)

Dexx

2011-12-24 22:14:01

From: Grimtoker
Hey sorry for the inconvenience. I noticed this happened to me too when I was playing around with lowering the timings on the procedures to speed the laps up. I have now increased the wait times around that procedure in the main code, try again and hopefully that will fix it. Remember to use a world with little lag :)


oh kay thanks mister

Pro v Pker

2011-12-26 15:00:22

I cannot see the download link?
Or i'm just blind?

Grimtoker

2011-12-26 15:02:35

From: Pro v Pker
I cannot see the download link?
Or i'm just blind?


There is no download link :) Cope/paste the code in the original post into your Simba and save/run.

EuphoriaRush

2011-12-26 15:14:50

Awesome, thanks. Good luck with making more scripts.

d34th20n

2011-12-26 15:46:56

little suggestion, make a adv option in setup like this kinda thing
  begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := ;
Integers[1] := 2; //1 for basic 2 for adv
end;

and then have
If Players[CurrentPlayer].Integers[1]= 1 Then

your script here

end;


and have

If Players[CurrentPlayer].Integers[1]= 2 Then

advanced script here

end;





i will be more than happy to get you the colours for advanced obsticles plus names for them, if you wish that is.




if you need anything just let me know through pm

TsterT

2012-01-05 08:14:54

Little late for the party, but here's my Proggy (I added in laps and xp)


********************************************
Grims Gnome Agility
********************************************
Script Ran For: 16 Minutes and 57 Seconds
Laps Made: 11
XP Gained: 946
********************************************
It messes up quite often when running to the start point. It would just click random places outside of the agility course, looking for the log, and even when not finding it, would output "Log done"

I ran it a few times, and averaged out at about 1 lap per minute. Longest it's gone for was 40minutes or so.

chelmid

2012-01-05 08:55:18

Could you add option to choose between easier and harder pipe obstacle?

Kajutsky

2012-01-06 07:17:58

barb agility would be beast!

hhhzzzarn

2012-01-13 16:56:54

It misclick after it crossed the robe and does not click on the tree to go down. I updated your script to SRL5 but search for "setangle" and i replaced the false with "set_angle_none" Maybe that is causing it?

program GrimsGnomeAgility;
{$I SRL/SRL/misc/smart.simba}
{$I SRL/SRL.simba}

//Start the script standing within a few squares of Balancing log
//Quiet world and minimal lag is best for this to work

var
x, y, i, Time, StartTime:Integer;
LoopBegin:Integer;ClickRed : Boolean;
MyTPA : TPointArray;
MyPoint : TPoint;

Const
NumbOfPlayers= 1;
StartPlayer= 0;
Version= '1.3';

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

Players[0].Name := 'name here';
Players[0].Pass := 'pass here';
Players[0].Active := True;
end;

procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end;

procedure ProgressReport;
begin
ClearDebug;
WriteLn('********************************************');
WriteLn(' Grims Gnome Agility');
WriteLn('********************************************');
WriteLn('Script Ran For: ' + TimeRunning);
WriteLn('********************************************');
end;

procedure AntiBan;
begin
case random(250) of //Increase number for less AntiBans
0: RandomRClick;
1: PickUpMouse;
2: HoverSkill('strength', False);
3: HoverSkill('attack', False);
4: HoverSkill('agility', False);
5: HoverSkill('thieving', False);
6: HoverSkill('constitution', False);
7: HoverSkill('mining', False);
8: ExamineInv;
end;
end;

procedure AntiRandoms;
begin
FindNormalRandoms;
end;


function RopeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.12);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 5140878, MSX1, MSY1, MSX2, MSY2, 9);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);

if (R >= 115) and (R <= 169) and (G >= 91) and (G <= 135) and (B >= 63) and (B <= 94) then
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 11.94) and (X <= 26.67) and (Y >= 11.72) and (Y <= 26.19) and (Z >= 6.47) and (Z <= 14.02) then
begin
Result := arC[i];
Break;
end;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Procedure Log;
Begin
SetAngle(SRL_ANGLE_HIGH);
MarkTime(LoopBegin);
begin
FindColorsTolerance(MyTPA, 999018, 150, 129, 363, 272, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 5, 5);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(6500+Random(500));
WriteLn('Log done..');
Break;
end;
end;
end;
End;

Procedure Net;
Begin
FindColorsTolerance(MyTPA, 1064812, 118, 312, 158, 336, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 5, 5);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(4500+Random(500));
WriteLn('Net done..');
Break;
end;
end;
End;

Procedure BranchUp;
Begin
FindColorsTolerance(MyTPA, 2051430, 326, 180, 351, 207, 7);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 2, 2);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(4000+Random(500));
WriteLn('Branch up done..');
Break;
end;
end;
End;

Procedure Rope;
Begin
Mouse(456,157,10,10, true);
wait(2000 + random(500));
begin
FindColorsTolerance(MyTPA, 5733788, 283, 165, 307, 190, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 0, 0);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(6000+Random(500));
WriteLn('Rope walk done..');
Break;
end;
end;
end;
End;

Procedure BranchDown;
Begin
FindColorsTolerance(MyTPA, 1919327, 359, 202, 384, 221, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 5, 5);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(5500+Random(500));
WriteLn('Branch down done..');
Break;
end;
end;
End;

Procedure Net2;
Begin
SetAngle(SRL_ANGLE_NONE);
Wait(1500+Random(250));
begin
FindColorsTolerance(MyTPA, 932969, 277, 6, 307, 35, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 3, 3);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('net');
ClickRed := DidRedClick;
if ClickRed then
Wait(5000+Random(500));
WriteLn('Net2 done..');
Break;
end;
end;
end;
End;

Procedure Pipe;
Begin
FindColorsTolerance(MyTPA, 7763579, 235, 64, 286, 96, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 5, 5);
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
if ClickRed then
Wait(6000+Random(500));
WriteLn('Pipe done..');
Break;
end;
end;
End;

Procedure WalkToStart;
Begin
FindNormalRandoms;
Mouse(576, 93, 2, 2, True);
SetAngle(SRL_ANGLE_HIGH);
Wait(4000+Random(500));
WriteLn('Walk to start done.. Yay!');
End;


Begin
SetupLogin;
SetupSRL;
DeclarePlayers;
ActivateClient;
StartTime:= GetSystemTime;
Time := (GetSystemTime-StartTime);
repeat
MarkTime(LoopBegin);
Log;
Net;
BranchUp;
Rope;
BranchDown;
Net2;
Pipe;
WalkToStart;
ProgressReport;
if TimeFromMark(LoopBegin) > 90000 then
TerminateScript;
until(false);
End.

Deophobic

2012-01-15 00:13:27

hhhzzzarn I love you right now Homo intended.

loser69

2012-01-15 00:23:57

nice.

Haro Der

2012-01-21 11:34:41

Exception in Script: Unable to find file 'SRL/SRL/misc/smart.scar' used from ''

honeyhoney

2012-01-21 11:46:53

From: uz3
Also, before you Mouse(x, y, 5, 5, True); I'm pretty sure you should have MMouse(x,y,5,5);
So it would look like this

MMouse(x,y,5,5);
Mouse(x, y, 5, 5, True);

Doing that makes your mouse appear more human than without. Unless GetMousePos(x, y); makes it look human? I don't know, I've never tried…


If I'm not mistaken…

(*
Mouse
~~~~~

.. code-block:: pascal

procedure Mouse(mousex, mousey, ranx, rany: Integer; button: variant);

Moves then clicks mouse (will only move if 'mouse_move' passed).

.. note::

by Mutant Squirrle, Harry

Example:

.. code-block:: pascal

*)
procedure Mouse(mousex, mousey, ranx, rany: Integer; button: variant);
begin
MMouse(mousex, mousey, ranx, rany);
Wait(60 + Random(30));
ClickMouse2(button);
Wait(50 + Random(50));
end;

Someone correct me if I'm wrong?