SRL Archive - First Scripts

BarbarianNubcake, Agility course runner.


The Little

2009-06-24 22:49:50

Hey all,

Just finished version 0.6 and decided this is going to be the final release for now, I've been working for this for ages now, and while making this script I gained enough agility xp to move on to the wilderness course. I might just continue this later, but i'll leave it alone for now.

Features
- Failsafe walking.
- Uses Reflection and Color.
- Recovers from failed obstacles.
- Detailed progress report
- AntiRandom and AntiBan, need more different antibans though.

Instructions.
- Make sure your char is right north of the left swinging rope, even though the script should walk to the right position, don't depend on it
- Run the script
- Fill in the SRLPlayerForm
- Press Start & Save

Thanks :)

The Little

Nadeem

2009-06-25 01:16:13

Nice, Its very clean and easy to understand.

Some Suggestions:

The following code:

if (OwnObstacleR(RopePoint, RopeFront , 'ing', 'Swing-on', RopeID, 260, 2)) then
begin
ClickedRope := True;
end else
begin
if (OwnObstacleC(RopeColor, 232, 172, 235, 188, 10, 'ing', 'Swing-on')) then
begin
ClickedRope := True;
end else
begin
ClickedRope := False;
end;
end;

Can be easily replaced with just:

case OwnObstacleR(RopePoint, RopeFront , 'ing', 'Swing-on', RopeID, 260, 2) of
True : ClickedRope := True;
False: ClickedRope := OwnObstacleC(RopeColor, 232, 172, 235, 188, 10, 'ing', 'Swing-on');
end;

{ OR EVEN THIS: }

ClickedRope := OwnObstacleR(RopePoint, RopeFront , 'ing', 'Swing-on', RopeID, 260, 2);
if not ClickedRope then
ClickedRope := OwnObstacleC(RopeColor, 232, 172, 235, 188, 10, 'ing', 'Swing-on');

Its not a must to have begin end; after every if statement, IF its a 1 line command.

Also inside your repeat loops your have Exit;, Just so you know, Exit; is used to exit out of the whole function/procedure. Break; is used to break out of the loop.



~NS

The Little

2009-06-25 10:04:09

Thank you Nadeem, fixed :).
ProgressReport is almost done, after that I'll start on implementing recovery from failed obstacles and make a start on using TPAs ;).

ShowerThoughts

2009-06-25 16:13:46

Try the SRLProgressReport it's new in Rev 34/35. :)

The Little

2009-06-25 17:26:40

I was just reading the article Hermen :), I'm probably going to use it for some more detailed information (like xp/h, xp till 99, number of failed obstacles) ;).

I just released version 0.2, walking around the course is near flawless, I haven't had an error in 15 laps ;), well at least none that the script didn't fix by itself :P.

Floor66

2009-06-25 19:42:30

Pretty awesome for a first script ;)
Best I've seen in times.

The Little

2009-06-25 20:14:10

Thanks :)!

I have been programming in C and C++ before though, not that it is anything like Delphi or Pascal, but it does help reading and understanding your code.

On topic: Time for version 0.3, see first post for details ;)

Nadeem

2009-06-25 23:38:47

From: Floor66
Pretty awesome for a first script ;)
Best I've seen in times.


+1 :)


ClickedLedge := (OwnObstacleR(LedgePoint, NetAfter , 'acro', 'Walk-across', LedgeID, 0, 15));
if not ClickedLedge then
ClickedLedge := (OwnObstacleC(LedgeColor, 205, 164, 10, 'acro', 'Walk-across', True));
if not ClickedLedge then
Exit;

- You do not need extra brackets, its unnecessary. (Although its personal preference I guess)
- Make sure you have two (2) spaces after loop & and if statements (1 liner), makes it more organized and easier to read. (Not before begin end;



~NS

The Little

2009-06-27 22:25:49

Hey all, thought I'd inform you all on the progress :),

I've got the color finding all sorted out, and its working great :D, I'm going to make sure you can walk around the course using color only and then add Reflection, using color as a failsafe.
I've spread out previous functions across others, so that will shorten code by quite a bit :).

I'm probably going to release a V0.1 tomorrow.

ian.

2009-06-28 08:05:20

You should have reflection as a failsafe. Reflection won't fail by itself so there's no reason to have a something that could fail as a failsafe that won't ever be used. :)

The Little

2009-06-28 12:57:15

Yeah thats true, never realised that :P. Not a big deal though, just have to swap two lines of code :). I got all the functions setup, just have to get colors and coords and put them in the script ;).

Gu3st...

2009-06-28 13:02:46

Why use reflection and color? Reflection alone would be just as good ;)

Floor66

2009-06-28 13:14:44

Something could always bugg (update/hooks outdated) and then colour would save it :)

ian.

2009-06-28 13:17:30

From: Floor66
Something could always bugg (update/hooks outdated) and then colour would save it :)


Most likely the color won't work on it's own ;) only reason I said that.

The Little

2009-06-29 01:07:13

New version people :), should work much better than the previous.

By the way, I'm using both color and reflection because some obstacles, like the walls for example, are hard to find with color because of the surroundings and others like the net are harder with reflection.

EDIT: Uploading v0.5 in a minute, antiban included :D

EDIT2: Noone??

EDIT3: Final release, going to work on something else.