# Minimap Methods to interact with the minimap. - - - (TRSMinimap)= ## type TRSMinimap ```pascal 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 ```pascal function TRSMinimap.GetCompassCircle(): TCircle; ``` Returns the compass circle. Example: ```pascal circle := Minimap.GetCompassCircle(); Debug(circle.ToTPA()); ``` - - - ## Minimap.GetXPCircle ```pascal function TRSMinimap.GetXPCircle(): TCircle; ``` Returns the xp bar circle. Example: ```pascal circle := Minimap.GetXPCircle(); Debug(circle.ToTPA()); ``` - - - ## Minimap.GetHPCircle ```pascal function TRSMinimap.GetHPCircle(): TCircle; ``` Returns the hp circle. Example: ```pascal circle := Minimap.GetHPCircle(); Debug(circle.ToTPA()); ``` - - - ## Minimap.GetPrayerCircle ```pascal function TRSMinimap.GetPrayerCircle(): TCircle; ``` Returns the prayer circle. Example: ```pascal circle := Minimap.GetPrayerCircle(); Debug(circle.ToTPA()); ``` - - - ## Minimap.GetRunCircle ```pascal function TRSMinimap.GetRunCircle(): TCircle; ``` Returns the run energy circle. Example: ```pascal circle := Minimap.GetRunCircle(); Debug(circle.ToTPA()); ``` - - - ## Minimap.GetSpecAttackCircle ```pascal function TRSMinimap.GetSpecAttackCircle(): TCircle; ``` Returns the special attack circle. Example: ```pascal circle := Minimap.GetSpecAttackCircle(); Debug(circle.ToTPA()); ``` - - - ## Minimap.GetOrbLevel ```pascal function TRSMinimap.GetOrbLevel(Orb: TCircle): Int32; ``` Returns the level of the specified orb. Example: ```pascal WriteLn Minimap.GetOrbLevel(Minimap.GetSpecAttackCircle()); ``` - - - ## Minimap.GetRunEnergy ```pascal function TRSMinimap.GetRunEnergy(): Int32; ``` Returns the run energy level. Example: ```pascal WriteLn Minimap.GetRunEnergy(); ``` - - - ## Minimap.GetHPLevel ```pascal function TRSMinimap.GetHPLevel(): Int32; ``` Returns the current hp level. Example: ```pascal WriteLn Minimap.GetHPLevel(); ``` - - - ## Minimap.GetHPPercent ```pascal function TRSMinimap.GetHPPercent(): Int32; ``` Returns the current hp percentage level. Example: ```pascal WriteLn Minimap.GetHPPercent(); ``` - - - ## Minimap.GetPrayerLevel ```pascal function TRSMinimap.GetPrayerLevel(): Int32; ``` Returns the current prayer level. Example: ```pascal WriteLn Minimap.GetPrayerLevel(); ``` - - - ## Minimap.GetPrayerPercent ```pascal function TRSMinimap.GetPrayerPercent(): Int32; ``` Returns the current Prayer percentage level. Example: ```pascal WriteLn Minimap.GetPrayerPercent(); ``` - - - ## Minimap.GetSpecLevel ```pascal function TRSMinimap.GetSpecLevel(): Int32; ``` Returns the current special attack level. Example: ```pascal WriteLn Minimap.GetSpecLevel(); ``` - - - ## Minimap.GetPolygon ```pascal function TRSMinimap.GetPolygon(): TPointArray; ``` Returns the minimap polygon which is not a perfect circle. Example: ```pascal Debug(Minimap.GetPolygon().Connect()); ``` - - - ## Minimap.GetCompassAngle ```pascal function TRSMinimap.GetCompassAngle(asDegrees: Boolean = True): Double; ``` Returns the current compass angle as degrees or radians. ```{note} Credits to Slacky ``` Example: ```pascal WriteLn Minimap.GetCompassAngle(); ``` - - - ## Minimap.SetCompassAngle ```pascal procedure TRSMinimap.SetCompassAngleEx(degrees, accuracy: Double); procedure TRSMinimap.SetCompassAngle(degrees: Double); procedure TRSMinimap.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: ```pascal Minimap.SetCompassAngle(180); ``` - - - ## Minimap.IsPointOn ```pascal 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 ```pascal function TRSMinimap.Filter(arr: TPointArray): TPointArray; ``` Filters the given TPointArray and returns only the points that are visible in the Minimap. - - - ## Minimap.RandomPointOn ```pascal 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 ```pascal 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: ```pascal Writeln Minimap.IsPoisoned(); WriteLn Minimap.IsEnvenomed(); Writeln Minimap.IsRunEnabled(); Writeln Minimap.IsPrayerEnabled(); WriteLn Minimap.HasStamina(); Writeln Minimap.IsPrayerEnabled(); Writeln Minimap.IsSpecWeapon(); ``` - - - ## Minimap.CurePoison ```pascal 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: ```pascal Writeln Minimap.CurePoison(); ``` - - - ## Minimap.EnableRun ```pascal function TRSMinimap.EnableRun(): Boolean; ``` Attempts to enable the run energy by clicking the run orb. Example: ```pascal Writeln Minimap.EnableRun(); ``` - - - ## Minimap.DisableRun ```pascal function TRSMinimap.DisableRun(): Boolean; ``` Attempts to disable the run energy by clicking the run orb. Example: ```pascal Writeln Minimap.DisableRun(); ``` - - - ## Minimap.EnablePrayer ```pascal function TRSMinimap.EnablePrayer(): Boolean; ``` Attempts to enable quick prayers by clicking the prayer orb. Example: ```pascal Writeln Minimap.EnablePrayer(); ``` - - - ## Minimap.DisablePrayer ```pascal function TRSMinimap.DisablePrayer(): Boolean; ``` Attempts to disable quick prayers by clicking the prayer orb. Example: ```pascal Writeln Minimap.DisablePrayer(); ``` - - - ## Minimap.EnableSpec ```pascal function TRSMinimap.EnableSpec(minSpec: Int32): Boolean; ``` Attempts to enable the special attack if we have at leas **minSpec** special attack level. Example: ```pascal WriteLn Minimap.EnableSpec(25); ``` - - - ## Minimap.DisableSpec ```pascal function TRSMinimap.DisableSpec(); ``` Attempts to disable the special attack. Example: ```pascal WriteLn Minimap.DisableSpec(); ``` - - - ## Minimap.FindFlag ```pascal function TRSMinimap.FindFlag(out p: TPoint): Boolean; ``` Find the red flag when you are walking somewhere on the minimap. Example: ```pascal if Minimap.FindFlag(p) then Debug(Box(p, 3, 3)); ``` - - - ## Minimap.HasFlag ```pascal function TRSMinimap.HasFlag(): Boolean; function TRSMinimap.HasFlag(waitTime: Int32): Boolean; overload; ``` Returns whether the minimap has a red flag or not. Example: ```pascal WriteLn Minimap.HasFlag(); ``` - - - ## Minimap.WaitFlag ```pascal procedure TRSMinimap.WaitFlag(UntilDistance: Int32 = 0); ``` Waits until we reach the red flag on the minimap when we are walking. - - - ## Minimap.FindDotShadows ```pascal function TRSMinimap.FindDotShadows(bmp: TMufasaBitmap): T2DPointArray; ``` Returns an ATPA of the found dot shadows in a bitmap of the minimap. Example: ```pascal bmp.FromClient(Minimap.Bounds()); atpa := Minimap.FindDotShadows(bmp); bmp.DrawATPA(atpa); bmp.Debug(); bmp.Free(); ``` - - - ## Minimap.GetDotsBitmap ```pascal function TRSMinimap.GetDotsBitmap(BMP: TMufasaBitmap; Dots: ERSMinimapDots): TPointArray; ``` Returns the ERSMinimapDots found in a bitmap of the minimap. - - - ## Minimap.GetDots ```pascal 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.CleanMinimap ```pascal procedure TRSMinimap.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 ```pascal function TRSMinimap.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: ```pascal Minimap.GetCleanMinimap().Debug(); ``` - - - ## TRSMinimap.ScaleMinimap ```pascal function TRSMinimap.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: ```pascal Minimap.ScaleMinimap(Minimap.GetCleanMinimap(), 4).Debug(); ``` - - - ## Minimap.IsPlayerMoving ```pascal function TRSMinimap.IsPlayerMoving(MinShift: Integer = 500): Boolean; ``` Returns whether the player is moving or not according to the specified minimum pixel shift. Example: ```pascal WriteLn Minimap.IsPlayerMoving(); ``` - - - ## Minimap.WaitPlayerMoving ```pascal procedure TRSMinimap.WaitPlayerMoving(MinShift: Integer = 500; Timeout: Int32 = 20000); ``` Waits for the player to stop moving. Example: ```pascal Minimap.WaitPlayerMoving(); ``` - - - (Minimap)= ## var Minimap Global `TRSMinimap` variable.