Hey man, this script is working great with a few "make north" and etc… changes. Yeah you should use some reflection object finding, although this current finding works fairly good, it would make it a lot more stable if you used reflection. I'm running this all night, so hopefully have a large proggy for you tommorow.
EDIT: Heres a stable version of what I'm using, currently done 3 runs no problems. I basically just edited the colours and changed a few "SetAngle(aasdf)" things. also added findrandoms or whatever so that it checks for random events :P. Still have to add the reflection one, just couldn't remember what the procedure was called.
EDIT 2: Ok, rope crossing is about 75% chance of success. Reflection object clicking would be really nice here :D if someone could do that…or I'll just go read a tut right now.
EDIT 3:Alright, so I'll put the rope crossing probability of working now at 95%. And if it doesn't work, it just times out so no worries.
program Agility;
{.Include SRL\SRL\Misc\SMART.SCAR}
{.include SRL/SRL.scar}
{.include SRL/SRL/reflection/Reflection.Scar}
var
laps, totalTime, sleep_after, time_to_sleep, exp: Integer;
world: String;
sleep_b: Boolean;
procedure DeclareVars;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '*******'; // Account name
Players[0].Pass := '******';// user pass
Players[0].Nick := 'nky';//3 letters in username, not the first letter
Players[0].Active := True;
world := ''; // 'world142', 'world137' etc
sleep_b := True; // set True or False if you would like to rest your charecter after a few laps
sleep_after := 7 //set after how many runned laps you would like to rest only works if sleep is True
time_to_sleep := 1 // time to sleep in minutes only works if sleep is True
laps := 0;
end;
function skipTo(course: String): Boolean;
var
courseInfo: TPoint;
begin
case LowerCase(course) of
'netcross' : courseInfo := Point(2474, 3427);
'netcross2': courseInfo := Point(2486, 3424);
else
begin
writeln('Course - '+course+' does not exist');
Exit;
end;
end;
WalkToTile(courseInfo,0,9);
end;
function objectFindClick(color, toler: Integer; uptext, optText: String): Boolean;
var
x,y,z,l,i,temp_x,temp_y,tries: Integer;
temp_obj, t:TPointArray;
rezult :Boolean;
begin
z := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
rezult := False;
tries := 0;
repeat
FindColorsSpiralTolerance(temp_x, temp_y, temp_obj, color, 3, 3, 517, 341, toler);
ColorToleranceSpeed(z);
SetArrayLength(t, 0);
t := temp_obj;
SetArrayLength(temp_obj, 0);
temp_obj := ReArrangeAndShortenArray(t, 14);
l := GetArrayLength(temp_obj) -1;
for i := 0 to l do
begin
MMouse(temp_obj[i].X, temp_obj[i].Y, 2, 2);
Wait(75 + Random(75));
if IsUpText(uptext) Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(70 + Random(75));
if ChooseOption(optText) then
begin
Wait(1000 + Random(500));
rezult := True
break;
end;
end;
end;
until(rezult) or (tries > 5);
Result := rezult;
end;
function crossLog: Boolean;
var
charPos: TPoint;
tries, time1, i: Integer;
rez: Boolean;
begin
FindNormalRandoms;
setRun(True);
rez := False;
tries := 0;
MakeCompass('s');
if objectFindClick(801633,3,'alan','cros') then
begin
for i:=0 to 5 do
begin
MarkTime(time1);
repeat
wait(200 + Random(200))
charPos := GetMyPos;
until((charPos.x=2474) and (charPos.y=3429)) or (TimeFromMark(time1) > 20000)
if (TimeFromMark(time1) < 20000) then
begin
rez := True;
break;
end;
end;
end;
Result := rez;
end;
function netCross: Boolean;
var
charPos: TPoint;
tries, time1, i: Integer;
rez: Boolean;
begin
FindNormalRandoms;
setAngle(False);
rez := False;
tries := 0;
MakeCompass('s');
if objectFindClick(334894,3,'stac','lim') then
begin
for i:=0 to 5 do
begin
MarkTime(time1);
repeat
wait(200 + Random(200))
charPos := GetMyPos;
until (charPos.y=3423) or (TimeFromMark(time1) > 20000)
if (TimeFromMark(time1) < 20000) then
begin
rez := True;
break;
end;
end;
end;
Result := rez;
end;
function branchCross: Boolean;
var
charPos: TPoint;
tries, time1, i: Integer;
rez: Boolean;
begin
FindNormalRandoms;
setAngle(True);
rez := False;
tries := 0;
MakeCompass('s');
if objectFindClick(3629688,3,'ranc','lim') then
begin
for i:=0 to 5 do
begin
MarkTime(time1);
repeat
wait(200 + Random(200))
charPos := GetMyPos;
until((charPos.x=2473) and (charPos.y=3420)) or (TimeFromMark(time1) > 20000)
if (TimeFromMark(time1) < 20000) then
begin
rez := True;
break;
end;
end;
end;
Result := rez;
end;
function ropeCross: Boolean;
var
charPos,temp_walk: TPoint;
tries, time1, i: Integer;
rez: Boolean;
begin
FindNormalRandoms;
rez := False;
tries := 0;
MakeCompass('n');
setAngle(False);
temp_walk := Point(2475, 3420);
WalkToTile(temp_walk,0,1);
wait(1000 + Random(200))
if objectFindClick(6392232,5,'alan','alk') then
begin
for i:=0 to 5 do
begin
MarkTime(time1);
repeat
wait(200 + Random(200))
charPos := GetMyPos;
until((charPos.x=2483) and (charPos.y=3420)) or (TimeFromMark(time1) > 20000)
if (TimeFromMark(time1) < 20000) then
begin
rez := True;
break;
end;
end;
end;
Result := rez;
end;
function branchCross2: Boolean;
var
charPos: TPoint;
tries, time1, i: Integer;
rez: Boolean;
begin
FindNormalRandoms;
rez := False;
tries := 0;
//MakeCompass('n');
//setAngle(False);
if objectFindClick(4157578,3,'ranc','lim') then
begin
for i:=0 to 5 do
begin
MarkTime(time1);
repeat
wait(200 + Random(200))
charPos := GetMyPos;
until((charPos.x=2487) and (charPos.y=3420)) or (TimeFromMark(time1) > 20000)
if (TimeFromMark(time1) < 20000) then
begin
rez := True;
break;
end;
end;
end;
Result := rez;
end;
function netCross2: Boolean;
var
charPos: TPoint;
tries, time1, i: Integer;
rez: Boolean;
begin
FindNormalRandoms;
setAngle(False);
rez := False;
tries := 0;
MakeCompass('n');
if objectFindClick(869231,5,'stac','lim') then
begin
for i:=0 to 5 do
begin
MarkTime(time1);
repeat
wait(200 + Random(200))
charPos := GetMyPos;
until(charPos.y=3428) or (TimeFromMark(time1) > 20000)
if (TimeFromMark(time1) < 20000) then
begin
rez := True;
break;
end;
end;
end;
Result := rez;
end;
function pipeCross: Boolean;
var
charPos: TPoint;
tries, time1, i, x, y: Integer;
rez: Boolean;
begin
FindNormalRandoms;
rez := False;
tries := 0;
MakeCompass('n');
setAngle(True)
if objectFindClick(7369082,5,'uee','hroug') then
begin
for i:=0 to 5 do
begin
MarkTime(time1);
repeat
if FindText(x,y,'used',SmallChars,3,441,137,461) then
begin
wait(500 +Random(200));
pipeCross;
end;
wait(200 + Random(200))
charPos := GetMyPos;
until((charPos.x=2487) and (charPos.y=3437)) or ((charPos.x=2484) and (charPos.y=3437)) or (TimeFromMark(time1) > 20000)
if (TimeFromMark(time1) < 20000) then
begin
rez := True;
break;
end;
end;
end;
Result := rez;
end;
procedure backToStart;
var
start: TPoint;
begin
start := Point(2474, 3438);
WalkToTile(start,1,1);
end;
Procedure AntiBan;
Begin
Case Random(20) of
0: If Random(15) = 5 Then MMouse(MSX1, MSY1, MSX2, MSY2);
1: If Random(25) = 5 Then RandomRClick;
2: If Random(10) = 5 Then HoverSkill('mining', False);
3, 4, 5: Wait(100 + Random(1000));
6: If Random(10) = 5 Then Begin GameTab(1 + Random(14)); Wait(500 + Random(500)); GameTab(4); End;
17: If Random(15) = 5 Then HoverSkill('random', False);
End;
End;
procedure proggy;
var
minutes: Extended;
time, seconds: Integer;
begin
time := TimeFromMark(totalTime);
minutes := time / 60000;
seconds := Round(DecRet(minutes) * 100);
cleardebug;
WriteLn(' |*********************************************');
WriteLn(' | Gnome Agility Runner by Janziz ');
WriteLn(' |_____________________________________________');
WriteLn(' | Laps Done: '+IntToStr(laps)+' ');
WriteLn(' | Total Time: '+IntToStr(Floor(minutes))+':'+IntToStr(seconds));
WriteLn(' | Gained '+IntToStr(laps*87)+' exp! ');
WriteLn(' |_____________________________________________');
end;
procedure countLaps;
var
sleep_ms: Integer;
begin
laps := laps + 1
exp := laps * 87;
proggy;
if((sleep_b) and (laps >= sleep_after)) then
begin
logout;
sleep_ms := time_to_sleep * 60000;
wait(sleep_ms + Random(5000))
loginplayer;
sleep_after := sleep_after + sleep_after;
end
end;
procedure ScriptTerminate;
Begin
proggy;
writeln('Thanks for using Gnome Agility Runner by Janziz');
End;
procedure mainLoop;
begin
MarkTime(totalTime);
repeat
if not crossLog then
skipTo('netCross');
if not netCross then
begin
skipTo('netCross2');
netCross2;
end else
begin
branchCross;
ropeCross;
branchCross2;
netCross2;
pipeCross;
backToStart;
end;
countLaps;
until(false);
end;
begin
DeclareVars;
SmartSetupEx(95, True, True, False);
SetTargetDC(SmartGetDC);
SetupSRL;
ActivateClient;
loginplayer;
SetAngle(true);
mainLoop;
end.
Ok, didn't run all night, but it ran decently:
|*********************************************
| Gnome Agility Runner by Janziz
|_____________________________________________
| Laps Done: 30
| Total Time: 40:51
| Gained 2610 exp!
|_____________________________________________
And another:
|*********************************************
| Gnome Agility Runner by Janziz
|_____________________________________________
| Laps Done: 48
| Total Time: 59:29
| Gained 4176 exp!
|_____________________________________________