Determining the layer the player is in is not that hard, to be honest. I used SPS along with Mat's image of the abyss to calculate the magic coords, as I like to call them. They are basically the coords of the area around the center. From the the outer layer, a certain part of the abyss center (with the mage of zamorak) is always invisible, meaning no matter where you are in the outer layer, it is impossible to see it. However, in the inner layer, this portion of the minimap is always visible in every corner (tested and confirmed).
As for obstacles, I'm only using the mine and theiving blockades as they have distinct colours that can be easily be recognised by pure colour methods. My player just runs around the abyss until he detects those colours
Code so far if anyone is interested:
program RCAbyss;
//{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
var
Wall, FailAtMage: integer;
aFound: Extended;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Active := True;
end;
procedure StartUp;
begin
ClearDebug;
SetupSRL;
DeclarePlayers;
If not Loggedin then
begin
LoginPlayer;
Wait(4000 + Random(1000));
end;
SetAngle(0);
MakeCompass(0);
end;
procedure SetDTMs;
begin
Wall := DTMFromString('mlwAAAHicY2eAgFVArAzEmWiYF4i1gFgYiLmgalmBmA+IVZVkGISEhBjkpMXBGMSHsSWB8rgwIx4MBQBIogXS');
end;
procedure FreeLoadedDTMs;
begin
FreeDTM(Wall);
end;
function InInnerRing: boolean;
begin
SPS_Debug := true;
SPS_Setup(runescape_other, ['0_2']);
result := (SPS_PosOnMM(Point(235, 1051))) or (SPS_PosOnMM(Point(251, 1051)))
end;
procedure WalkToDitch;
begin
SPS_Setup(runescape_surface, ['10_6']);
If SPS_PosOnMM(point(4243, 2563)) then SPS_WalkToPos(point(4243, 2563)) else SPS_BlindWalk(point(4243, 2563));
while ismoving do wait(100);
end;
procedure CrossDitch;
var
x, y: integer;
begin
SetDTMs;
SPS_Setup(runescape_surface, ['10_6']);
while SPS_PosOnMM(point(4243, 2623)) do
begin
if FindDTMRotated(Wall, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
writeln('Found the wall. Clicking on it.');
Mouse(x, y, 20, 5, true);
Wait(3250 + random(500));
Mouse(643, 26, 10, 5, true);
wait(randomrange(1000, 1300));
end;
end;
end;
procedure WalkToMage;
begin
SPS_Setup(runescape_surface, ['10_6']);
If SPS_PosOnMM(point(4258, 2418)) then SPS_WalkToPos(point(4258, 2418)) else SPS_BlindWalk(point(4258, 2418));
end;
procedure TeleportToAbyss; //2698882, 5042406 Talk-to Mage of Zamorak
label label1;
var
x, y, c: Integer;
begin
MarkTime(c);
repeat;
label1:
If (FindColorSpiralTolerance(x, y, 1318281, MSX1, MSY1, MSX2, MSY2, 10)) or (FindColorSpiralTolerance(x, y, 5042406, MSX1, MSY1, MSX2, MSY2, 10)) then
begin
SPS_Setup(runescape_other, ['0_2']);
If not (SPS_GetMyPos = point(-1, -1)) then exit;
MMouse(x, y, 5, 5);
Wait(100 + random(200));
if (IsUpTextMultiCustom(['Mage', 'Talk', '-to', 'Zamorak', 'of Zam', 'age of'])) then
begin
FailAtMage := 0
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
wait(400 + random(200));
Mouse(x, (y + 61), 20, 3, true);
Wait(4100+random(1000));
end;
end else
begin
MakeCompass(randomrange(0, 360));
FailAtMage := FailAtMage + 1
If FailAtMage >= 5 then
begin
writeln('Failed to find mage colour 5 times in a row');
Terminatescript;
end;
GoTo Label1;
end;
until((not (SPS_GetMyPos = point(-1, -1))) or (TimeFromMark(c) >= 30000))
end;
procedure FindBlockade; //1548449 for Distract Eyes 4414328 for Mine Rock
var
MyTPA: TPointArray;
MyPoint: TPoint;
x, y, i, c: Integer;
begin
x := MSCx;
y := MSCy;
FindColorsSpiralTolerance(x, y, MyTPA, 4414328, MSX1, MSY1, MSX2, MSY2, 3);
if Length(MyTPA) = 0 then FindColorsSpiralTolerance(x, y, MyTPA, 2389603, MSX1, MSY1, MSX2, MSY2, 3);
MarkTime(c);
for i := 0 to High(MyTPA) do
begin
If InInnerRing then exit;
MyPoint := MyTPA[i]
MMouse(MyPoint.x, MyPoint.y, 5, 5);
Wait(100 + random(200));
if (IsUpTextMultiCustom(['Mine', 'Rock', 'ine', 'ock', 'ine R', 'Distract', 'Eyes', 'istract', 'yes', 'tract Ey'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Wait(500+random(250));
If InInnerRing then exit;
end;
end;
end;
procedure NavigateOutterRing;
var
T: integer;
begin
MarkTime(T);
SPS_Setup(runescape_other, ['0_2']);
If InInnerRing then
begin
writeln('In inner ring');
exit;
end;
repeat
If SPS_PosOnMM(Point(291, 1139)) then //01
begin
SPS_WalkToPos(point(291, 1139));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(327, 1095)) then //02
begin
SPS_WalkToPos(point(327, 1095));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(339, 1055)) then //03
begin
SPS_WalkToPos(point(339, 1055));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(331, 1019)) then //04
begin
SPS_WalkToPos(point(331, 1019));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(295, 975)) then //05
begin
SPS_WalkToPos(point(295, 975));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(243, 959)) then //06
begin
SPS_WalkToPos(point(243, 959));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(199, 975)) then //07
begin
SPS_WalkToPos(point(199, 975));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(163, 1007)) then //08
begin
SPS_WalkToPos(point(163, 1007));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(151, 1043)) then //09
begin
SPS_WalkToPos(point(151, 1043));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(151, 1095)) then //10
begin
SPS_WalkToPos(point(151, 1095));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(195, 1139)) then //11
begin
SPS_WalkToPos(point(195, 1139));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
If SPS_PosOnMM(Point(255, 1147)) then //12
begin
SPS_WalkToPos(point(255, 1147));
While isMoving do wait(100);
FindBlockade;
If InInnerRing then exit;
end;
until((InInnerRing) or (not LoggedIn) or (TimeFromMark(T) > 40000))
end;
procedure WalkToEntrance;
begin
SPS_Setup(runescape_other, ['0_2']);
If InInnerRing then
begin
If SPS_PosOnMM(point(195, 1047)) then SPS_WalkToPos(point(195, 1047)) else SPS_BlindWalk(point(195, 1047));
end;
end;
procedure EnterPortal;
var
MyTPA: TPointArray;
MyPoint: TPoint;
x, y, i, c: Integer;
begin
MakeCompass (90 + random(45));
x := MSCx;
y := MSCy;
repeat
FindColorsSpiralTolerance(x, y, MyTPA, 1774950, MSX1, MSY1, MSX2, MSY2, 3);
if Length(MyTPA) = 0 then FindColorsSpiralTolerance(x, y, MyTPA, 1578115, MSX1, MSY1, MSX2, MSY2, 3);
MarkTime(c);
for i := 0 to High(MyTPA) do
begin
MyPoint := MyTPA[i]
MMouse(MyPoint.x, MyPoint.y, 5, 5);
Wait(100 + random(200));
if (IsUpTextMultiCustom(['Blood', 'od ri', 'Blood rift', 'Exit-through Blood rift'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Wait(500+random(250));
end;
end;
until(not ininnerring);
end;
begin
StartUp;
WalkToDitch;
CrossDitch;
WalkToMage;
TeleportToAbyss;
NavigateOutterRing;
WalkToEntrance;
{SPS_Debug := true;
SPS_Setup(runescape_surface, ['10_6']);
sps_getmypos; }
end.
This is nowhere near completion. This is a very basic outline of the script. Most likely everything will be rewritten to a higher standard along with a better failsafe system.
Just finished interacting with the mage but haven't tested it completely. Gonna take a break for a while