I wondered why SPS_WalkPath(); generates a little delay after the walk is done. I added the commented Break;. So here is the code:
Simba Code:
// Walks the path "Path"; always walks to the furthest point possible
function SPS_WalkPath(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 begin
if (D < 70) then
begin
MouseFlag(MM.X, MM.Y, 0, 0, Integer(I<>H)*15);
T := getSystemTime + 20000 + Random(1000);
Break;
end;
end;
end;
Result := (I = H);
// Break;
end;
end;
In my script there is a very short path (Edgeville Bank -> Yews), so there is a delay of 10 sec after every walk.
I think the function can be broken after the last point is reached.
Nothing big, but very annoying for short walks.
(I saw it isn't fixed in SPS 1.5 either)
- Gala