SRL Archive - OSR Help

Turn run off?


ILikeSmoothHeads

2012-12-12 17:07:31

Hi, just wondering is there a way to tell your script not to turn run on? Just completed the sps walking tut:
program SPSTut;
{$i srl/srl.simba}
{$i sps/sps.simba}
Var
myPath:TPointArray;
begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE,['11_6','10_6','10_7','11_7','12_6']);//SPS Areas
myPath := [Point(4555, 2681), Point(4553, 2667),
Point(4550, 2654), Point(4546, 2647),
Point(4541, 2641), Point(4533, 2635),
Point(4516, 2631), Point(4502, 2626),
Point(4477, 2623), Point(4468, 2625),
Point(4452, 2635), Point(4447, 2647),
Point(4444, 2657), Point(4441, 2668),
Point(4441, 2675), Point(4442, 2686),
Point(4451, 2711), Point(4463, 2719),
Point(4487, 2736), Point(4498, 2750)];
SPS_WalkPath(myPath);
end.

Wardancer

2012-12-12 17:18:59

I'm not sure I get what you mean… run automatically "turns" to off once you reach 0 energy. You can turn it back on by running:

RunEnergy(30);    //Will start running again if you have 30 energy

However, do know that this line will only "work" once it's triggered. You might want to split your walking procedure to run this function at more than one place.

Olly

2012-12-12 17:21:38

SPS_Walkpath automaticly turn runs on, to prevent this you could just copy the function and remove the run like this

function SPS_WalkPathCustom(Path: TPointArray): boolean;
var
I, H, T, D: integer;
P, MM: TPoint;
begin
H := High(Path);
T := GetSystemTime + 20000 + Random(5000);

while (not Result) and (GetSystemTime < T) do
begin
// RunEnergy(20);

P := SPS_GetMyPos;
for I := H downto 0 do
begin
MM.X := MMCX + Path[I].X - P.X;
MM.Y := MMCY + Path[I].Y - P.Y;

D := Distance(MM.X, MM.Y, MMCX, MMCY);

if (D < 10) then
break
else
if (D < 70) then
begin
if (SPS_MultiMouse) then
MultiMouse(MM.X, MM.Y, 25, 3, false)
else
Mouse(MM.X, MM.Y, 5, 5, mouse_Left);

FFlag(Integer(I <> H) * 15);

T := getSystemTime + 20000 + Random(1000);
Break;
end;
end;

Result := (I = H);
end;
end;

then justcall sps_walkpathcustom(point(100,100)) etc

ILikeSmoothHeads

2012-12-12 17:22:51

I want the script to not turn run on, at the moment it's turning it on when i've manually turned it off, I wish for my player to walk…

EDIT: Thanks Olly has worked!+rep