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.
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! :)
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.