SRL Archive - Research & Development Lounge

Running Back Procedure


Daniel

2008-01-21 03:35:53

Well, since there was no more running back procedure, i decided to make my own. Now i know that you can run back using the RunAway procedure by nielsie95 but this will run you back when you use the RunTo procedure.

NOTE: This requires to modify an SRL root file. If you're inexperienced then read some tutorials to learn how. You'll need to know about variables and procedures before continuing!

Location: Includes\SRL\SRL\Core/MapWalk.scar
Replace all of the RunTo procedure with this code for this to work properly:

{*******************************************************************************
procedure RunTo(dir: String; runfar: Boolean);
By: Mutant Squirrle and Nielsie95 modified by IP-Drowner (minor changes)
Description: Runs to direction
*******************************************************************************}

procedure RunTo(dir: string; runfar: Boolean);
var
OffSet, Tab: Integer;
begin
Tab := GetCurrentTab;
SetRun(True);
if RunFar then
OffSet := 63
else
OffSet := 30;
case UpperCase(dir) of
'N': MouseFlag(648, 83 - OffSet, 0, 0)
'S': MouseFlag(648, 83 + OffSet, 0, 0)
'E': MouseFlag(648 + OffSet, 83, 0, 0)
'W': MouseFlag(648 - OffSet, 83, 0, 0)
end;
Wait(6500 + Random(2000));
IdleTime(6000, 500, 1.0);
case UpperCase(dir) of
'N': MouseFlag(648, 83 + OffSet, 0, 0)
'S': MouseFlag(648, 83 - OffSet, 0, 0)
'E': MouseFlag(648 - OffSet, 83, 0, 0)
'W': MouseFlag(648 + OffSet, 83, 0, 0)
end;
SetRun(False);
GameTab(Tab);
DirectionRan:=dir;
RanFurther:=runfar;
end;

{*******************************************************************************
procedure RunBack(Direction: String; RanFar: Boolean);
By: IP-Drowner
Description: Will run back to original position.
*******************************************************************************}

procedure RunBack;
var OppDirection: String;
begin
case Lowercase(DirectionRan) of
'n': OppDirection:='s';
'e': OppDirection:='w';
's': OppDirection:='n';
'w': OppDirection:='e';
end;
RunTo(OppDirection, RanFurther);
end;

Also declare these variables as global variables, put under the DebugRadialRoad declare:

var
RanFurther: Boolean;
DirectionRan: String;
//* Running Back procedures.

Enjoy ;)

ZephyrsFury

2008-01-21 04:23:17

Haven't you posted this in three different threads?

Daniel

2008-01-21 05:43:04

From: ZephyrsFury
Haven't you posted this in three different threads?

Actually i only posted this in the SRL Member part on anything worth implementing into SRL. Which, it should be in SRL.

And i also wanted it to get released to the public so here it is.

P.S: Only 2 threads made ;)

Naum

2008-01-21 07:53:00

kl ill use this. credits to you :)

n3ss3s

2008-01-21 09:22:59

Which, it should be in SRL.


Ehh, you've kinda gotten the wrong picture, minor things are kept as they are, unless some dev feels like updating them, but usually no functions from the forums are picked.

osmm

2008-01-21 10:19:31

How does it require to change the root files? Just copy & paste it into your script and change name from like "procedure RunTo(dir: string; runfar: Boolean);" to "procedure RunTo2(dir: string; runfar: Boolean);" and it is now 1000x easyer for all the leechers using your script :p.

Daniel

2008-01-22 04:29:03

Hush, osmm. I wanted leechers to edit the root files, and if they can't they learn to script.

n3ss3s

2008-01-22 11:06:35

[Error] No sense in line 1 in IP-Drowner's post -

Leechers that cannot script would learn to script to use a function that'd they maybe want to use while scripting?

xD