SRL Archive - SRL Archives

Running Back Procedure


Daniel

2008-01-21 02:10:33

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.

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.

Well, enjoy and i hope this gets added into SRL ;)

nielsie95

2008-01-21 02:17:32

RunTo runs To and Back?
And what about the RunAway procedure?

Daniel

2008-01-21 02:29:24

From: nielsie95
RunTo runs To and Back?
And what about the RunAway procedure?

Yes it can run back but it saves putting in all the parametres and adding one more function into the script.

The RunAway procedure i don't particularly like, and again saves inputting parameters.

P1nky

2008-01-21 19:19:47

i dont think this was needed though gj keep it up

and yes runto does waits/runback

footballjds

2008-01-22 08:00:06

i agree with pinky not really needed:p but heck at least you aint leaching :D