Minimap

Methods to interact with the minimap.


type TRSMinimap

TRSMinimap = record(TRSInterface)
  CompassCircleOffset: TPoint;
  XPCircleOffset: TPoint;
  HitpointsCircleOffset: TPoint;
  PrayerCircleOffset: TPoint;
  RunCircleOffset: TPoint;
  SpecAttackCircleOffset: TPoint;
  PolygonOffset: TPointArray;
  FlagBitmap: Int32;
end;

TRSMinimap type used to interact with the minimap


Minimap.GetCompassCircle

function TRSMinimap.GetCompassCircle(): TCircle;

Returns the compass circle.

Example:

circle := Minimap.GetCompassCircle();
Debug(circle.ToTPA());

Minimap.GetXPCircle

function TRSMinimap.GetXPCircle(): TCircle;

Returns the xp bar circle.

Example:

circle := Minimap.GetXPCircle();
Debug(circle.ToTPA());

Minimap.GetHPCircle

function TRSMinimap.GetHPCircle(): TCircle;

Returns the hp circle.

Example:

circle := Minimap.GetHPCircle();
Debug(circle.ToTPA());

Minimap.GetPrayerCircle

function TRSMinimap.GetPrayerCircle(): TCircle;

Returns the prayer circle.

Example:

circle := Minimap.GetPrayerCircle();
Debug(circle.ToTPA());

Minimap.GetRunCircle

function TRSMinimap.GetRunCircle(): TCircle;

Returns the run energy circle.

Example:

circle := Minimap.GetRunCircle();
Debug(circle.ToTPA());

Minimap.GetSpecAttackCircle

function TRSMinimap.GetSpecAttackCircle(): TCircle;

Returns the special attack circle.

Example:

circle := Minimap.GetSpecAttackCircle();
Debug(circle.ToTPA());

Minimap.GetOrbLevel

function TRSMinimap.GetOrbLevel(Orb: TCircle): Int32;

Returns the level of the specified orb.

Example:

WriteLn Minimap.GetOrbLevel(Minimap.GetSpecAttackCircle());

Minimap.GetRunEnergy

function TRSMinimap.GetRunEnergy(): Int32;

Returns the run energy level.

Example:

WriteLn Minimap.GetRunEnergy();

Minimap.GetHPLevel

function TRSMinimap.GetHPLevel(): Int32;

Returns the current hp level.

Example:

WriteLn Minimap.GetHPLevel();

Minimap.GetHPPercent

function TRSMinimap.GetHPPercent(): Int32;

Returns the current hp percentage level.

Example:

WriteLn Minimap.GetHPPercent();

Minimap.GetPrayerLevel

function TRSMinimap.GetPrayerLevel(): Int32;

Returns the current prayer level.

Example:

WriteLn Minimap.GetPrayerLevel();

Minimap.GetPrayerPercent

function TRSMinimap.GetPrayerPercent(): Int32;

Returns the current Prayer percentage level.

Example:

WriteLn Minimap.GetPrayerPercent();

Minimap.GetSpecLevel

function TRSMinimap.GetSpecLevel(): Int32;

Returns the current special attack level.

Example:

WriteLn Minimap.GetSpecLevel();

Minimap.GetPolygon

function TRSMinimap.GetPolygon(): TPointArray;

Returns the minimap polygon which is not a perfect circle.

Example:

Debug(Minimap.GetPolygon().Connect());

Minimap.GetCompassAngle

function TRSMinimap.GetCompassAngle(asDegrees: Boolean = True): Double;

Returns the current compass angle as degrees or radians.

Note

Credits to Slacky

Example:

WriteLn Minimap.GetCompassAngle();

Minimap.SetCompassAngle

procedure TRSMinimap.SetCompassAngle(Degrees: Double; Accuracy: Double = 5);

Sets the current compass angle.

Example:

Minimap.SetCompassAngle(180);

Minimap.IsPointOn

function TRSMinimap.IsPointOn(P: TPoint): Boolean;
function TRSMinimap.IsPointOn(P: TPoint; Expand: Int32): Boolean; overload;

Checks if a point is on the minimap.


Minimap.Filter

function TRSMinimap.Filter(arr: TPointArray): TPointArray;

Filters the given TPointArray and returns only the points that are visible in the Minimap.


Minimap.RandomPointOn

function TRSMinimap.RandomPointOn(p: TPoint; randomness: Int32): TPoint;

Creates a random point that based on randomness and p that is on the minimap. Returns [0, 0] if the point couldn’t be generated, e.g. it’s too far away from the minimap.


Minimap.IsStatus

function TRSMinimap.IsPoisoned(): Boolean;
function TRSMinimap.IsEnvenomed();
function TRSMinimap.IsRunEnabled(): Boolean;
function TRSMinimap.IsPrayerEnabled(): Boolean;
function TRSMinimap.HasStamina();
function TRSMinimap.IsSpecEnabled(): Boolean;
function TRSMinimap.IsSpecWeapon();

Returns whether the player has the specified status or not. For the TRSMinimap.IsSpecWeapon() one, it will return false if the special attack level is at 0.

Example:

Writeln Minimap.IsPoisoned();
WriteLn Minimap.IsEnvenomed();
Writeln Minimap.IsRunEnabled();
Writeln Minimap.IsPrayerEnabled();
WriteLn Minimap.HasStamina();
Writeln Minimap.IsPrayerEnabled();
Writeln Minimap.IsSpecWeapon();

Minimap.CurePoison

function TRSMinimap.CurePoison(): Boolean;

Attempts to cure poison by clicking the HP orb. This only works if you have a source of anti-poison.

Example:

Writeln Minimap.CurePoison();

Minimap.EnableRun

function TRSMinimap.EnableRun(): Boolean;

Attempts to enable the run energy by clicking the run orb.

Example:

Writeln Minimap.EnableRun();

Minimap.DisableRun

function TRSMinimap.DisableRun(): Boolean;

Attempts to disable the run energy by clicking the run orb.

Example:

Writeln Minimap.DisableRun();

Minimap.EnablePrayer

function TRSMinimap.EnablePrayer(): Boolean;

Attempts to enable quick prayers by clicking the prayer orb.

Example:

Writeln Minimap.EnablePrayer();

Minimap.DisablePrayer

function TRSMinimap.DisablePrayer(): Boolean;

Attempts to disable quick prayers by clicking the prayer orb.

Example:

Writeln Minimap.DisablePrayer();

Minimap.EnableSpec

function TRSMinimap.EnableSpec(minSpec: Int32): Boolean;

Attempts to enable the special attack if we have at leas minSpec special attack level.

Example:

WriteLn Minimap.EnableSpec(25);

Minimap.DisableSpec

function TRSMinimap.DisableSpec();

Attempts to disable the special attack.

Example:

WriteLn Minimap.DisableSpec();

Minimap.FindFlag

function TRSMinimap.FindFlag(out p: TPoint): Boolean;

Find the red flag when you are walking somewhere on the minimap.

Example:

if Minimap.FindFlag(p) then
  Debug(Box(p, 3, 3));

Minimap.HasFlag

function TRSMinimap.HasFlag(): Boolean;
function TRSMinimap.HasFlag(waitTime: Int32): Boolean; overload;

Returns whether the minimap has a red flag or not.

Example:

WriteLn Minimap.HasFlag();

Minimap.WaitFlag

procedure TRSMinimap.WaitFlag(UntilDistance: Int32 = 0);

Waits until we reach the red flag on the minimap when we are walking.


Minimap.FindDotShadows

function TRSMinimap.FindDotShadows(bmp: TMufasaBitmap): T2DPointArray;

Returns an ATPA of the found dot shadows in a bitmap of the minimap.

Example:

bmp.FromClient(Minimap.Bounds());
atpa := Minimap.FindDotShadows(bmp);
bmp.DrawATPA(atpa);
bmp.Debug();
bmp.Free();

Minimap.GetDotsBitmap

function TRSMinimap.GetDotsBitmap(BMP: TMufasaBitmap; Dots: ERSMinimapDots): TPointArray;

Returns the ERSMinimapDots found in a bitmap of the minimap.


Minimap.GetDots

function TRSMinimap.GetDots(dots: ERSMinimapDots; box: TBox): TPointArray;
function TRSMinimap.GetDots(dots: ERSMinimapDots): TPointArray; overload;
function TRSMinimap.GetDots(dot: ERSMinimapDot; box: TBox): TPointArray; overload;
function TRSMinimap.GetDots(Dot: ERSMinimapDot): TPointArray; overload;

Returns a TPointArray with the coordinates of the ERSMinimapDots found on the minimap.


Minimap.IsPlayerMoving

function TRSMinimap.IsPlayerMoving(MinShift: Integer = 500): Boolean;

Returns whether the player is moving or not according to the specified minimum pixel shift.

Example:

WriteLn Minimap.IsPlayerMoving();

Minimap.WaitPlayerMoving

procedure TRSMinimap.WaitPlayerMoving(MinShift: Integer = 500; Timeout: Int32 = 20000);

Waits for the player to stop moving.

Example:

Minimap.WaitPlayerMoving();

var Minimap

Global TRSMinimap variable.