# Minimap Methods to interact with the minimap. - - - (TMinimap)= ## type TMinimap ```pascal 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 ```pascal function TMinimap.GetLevel(Orb: TCircle): Int32; ``` Returns the level of the specified orb. Example: ```pascal WriteLn Minimap.GetLevel(Minimap.GetSpecAttackCircle()); ``` - - - ## Minimap.GetRunEnergy ```pascal function TMinimap.GetRunEnergy(): Int32; ``` Returns the run energy level. Example: ```pascal WriteLn Minimap.GetRunEnergy(); ``` - - - ## Minimap.GetHPLevel ```pascal function TMinimap.GetHPLevel(): Int32; ``` Returns the current hp level. Example: ```pascal WriteLn Minimap.GetHPLevel(); ``` - - - ## Minimap.GetHPPercent ```pascal function TMinimap.GetHPPercent(): Int32; ``` Returns the current hp percentage level. Example: ```pascal WriteLn Minimap.GetHPPercent(); ``` - - - ## Minimap.GetPrayerLevel ```pascal function TMinimap.GetPrayerLevel(): Int32; ``` Returns the current prayer level. Example: ```pascal WriteLn Minimap.GetPrayerLevel(); ``` - - - ## Minimap.GetPrayerPercent ```pascal function TMinimap.GetPrayerPercent(): Int32; ``` Returns the current Prayer percentage level. Example: ```pascal WriteLn Minimap.GetPrayerPercent(); ``` - - - ## Minimap.GetSpecLevel ```pascal function TMinimap.GetSpecLevel(): Int32; ``` Returns the current special attack level. Example: ```pascal WriteLn Minimap.GetSpecLevel(); ``` - - - ## Minimap.GetCompassAngle ```pascal function TMinimap.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 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: ```pascal Minimap.SetCompassAngle(180); ``` - - - ## Minimap.IsPointOn ```pascal 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 ```pascal function TMinimap.Filter(arr: TPointArray): TPointArray; ``` Filters the given TPointArray and returns only the points that are visible in the Minimap. - - - ## Minimap.RandomPointOn ```pascal 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 ```pascal 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: ```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 TMinimap.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 TMinimap.EnableRun(): Boolean; ``` Attempts to enable the run energy by clicking the run orb. Example: ```pascal Writeln Minimap.EnableRun(); ``` - - - ## Minimap.DisableRun ```pascal function TMinimap.DisableRun(): Boolean; ``` Attempts to disable the run energy by clicking the run orb. Example: ```pascal Writeln Minimap.DisableRun(); ``` - - - ## Minimap.EnablePrayer ```pascal function TMinimap.EnablePrayer(): Boolean; ``` Attempts to enable quick prayers by clicking the prayer orb. Example: ```pascal Writeln Minimap.EnablePrayer(); ``` - - - ## Minimap.DisablePrayer ```pascal function TMinimap.DisablePrayer(): Boolean; ``` Attempts to disable quick prayers by clicking the prayer orb. Example: ```pascal Writeln Minimap.DisablePrayer(); ``` - - - ## Minimap.EnableSpec ```pascal function TMinimap.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 TMinimap.DisableSpec(); ``` Attempts to disable the special attack. Example: ```pascal WriteLn Minimap.DisableSpec(); ``` - - - ## Minimap.FindFlag ```pascal function TMinimap.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 TMinimap.HasFlag(): Boolean; function TMinimap.HasFlag(waitTime: Int32): Boolean; overload; ``` Returns whether the minimap has a red flag or not. Example: ```pascal WriteLn Minimap.HasFlag(); ``` - - - ## Minimap.WaitFlag ```pascal procedure TMinimap.WaitFlag(UntilDistance: Int32 = 0); ``` Waits until we reach the red flag on the minimap when we are walking. - - - ## Minimap.FindDotShadows ```pascal function TMinimap.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 TMinimap.GetDotsBitmap(BMP: TMufasaBitmap; Dots: EMinimapDots): TPointArray; ``` Returns the EMinimapDots found in a bitmap of the minimap. - - - ## Minimap.GetDots ```pascal 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 ```pascal 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 ```pascal 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: ```pascal Minimap.GetCleanMinimap().Debug(); ``` - - - ## TMinimap.ScaleMinimap ```pascal 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: ```pascal Minimap.ScaleMinimap(Minimap.GetCleanMinimap(), 4).Debug(); ``` - - - ## Minimap.IsPlayerMoving ```pascal function TMinimap.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 TMinimap.WaitPlayerMoving(MinShift: Integer = 500; Timeout: Int32 = 20000); ``` Waits for the player to stop moving. Example: ```pascal Minimap.WaitPlayerMoving(); ``` - - - (Minimap)= ## var Minimap Global `TMinimap` variable.