Simba Code:
program SkeletalHordeAbuser;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i SRL/srl/misc/smartgraphics.simba}
{* Instructions
- You need to get the boss "Skeletal Skinweaver", the following way:
= Start a floor 12 complexity 6 dungeon
= Complete the floor and if you have the boss then enter the room and drop
your gatestone somewhere
= Make sure that:
~ Your auto retaliate is ON
~ Your quick prayer is set to protect from magic
~ Your action bar is open
~ You have the constitution ability "Momentum" set in the action bar
= Once everything is setup wait until you die
- Edit the keys below to make sure they match your ability's
= DO NOT ADD MOMENTUM
- Once you have set everything up, start the script
*}
// 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 is one NPC in our room
function SmugglerInRoom: boolean;
var
NPCs, RoomPoints: TPointArray;
L, i, Count: 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
Inc(Count);
end;
Result := Count = 1;
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 := (SmugglerInRoom 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;
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 UseMomentum: boolean;
var
L, LL: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
P: TPoint;
begin
FindColorsTolerance(TPA, 66, 47, 345 - SRL_NAVBAR_INGAME_Y, 478, 379 - SRL_NAVBAR_INGAME_Y, 25);
L := Length(TPA);
if L > 0 then
begin
SplitTPAWrap(TPA, 5, ATPA);
SortATPASize(ATPA, True);
LL := Length(ATPA[0]);
writeln('Momentum colors: ' + IntToStr(LL));
if LL > 100 then
begin
P := MiddleTPA(ATPA[0]);
MMouse(P.x, P.y, 10, 10);
ClickMouse2(1);
Result := True;
end;
end;
end;
// Walks around the room trying to find the portal, time out after 30 secs
function FindPortal: boolean;
var
RoomPoints: TPointArray;
P: TPoint;
T, 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;
procedure UseRandomAbility;
begin
TypeSendEx(IntToStr(Random(11)), False);
end;
// MAINLOOP
begin
SetupSRL;
ClickNorth(SRL_ANGLE_HIGH);
repeat
case StartingRoom of
false: begin
writeln('Fighting skeletons...');
UseMomentum;
UseRandomAbility;
Wait(RandomRange(1000, 2000));
end;
true: if not(FindPortal) then
begin
WriteLn('We failed to find the gatestone portal');
WriteLn('Terminating the script');
TerminateScript;
end;
end;
until(false);
end.