SRL Archive - Archive

Grimtoker - SRL Member Application


Grimtoker

2011-12-21 23:36:05

How Long have You Played Runescape?
10 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Pascal


Are you a member of any other communities?
No


Tell us about yourself…
From: Grimtoker
I'm Tom, 22 and from the UK. My interests are gaming, surfing and recently scripting after countless hours and very late nights!! Hoping to become a member here and learn more to help the community further.



Please show us one (or multiple) of your scripts.
program GrimsGnomeAgility;
{$I SRL/SRL/misc/smart.scar}
{$I SRL/SRL.scar}

//Start the script standing within a few squares of Balancing log

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

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

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(40) of //Increase number for less AntiBans
0: RandomRClick;
1: PickUpMouse;
2: HoverSkill('strength', False);
3: HoverSkill('attack', False);
4: HoverSkill('agility', False);
5: 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);
Wait(6500+Random(500));
WriteLn('Log done..');
Break;
end;
end;
end;
End;

Procedure Net;
Begin
AntiRandoms;
AntiBan;
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);
Wait(6500+Random(500));
WriteLn('Net done..');
Break;
end;
end;
end;
End;

Procedure BranchUp;
Begin
AntiRandoms;
AntiBan;
begin
FindColorsTolerance(MyTPA, 1985893, 326, 180, 351, 207, 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);
Wait(6500+Random(500));
WriteLn('Branch up done..');
Break;
end;
end;
end;
End;

Procedure Rope;
Begin
MarkTime(LoopBegin);
if TimeFromMark(LoopBegin) > 60000 then
TerminateScript;
repeat
FindObjEx(x, y, ['alancing', 'ope'], [RopeColor], 10, 2, 436, 163, 452, 191);
until IsUpText('ope')
repeat
wait(250);
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
Wait(200+Random(100));
until ClickRed;
Wait(6000+Random(500));
WriteLn('Rope walk done..');
End;

Procedure BranchDown;
Begin
AntiRandoms;
AntiBan;
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);
Wait(4500+Random(500));
WriteLn('Branch down done..');
Break;
end;
end;
end;
End;

Procedure Net2;
Begin
SetAngle(False);
wait(750+Random(250));
begin
FindColorsTolerance(MyTPA, 998762, 306, 39, 325, 84, 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);
Wait(6500+Random(500));
WriteLn('Net2 done..');
Break;
end;
end;
end;
End;

Procedure Pipe;
Begin
AntiRandoms;
AntiBan;
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);
Wait(6500+Random(500));
WriteLn('Pipe done..');
Break;
end;
end;
end;
End;

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


Begin
SetupLogin;
SetupSRL;
DeclarePlayers;
ActivateClient;
StartTime:= GetSystemTime;
Time := (GetSystemTime-StartTime);
repeat
Log;
Net;
BranchUp;
Rope;
BranchDown;
Net2;
Pipe;
WalkToStart;
ProgressReport;
until(false);
End.

RISK

2011-12-21 23:45:27

This 'bit here:
Procedure WalkToStart;
Begin
MoveMouse(579, 90);
Mouse(576, 93, 1, 1, True);
SetAngle(True);
Wait(5000+Random(500));
WriteLn('Walk to start done.. Yay!');
AntiRandoms;
AntiBan;
End;
Why do you use specific coordinates? You should have used SPS at least.
Also why do you do MoveMouse and then Mouse? Mouse moves the mouse to the coordinates specified already. ;)

I don't believe there is enough randomization in your script's mousing functions. It's only a randomization range of 1 pixel off the main coordinates.

Your standards could do with a little work. You aren't supposed to capitalize routine names, are you?

You should also at least use CTS2 along with the modifiers you are given in ACA for all of the object finding functions.
Along with that suggestion, you should have used TPAs for each one of the objects for even greater accuracy and control over what is found.

 repeat
IsUpText('ipe');
Mouse(x, y, 5, 5, True);
ClickRed := DidRedClick;
Wait(200+Random(100));
until ClickRed;

You have an infinite loop here, this is very disastrous. You shouldn't have infinite loops. You do this in your entire script. You should at least have a time-out feature on them.

GetMousePos(x, y);
You don't need to do this since you are using FindObject in the same procedure/function.

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

You should have a higher random number for it to go with, in my opinion, at least. You should also make the range on those anti-ban functions a 'bit greater.
5 .. 7: ExamineInv;
Something like that. :) 5 ~ 7.

Great job though. I'm going to hold my vote though just to see if you take these suggestions and use them to your benefit. I have a lot of faith in your potential, so I can't wait to see what you do!

Griff

2011-12-21 23:45:54

A very good start! Very nice standards, really easy to read! You don't have many TPAs or DTMs and no walking, and your object finding is a bit simple. Your antirandoms procedure is useless. You're doing quite well, but I'm going to have to vote no.

Grimtoker

2011-12-21 23:57:13

Thanks a lot for all your feedback RISK, it's much appreciated.

Updated OP code with TPA's for finding objects and other fixes, script is working. also new code here:

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

//Start the script standing within a few squares of Balancing log

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

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

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(40) of //Increase number for less AntiBans
0: RandomRClick;
1: PickUpMouse;
2: HoverSkill('strength', False);
3: HoverSkill('attack', False);
4: HoverSkill('agility', False);
5: 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);
Wait(6500+Random(500));
WriteLn('Log done..');
Break;
end;
end;
end;
End;

Procedure Net;
Begin
AntiRandoms;
AntiBan;
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);
Wait(6500+Random(500));
WriteLn('Net done..');
Break;
end;
end;
end;
End;

Procedure BranchUp;
Begin
AntiRandoms;
AntiBan;
begin
FindColorsTolerance(MyTPA, 1985893, 326, 180, 351, 207, 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);
Wait(6500+Random(500));
WriteLn('Branch up done..');
Break;
end;
end;
end;
End;

Procedure Rope;
Begin
MarkTime(LoopBegin);
if TimeFromMark(LoopBegin) > 60000 then
TerminateScript;
repeat
FindObjEx(x, y, ['alancing', 'ope'], [RopeColor], 10, 2, 436, 163, 452, 191);
IsUpText('ope');
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
ClickRed := DidRedClick;
Wait(200+Random(100));
until ClickRed;
Wait(6000+Random(500));
WriteLn('Rope walk done..');
End;

Procedure BranchDown;
Begin
AntiRandoms;
AntiBan;
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);
Wait(4500+Random(500));
WriteLn('Branch down done..');
Break;
end;
end;
end;
End;

Procedure Net2;
Begin
SetAngle(False);
wait(750+Random(250));
begin
FindColorsTolerance(MyTPA, 998762, 306, 39, 325, 84, 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);
Wait(6500+Random(500));
WriteLn('Net2 done..');
Break;
end;
end;
end;
End;

Procedure Pipe;
Begin
AntiRandoms;
AntiBan;
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);
Wait(6500+Random(500));
WriteLn('Pipe done..');
Break;
end;
end;
end;
End;

Procedure WalkToStart;
Begin
Mouse(576, 93, 1, 1, True);
SetAngle(True);
Wait(5000+Random(500));
WriteLn('Walk to start done.. Yay!');
AntiRandoms;
AntiBan;
End;


Begin
SetupLogin;
SetupSRL;
DeclarePlayers;
ActivateClient;
StartTime:= GetSystemTime;
Time := (GetSystemTime-StartTime);
repeat
Log;
Net;
BranchUp;
Rope;
BranchDown;
Net2;
Pipe;
WalkToStart;
ProgressReport;
until(false);
End.

RISK

2011-12-22 14:23:36

Hmm. You shouldn't use global variables. You should use local variables. :)

Great job, though! You should also use CTS2 and the hue and saturation modifiers you get from ACA for each TPA.

footballjds

2011-12-22 14:29:31

MoveMouse.
Auto NO.

RISK

2011-12-22 14:31:54

Check the updated script above our posts. They fixed some things and I don't see any "MoveMouse" in the new version.

From: footballjds
MoveMouse.
Auto NO.

Blumblebee

2011-12-22 14:35:24

Like Griff said it's a good start. You've grasped the use of simple TPA's which is good to see, now you just have to keep expanding your knowledge, incorporate things like DTM's, failsafes, aTPA's, etc and you'll be an easy yes when you reapply :)

Hobbit

2012-01-07 16:39:34

The poll has closed and you didn't make it this time. Please take the suggestions made here and read some more in the tutorial section and improve your script. You may reapply in 4 weeks time.


Cheers
Hobbit