Flight
2012-10-21 22:48:43
Heya, so I've stopped (for a while now) working on my Abyssal runecrafting script and I thought maybe someone else would find some of this handy. So here you are.
[SPS map of Abyss + Edgeville (Lodestone, bank, summoning obelisk, path to mage)]

The Abyss was made painfully piece by piece directly from the Minimap, while the Edgeville area was made via an SPS piece (Nebula's updated SPS maps), so it's fully up-to-date AFAIK.
[Inner-Ring SPS points (required)]
[Function InInnerRing: Boolean]
This, obviously, tells you if you're in the inner ring of the Abyss.
[function CalcShortestPath(ArrayIn: TPointArray; Dest: TPoint): TPointArray;]
This little work of art will take a set of pre-defined SPS coordinates, compare it to your player's current SPS coordinate, and calculate the shortest path. It's only useful for so many things, but among those is calculating which path (N/S/E/W) is the shortest to take to get to your target rift in the inner ring.
I have more of the script complete but the rest is personal preference of how objects and such should be located. So I decided just to post the global functions. Anyways, I hope someone finds use out of these, I put quite a bit of time into perfecting them.
[SPS map of Abyss + Edgeville (Lodestone, bank, summoning obelisk, path to mage)]

The Abyss was made painfully piece by piece directly from the Minimap, while the Edgeville area was made via an SPS piece (Nebula's updated SPS maps), so it's fully up-to-date AFAIK.
[Inner-Ring SPS points (required)]
IRPoints := [Point(147,95), Point(119,95), Point(99,103), Point(87,119), Point(83,139),
Point(87,155), Point(91,171), Point(107,187), Point(119,195), Point(135,195),
Point(159,191), Point(179,183), Point(191,175), Point(195,159), Point(199,143),
Point(195,127), Point(187,111), Point(175,99), Point(163,95), Point(147,103),
Point(147,119), Point(147,131), Point(151,143), Point(143,147), Point(135,139)];
[Function InInnerRing: Boolean]
Function InInnerRing: Boolean;
var
Me: TPoint;
i: Integer;
InDist: Boolean;
begin
InDist := False;
Me := SPS_GetMyPos();
for i := 0 to High(IRPoints) do
begin
if (Distance(Me.X, Me.Y, IRPoints[i].X, IRPoints[i].Y) <= 16) then
InDist := True;
if InDist then
break;
end;
Result := InDist;
end;
This, obviously, tells you if you're in the inner ring of the Abyss.
[function CalcShortestPath(ArrayIn: TPointArray; Dest: TPoint): TPointArray;]
function CalcShortestPath(ArrayIn: TPointArray; Dest: TPoint): TPointArray;
var
DistA,DistB,h: Integer;
M,P,NP1,NP2: TPoint;
TempTPA,TempTPA2,IRPnts: TPointArray;
begin
M := SPS_GetMyPos();
IRPnts := TPAFromBox(IntToBox(116,104,172,161));
TempTPA := ClearTPAFromTPA(ArrayIn,IRPnts);
SortTPAFrom(TempTPA, M);
Writeln('Distance to target: '+IntToStr(Distance(M.X, M.Y, Dest.X, Dest.Y)));
P := M;
Repeat
SetArrayLength(TempTPA2, Length(TempTPA2)+1);
SortTPAFrom(TempTPA, P);
NP1 := TempTPA[h];
NP2 := TempTPA[h+1];
DistA := Distance(NP1.X, NP1.Y, Dest.X, Dest.Y);
DistB := Distance(NP2.X, NP2.Y, Dest.X, Dest.Y);
if (DistA > DistB) then
TempTPA2[h] := NP2
else
TempTPA2[h] := NP1;
Inc(h);
Until((DistA <= 10) Or (DistB <= 10))
ClearDoubleTPA(TempTPA2);
SortTPAFrom(TempTPA2, M);
Result := TempTPA2;
end;
This little work of art will take a set of pre-defined SPS coordinates, compare it to your player's current SPS coordinate, and calculate the shortest path. It's only useful for so many things, but among those is calculating which path (N/S/E/W) is the shortest to take to get to your target rift in the inner ring.
I have more of the script complete but the rest is personal preference of how objects and such should be located. So I decided just to post the global functions. Anyways, I hope someone finds use out of these, I put quite a bit of time into perfecting them.