Minimap

Methods to interact with the minimap.


type TMinimap

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

TMinimap type used to interact with the minimap


Minimap.GetOrbLevel

function TMinimap.GetLevel(Orb: TCircle): Int32;

Returns the level of the specified orb.

Example:

WriteLn Minimap.GetLevel(Minimap.GetSpecAttackCircle());

Minimap.GetRunEnergy

function TMinimap.GetRunEnergy(): Int32;

Returns the run energy level.

Example:

WriteLn Minimap.GetRunEnergy();

Minimap.GetHPLevel

function TMinimap.GetHPLevel(): Int32;

Returns the current hp level.

Example:

WriteLn Minimap.GetHPLevel();

Minimap.GetHPPercent

function TMinimap.GetHPPercent(): Int32;

Returns the current hp percentage level.

Example:

WriteLn Minimap.GetHPPercent();

Minimap.GetPrayerLevel

function TMinimap.GetPrayerLevel(): Int32;

Returns the current prayer level.

Example:

WriteLn Minimap.GetPrayerLevel();

Minimap.GetPrayerPercent

function TMinimap.GetPrayerPercent(): Int32;

Returns the current Prayer percentage level.

Example:

WriteLn Minimap.GetPrayerPercent();

Minimap.GetSpecLevel

function TMinimap.GetSpecLevel(): Int32;

Returns the current special attack level.

Example:

WriteLn Minimap.GetSpecLevel();

Minimap.GetCompassAngle

function TMinimap.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 TMinimap.SetCompassAngleEx(degrees, accuracy: Double);
procedure TMinimap.SetCompassAngle(degrees: Double);
procedure TMinimap.SetCompassAngle(minDegrees, maxDegrees: Double); overload;

Sets the current compass angle. If you specify a minimum and a maximum angle a gaussian distribution will be used.

Example:

Minimap.SetCompassAngle(180);

Minimap.IsPointOn

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

Checks if a point is on the minimap.


Minimap.Filter

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

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


Minimap.RandomPointOn

function TMinimap.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 TMinimap.IsPoisoned(): Boolean;
function TMinimap.IsEnvenomed();
function TMinimap.IsRunEnabled(): Boolean;
function TMinimap.IsPrayerEnabled(): Boolean;
function TMinimap.HasStamina();
function TMinimap.IsSpecEnabled(): Boolean;
function TMinimap.IsSpecWeapon();

Returns whether the player has the specified status or not. For the TMinimap.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 TMinimap.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 TMinimap.EnableRun(): Boolean;

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

Example:

Writeln Minimap.EnableRun();

Minimap.DisableRun

function TMinimap.DisableRun(): Boolean;

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

Example:

Writeln Minimap.DisableRun();

Minimap.EnablePrayer

function TMinimap.EnablePrayer(): Boolean;

Attempts to enable quick prayers by clicking the prayer orb.

Example:

Writeln Minimap.EnablePrayer();

Minimap.DisablePrayer

function TMinimap.DisablePrayer(): Boolean;

Attempts to disable quick prayers by clicking the prayer orb.

Example:

Writeln Minimap.DisablePrayer();

Minimap.EnableSpec

function TMinimap.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 TMinimap.DisableSpec();

Attempts to disable the special attack.

Example:

WriteLn Minimap.DisableSpec();

Minimap.FindFlag

function TMinimap.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 TMinimap.HasFlag(): Boolean;
function TMinimap.HasFlag(waitTime: Int32): Boolean; overload;

Returns whether the minimap has a red flag or not.

Example:

WriteLn Minimap.HasFlag();

Minimap.WaitFlag

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

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


Minimap.FindDotShadows

function TMinimap.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 TMinimap.GetDotsBitmap(BMP: TMufasaBitmap; Dots: EMinimapDots): TPointArray;

Returns the EMinimapDots found in a bitmap of the minimap.


Minimap.GetDots

function TMinimap.GetDots(dots: EMinimapDots; box: TBox): TPointArray;
function TMinimap.GetDots(dots: EMinimapDots): TPointArray; overload;
function TMinimap.GetDots(dot: EMinimapDot; box: TBox): TPointArray; overload;
function TMinimap.GetDots(Dot: EMinimapDot): TPointArray; overload;

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


Minimap.CleanMinimap

procedure TMinimap.CleanMinimap(bitmap: TMufasaBitmap);

Method used to clear minimap dots from a minimap bitmap (image). You probably don’t need to use this, it’s an internal method.


Minimap.GetCleanMinimap

function TMinimap.GetCleanMinimap(angle: Double = $FFFF): TMufasaBitmap;

Method used to “screenshot” the minimap and clean it with Minimap.CleanMinimap(). You probably don’t need to use this directly but you can see what it does in the following example.

Example:

Minimap.GetCleanMinimap().Debug();

TMinimap.ScaleMinimap

function TMinimap.ScaleMinimap(bitmap: TMufasaBitmap; scaling: Int32): TMufasaBitmap;

Method used to scale down the minimap. You probably don’t need to use this directly but you can see what it does in the following example.

Example:

Minimap.ScaleMinimap(Minimap.GetCleanMinimap(), 4).Debug();

Minimap.IsPlayerMoving

function TMinimap.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 TMinimap.WaitPlayerMoving(MinShift: Integer = 500; Timeout: Int32 = 20000);

Waits for the player to stop moving.

Example:

Minimap.WaitPlayerMoving();

var Minimap

Global TMinimap variable.