From: mxtrix
Usually it takes ~3 dungeons to get him, just make sure you are on floor 12. I love when you get a 2.5k xp drop :)
EDIT: Wow, nice work. I am off for the night, better get a good nights sleep before my final exam. After I am done tomorrow I should be able to help out (if needed).
Okay, I have around 1,5 hours of script time until I have to leave for school so we'll see how far I can get :P
Script so far:
program SkeletalHordeAbuser;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i SRL/srl/misc/smartgraphics.simba}
{* Instructions
- Start a Floor 12 Dungeon
- Finish the floor and make as much cosmics as possible
- Make sure you have protect from magic set as quick prayer
- Drop a gatestone in the boss room with the Skeletal Horde
*}
// Gets all the points from our dungeoneering room
function GetRoom: TPointArray;
var
i, j, X, Y, nearest, room: Integer;
dist: Extended;
Rooms: T2DPointArray;
begin
for i:=MMX1 to MMX2 do
for j:=MMY1 to MMY2 do
begin
dist := Pow((MMCX-i), 2) + Pow((MMCY-j), 2);
if (dist < Pow(((MMX2-MMX1)/2), 2)) then
if not(FindColorTolerance(X, Y, 0, i, j, i, j, 10)) then
begin
SetLength(Result, Length(Result)+1);
Result[Length(Result)-1] := Point(i, j);
end;
end;
nearest := 1000;
Rooms := SplitTPA(Result, 3);
if (Length(Rooms) > 0) then
for i := 0 to high(Rooms) do
begin
MiddleTPAEx(Rooms[i], X, Y)
dist := Abs(MMCX - X) + Abs(MMCY - Y);
if (dist < nearest) then
begin
nearest := Round(dist);
room := i;
end;
end;
SetLength(Result, Length(Rooms[room]));
Result := Rooms[room];
SMART_DrawDotsEx(True, Result, clRed);
end;
// Checks if there are any npc's in our room
function NPCInRoom: boolean;
var
NPCs, RoomPoints: TPointArray;
L, i: Integer;
B: TBox;
begin
NPCs := GetMiniMapDots('npc');
L := Length(NPCs);
if L > 0 then
begin
RoomPoints := GetRoom;
B := GetTPABounds(RoomPoints);
for i:=0 to L do
if PointInBox(NPCs[i], B) then
begin
Result := True;
break;
end;
end;
end;
// Checks if we died
function WeDied: boolean;
var
i: Integer;
s: String;
DeadText: boolean;
begin
for i:=8 downto 1 do
begin
s := GetChatBoxText(i, clBlack);
if Pos('dead', s) > 0 then
begin
Result := True;
break;
end;
end;
end;
// Checks if you are in the starting room
function StartingRoom: boolean;
begin
Result := NPCInRoom and WeDied;
writeln('Are we in the starting room? ' + BoolToStr(Result));
end;
// Searches for the gatestone portal
function GatestonePortal: boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
i, L, LL: Integer;
P: TPoint;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 0.61);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 12041486, MSX1, MSY1, MSX2, MSY2, 17);
L := Length(TPA);
if L > 0 then
begin
SplitTPAWrap(TPA, 5, ATPA);
SortATPASize(ATPA, True);
LL := Length(ATPA[0]);
if LL > 50 then
begin
P := MiddleTPA(ATPA[0]);
MMouse(P.x, P.y, RandomRange(-5, 5), RandomRange(-5, 5));
//ClickMouse2(1);
Result := True;
writeln('Did we find the portal? ' + BoolToStr(Result));
end;
end;
end;
// Checks if we can use Momentum
function FullAdrenaline: boolean;
var
Percent: Integer;
begin
Percent := GetAdrenalinePercent;
writeln('Our adrenaline: ' + IntToStr(Percent));
Result := GetAdrenalinePercent >= 98;
writeln('Can we use our ultimate ability? ' + BoolToStr(Result));
end;
begin
SetupSRL;
StartingRoom;
FullAdrenaline;
GatestonePortal;
end.
Result:

Debug:
Paired with SMART[8132]
Are we in the starting room? True
Our adrenaline: 0
Can we use our ultimate ability? False
Did we find the portal? True
Successfully executed.
EDIT: Can now find the gatestone portal and enter it, took me longer than expected :O
program SkeletalHordeAbuser;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i SRL/srl/misc/smartgraphics.simba}
{* Instructions
- Start a Floor 12 Dungeon
- Finish the floor and make as much cosmics as possible
- Make sure you have protect from magic set as quick prayer
- Drop a gatestone in the boss room with the Skeletal Horde
*}
// Gets all the points from our dungeoneering room
function GetRoom: TPointArray;
var
Nearest, Room, C1, C2, i, L: Integer;
Dist: Extended;
RoomATPA: T2DPointArray;
MMBox, MMCircle, RoomTPA: TPointArray;
P: TPoint;
begin
MMBox := TPAFromBox(IntToBox(MMX1, MMY1, MMX2, MMY2));
MMCircle := RemoveDistTPointArray(MMCX, MMCY, 75, MMBox, True);
C2 := clBlack;
for i:=0 to high(MMCircle) do
begin
P := MMCircle[i];
C1 := GetColor(P.x, P.y);
if not(SimilarColors(C1, C2, 10)) then
begin
L := Length(RoomTPA);
SetLength(RoomTPA, L+1);
RoomTPA[L] := P;
end;
end;
Nearest := 1000;
RoomATPA := SplitTPA(RoomTPA, 2);
if Length(RoomATPA) > 0 then
for i:=0 to high(RoomATPA) do
begin
P := MiddleTPA(RoomATPA[i]);
//SMART_DrawDot(False, P, clRed);
Dist := Distance(MMCX, MMCY, P.x, P.y);
writeln('Room ' + IntToStr(i) + ' distance: ' + ToStr(Dist));
if (Dist < Nearest) then
begin
Nearest := Round(Dist);
Room := i;
end;
end;
Result := RoomATPA[room];
SMART_DrawDotsEx(True, Result, clGreen);
end;
// Checks if there are any npc's in our room
function NPCInRoom: boolean;
var
NPCs, RoomPoints: TPointArray;
L, i: Integer;
begin
NPCs := GetMiniMapDots('npc');
L := Length(NPCs);
if L > 0 then
begin
RoomPoints := GetRoom;
for i:=0 to L-1 do
if PointInTPA(NPCs[i], RoomPoints) then
begin
Result := True;
break;
end;
end;
end;
// Checks if we died
function WeDied: boolean;
var
i: Integer;
s: String;
begin
for i:=8 downto 1 do
begin
s := GetChatBoxText(i, clBlack);
if Pos('dead', s) > 0 then
begin
Result := True;
break;
end;
end;
end;
// Checks if you are in the starting room
function StartingRoom: boolean;
begin
Result := NPCInRoom and WeDied;
writeln('Are we in the starting room? ' + BoolToStr(Result));
Result := True;
end;
// Searches for the gatestone portal
function GatestonePortal: boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
L, LL: Integer;
P: TPoint;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 0.61);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 12041486, MSX1, MSY1, MSX2, MSY2, 17);
L := Length(TPA);
writeln('Portal color matches: ' + IntToStr(L));
if L > 0 then
begin
SplitTPAWrap(TPA, 5, ATPA);
SortATPASize(ATPA, True);
LL := Length(ATPA[0]);
writeln('Portal points: ' + IntToStr(LL));
if LL > 250 then
begin
P := MiddleTPA(ATPA[0]);
MMouse(P.x, P.y, RandomRange(-5, 5), RandomRange(-5, 5));
ClickMouse2(1);
Wait(RandomRange(3000, 4000));
Result := True;
end;
end;
writeln('Did we find the portal? ' + BoolToStr(Result));
end;
// Checks if we can use Momentum
function FullAdrenaline: boolean;
var
Percent: Integer;
begin
Percent := GetAdrenalinePercent;
writeln('Our adrenaline: ' + IntToStr(Percent));
Result := GetAdrenalinePercent >= 98;
writeln('Can we use our ultimate ability? ' + BoolToStr(Result));
end;
// Walks around the room trying to find the portal, time out after 30 secs
function FindPortal: boolean;
var
RoomPoints: TPointArray;
P: TPoint;
T, R, Dg: Integer;
begin
if StartingRoom then
begin
MarkTime(T);
SetAngle(SRL_ANGLE_LOW);
while not(Result) do
begin
Dg := Round(rs_GetCompassAngleDegrees);
MakeCompass(RandomRange(Dg, Dg+90));
writeln('TimeFromMark(T) => ' + IntToStr(TimeFromMark(T)));
if (TimeFromMark(T) > 60000) then
break;
writeln('Possibly walking to the middle of the room');
RoomPoints := GetRoom;
P := MiddleTPA(RoomPoints);
writeln('P: ' + ToStr(P));
if Distance(P.x, P.y, MMCX, MMCY) > 10 then
begin
writeln('We are not near the middle, walking there');
MMouse(P.x, P.y, RandomRange(-3, 3), RandomRange(-3, 3));
ClickMouse2(1);
while IsMoving do
Wait(RandomRange(300, 600));
Wait(RandomRange(1000, 2000));
end;
if GatestonePortal then
Result := True;
end;
Writeln('Did we find the portal? ' + BoolToStr(Result));
end;
ClickNorth(SRL_ANGLE_HIGH);
end;
begin
SetupSRL;
ClickNorth(SRL_ANGLE_HIGH);
//GetRoom;
//StartingRoom;
//FullAdrenaline;
//GatestonePortal;
FindPortal;
end.