Class Pathing


  • public class Pathing
    extends java.lang.Object
    Pathing system that handles player movement, pathfinding, and navigation
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Pathing.Direction
      Direction enum for movement in cardinal and diagonal directions
    • Constructor Summary

      Constructors 
      Constructor Description
      Pathing​(@NonNull rs.kreme.ksbot.api.KSContext ctx)
      Creates a new pathing system
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int calculateDanger​(net.runelite.api.coords.WorldPoint point, java.util.Collection<DangerousTile> dangerous)
      Calculates the danger level of a specific tile
      int compress​(int x, int y, int z)
      Compresses x, y, z coordinates into a single integer
      int compress​(net.runelite.api.coords.WorldPoint wp)
      Compresses a WorldPoint into a single integer for efficient storage
      java.util.List<net.runelite.api.coords.WorldPoint> constructPath​(java.util.Map<net.runelite.api.coords.WorldPoint,​net.runelite.api.coords.WorldPoint> cameFrom, net.runelite.api.coords.WorldPoint end)
      Reconstructs a path from a came-from map
      int countDangerousTiles​(java.util.List<net.runelite.api.coords.WorldPoint> path, java.util.Collection<DangerousTile> dangerous)
      Counts how many dangerous tiles are on a path
      net.runelite.api.coords.WorldArea derive​(net.runelite.api.coords.WorldArea toOffset, int offset)
      Expands a WorldArea by a specified offset in all directions
      net.runelite.api.coords.WorldPoint derive​(net.runelite.api.coords.WorldPoint point, int min, int max)
      Derives a random point near the specified point
      WorldArea derive​(WorldArea toOffset, int offset)
      Expands a WorldArea by a specified offset in all directions
      double distanceTo​(net.runelite.api.coords.LocalPoint a, net.runelite.api.coords.LocalPoint b)
      Calculates the distance between two local points
      double distanceTo​(net.runelite.api.coords.LocalPoint location, net.runelite.api.coords.WorldPoint point)
      Calculates the distance from a local point to a world point
      int distanceTo​(net.runelite.api.coords.WorldPoint worldPoint)
      Calculates the distance from player to a world point
      double distanceTo​(net.runelite.api.coords.WorldPoint a, net.runelite.api.coords.WorldPoint b)
      Calculates the distance between two world points
      int distanceTo​(Locatable obj)
      Calculates the distance from player to any locatable object
      int distanceTo​(KSNPC npc)
      Calculates the distance from player to an NPC
      int distanceTo​(KSObject obj)
      Calculates the distance from player to a game object
      int distanceTo​(KSPlayer player)
      Calculates the distance from player to another player
      int dx​(int compressed, int n)
      Offsets a compressed WorldPoint by X
      int dxy​(int compressed, int nx, int ny)
      Offsets a compressed WorldPoint by X and Y
      int dy​(int compressed, int n)
      Offsets a compressed WorldPoint by Y
      java.util.List<net.runelite.api.coords.WorldPoint> findMeleeRangePath​(net.runelite.api.NPC npc, java.util.Collection<DangerousTile> dangerous)
      Finds a path to get within melee range of an NPC while avoiding dangerous tiles
      net.runelite.api.coords.WorldPoint fromCompressed​(int compressed)
      Decompresses a compressed WorldPoint integer back into a WorldPoint
      net.runelite.api.coords.WorldPoint fromInstance​(net.runelite.api.coords.WorldPoint worldPoint)
      Converts an instanced WorldPoint to its template location
      net.runelite.api.coords.WorldPoint fromLocal​(net.runelite.api.coords.LocalPoint point)
      Converts a local point to world coordinates
      net.runelite.api.coords.LocalPoint fromWorldInstance​(net.runelite.api.coords.WorldPoint worldPoint)
      Converts an instanced WorldPoint to LocalPoint
      byte getCompressedPlane​(int compressed)
      Extracts the plane from a compressed WorldPoint
      short getCompressedX​(int compressed)
      Extracts the X coordinate from a compressed WorldPoint
      short getCompressedY​(int compressed)
      Extracts the Y coordinate from a compressed WorldPoint
      GameArea getGameRegion()
      Gets the current game region
      java.util.List<net.runelite.api.coords.WorldPoint> getPathToSafety​(java.util.Collection<DangerousTile> dangerous)
      Finds a safe path to escape from dangerous tiles
      int getRegion()
      Gets the current region ID
      int getRunEnergy()
      Gets the current run energy percentage
      net.runelite.api.coords.WorldPoint getTile​(Pathing.Direction direction, int steps)
      Gets a tile in a specific direction and distance from the player
      int getTileFlag​(net.runelite.api.coords.WorldPoint wp)
      Gets the tile flag for a specific world point
      java.util.List<net.runelite.api.coords.WorldPoint> getWalkable()
      Gets a list of all walkable tiles in the scene Uses caching for performance
      boolean inArea​(WorldArea area)
      Checks if the player is within a specified area
      boolean inGameRegion​(GameArea region)
      Checks if player is in a specific game region
      boolean inInstance()
      Checks if the player is in an instanced region
      boolean inMotion()
      Checks if the player is currently moving
      boolean inRegion​(int... ids)
      Checks if player is in one of the specified regions
      boolean isPathCompletelySafe​(java.util.List<net.runelite.api.coords.WorldPoint> path, java.util.Collection<DangerousTile> dangerous)
      Checks if a path is completely safe from dangerous tiles
      boolean isRunning()
      Checks if run mode is enabled
      boolean isTileLoaded​(net.runelite.api.coords.WorldPoint tile)
      Checks if a tile is loaded in the current scene
      boolean navThroughLocalPath​(java.util.List<net.runelite.api.coords.LocalPoint> pathToSafety)
      Navigates along a local path by finding the next point to move to
      boolean navThroughWorldPath​(java.util.List<net.runelite.api.coords.WorldPoint> pathToSafety)
      Navigates along a world path by finding the next point to move to
      boolean onTile​(net.runelite.api.coords.LocalPoint tile)
      Checks if the player is standing on a specific local tile
      boolean onTile​(net.runelite.api.coords.WorldPoint tile)
      Checks if the player is standing on a specific world tile
      java.util.List<net.runelite.api.coords.WorldPoint> safestPath​(net.runelite.api.coords.WorldPoint start, net.runelite.api.coords.WorldPoint end, java.util.Collection<DangerousTile> dangerous)
      Finds the safest path between two points, avoiding dangerous tiles
      java.util.List<net.runelite.api.coords.WorldPoint> shortestPath​(net.runelite.api.coords.WorldPoint start, net.runelite.api.coords.WorldPoint end)  
      java.util.List<net.runelite.api.coords.WorldPoint> shortestSafePath​(net.runelite.api.coords.WorldPoint start, net.runelite.api.coords.WorldPoint end, java.util.Collection<DangerousTile> dangerous)
      Finds the shortest path between two points that avoids dangerous tiles Uses breadth-first search algorithm
      int[] toCompressedPoints​(net.runelite.api.coords.WorldArea[] area)  
      int[] toCompressedPoints​(WorldArea... area)
      compresses all the points in the given WorldAreas into a single array of compressed points
      void toggleRun​(boolean enable)
      Toggles run mode on or off
      java.util.ArrayList<net.runelite.api.coords.WorldPoint> toInstance​(net.runelite.api.coords.WorldPoint worldPoint)
      Get all possible instance world points for the given world point.
      net.runelite.api.coords.LocalPoint toLocal​(net.runelite.api.coords.WorldPoint point)
      Converts a world point to local coordinates
      net.runelite.api.Tile toTile​(net.runelite.api.coords.WorldPoint wp)  
      boolean walkable​(net.runelite.api.coords.LocalPoint point)
      Checks if a local point is walkable
      boolean walkable​(net.runelite.api.coords.WorldPoint point)
      Checks if a world point is walkable
      boolean walkMiniMap​(net.runelite.api.coords.WorldPoint worldPoint, double zoomDistance)
      Walks to a specified world point by clicking the minimap.
      int walkPath​(java.util.List<net.runelite.api.coords.WorldPoint> path)
      Walks along a path by finding the farthest reachable point
      int walkPath​(net.runelite.api.coords.WorldPoint[] path)
      Walks along a path provided as an array
      int walkPath​(net.runelite.api.coords.WorldPoint[] path, boolean reverse)
      Walks along a given path of WorldPoints in either forward or reverse order.
      void walkPoint​(int x, int y)
      Walks to a specific x,y coordinate using the current plane
      void walkPoint​(net.runelite.api.coords.LocalPoint localPoint)
      Walks to a specific local point by converting it to world coordinates
      void walkPoint​(net.runelite.api.coords.WorldPoint walkPoint)
      Walks to a specific world point by simulating a click on the minimap
      void walkToTile​(net.runelite.api.coords.WorldPoint tile)
      Walks to a specific tile using the best available path Uses intelligent path selection to find optimal waypoints
      void walkToTile​(Pathing.Direction direction, int steps)
      Walks to a destination based on direction and number of steps
      boolean withinDanger​(net.runelite.api.coords.WorldPoint point, java.util.Collection<DangerousTile> dangerous)
      Checks if a point is within damage range of any dangerous tile
      boolean withinReaction​(net.runelite.api.coords.WorldPoint point, java.util.Collection<DangerousTile> dangerous)
      Checks if a point is within reaction range of any dangerous tile
      boolean withinReaction​(net.runelite.api.coords.WorldPoint point, java.util.Collection<DangerousTile> dangerous, int i)
      Checks if a point is within a specific reaction range of any dangerous tile
      net.runelite.api.Point worldToMinimap​(net.runelite.api.coords.WorldPoint worldPoint)
      Converts a world point to a minimap point.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • reachable

        public final Reachable reachable
      • directionsMap

        public final int[][] directionsMap
    • Constructor Detail

      • Pathing

        public Pathing​(@NonNull
                       @NonNull rs.kreme.ksbot.api.KSContext ctx)
        Creates a new pathing system
        Parameters:
        ctx - The script context
    • Method Detail

      • walkPoint

        public void walkPoint​(net.runelite.api.coords.LocalPoint localPoint)
        Walks to a specific local point by converting it to world coordinates
        Parameters:
        localPoint - The local coordinate to walk to
      • walkPoint

        public void walkPoint​(net.runelite.api.coords.WorldPoint walkPoint)
        Walks to a specific world point by simulating a click on the minimap
        Parameters:
        walkPoint - The world coordinate to walk to
      • walkToTile

        public void walkToTile​(net.runelite.api.coords.WorldPoint tile)
        Walks to a specific tile using the best available path Uses intelligent path selection to find optimal waypoints
        Parameters:
        tile - Destination tile
      • walkPoint

        public void walkPoint​(int x,
                              int y)
        Walks to a specific x,y coordinate using the current plane
        Parameters:
        x - The x coordinate
        y - The y coordinate
      • worldToMinimap

        public net.runelite.api.Point worldToMinimap​(net.runelite.api.coords.WorldPoint worldPoint)
        Converts a world point to a minimap point.
        Parameters:
        worldPoint - The world point to convert
        Returns:
        The minimap point, or null if conversion fails
      • walkMiniMap

        public boolean walkMiniMap​(net.runelite.api.coords.WorldPoint worldPoint,
                                   double zoomDistance)
        Walks to a specified world point by clicking the minimap.
        Parameters:
        worldPoint - The world point to walk toward
        zoomDistance - The desired minimap zoom level
        Returns:
        True if the minimap click was successful, false otherwise
      • getTileFlag

        public int getTileFlag​(net.runelite.api.coords.WorldPoint wp)
        Gets the tile flag for a specific world point
        Parameters:
        wp - The world point to check
        Returns:
        The tile flag value, or -1 if out of scene
      • shortestPath

        public java.util.List<net.runelite.api.coords.WorldPoint> shortestPath​(net.runelite.api.coords.WorldPoint start,
                                                                               net.runelite.api.coords.WorldPoint end)
      • walkPath

        public int walkPath​(java.util.List<net.runelite.api.coords.WorldPoint> path)
        Walks along a path by finding the farthest reachable point
        Parameters:
        path - The path to walk
        Returns:
        The distance to the selected point, or -1 if no point could be selected
      • isTileLoaded

        public boolean isTileLoaded​(net.runelite.api.coords.WorldPoint tile)
        Checks if a tile is loaded in the current scene
        Parameters:
        tile - The tile to check
        Returns:
        true if the tile is in the loaded scene
      • walkPath

        public int walkPath​(net.runelite.api.coords.WorldPoint[] path)
        Walks along a path provided as an array
        Parameters:
        path - The array of points to walk
        Returns:
        The distance to the selected point, or -1 if no point could be selected
      • walkPath

        public int walkPath​(net.runelite.api.coords.WorldPoint[] path,
                            boolean reverse)
        Walks along a given path of WorldPoints in either forward or reverse order.

        The method checks the player's current location and determines the next point to walk to if the player is within 5 tiles of a path node.

        Parameters:
        path - an array of WorldPoint representing the path to follow
        reverse - if true, walks the path in reverse order (end to start); if false, walks it forward (start to end)
        Returns:
        the distance to the next target point, or -1 if no suitable point is found
      • onTile

        public boolean onTile​(net.runelite.api.coords.WorldPoint tile)
        Checks if the player is standing on a specific world tile
        Parameters:
        tile - The tile to check
        Returns:
        true if player is on the tile
      • onTile

        public boolean onTile​(net.runelite.api.coords.LocalPoint tile)
        Checks if the player is standing on a specific local tile
        Parameters:
        tile - The local tile to check
        Returns:
        true if player is on the tile
      • constructPath

        public java.util.List<net.runelite.api.coords.WorldPoint> constructPath​(java.util.Map<net.runelite.api.coords.WorldPoint,​net.runelite.api.coords.WorldPoint> cameFrom,
                                                                                net.runelite.api.coords.WorldPoint end)
        Reconstructs a path from a came-from map
        Parameters:
        cameFrom - The map tracking which node led to each node
        end - The end point of the path
        Returns:
        The complete path from start to end
      • fromLocal

        public net.runelite.api.coords.WorldPoint fromLocal​(net.runelite.api.coords.LocalPoint point)
        Converts a local point to world coordinates
        Parameters:
        point - Local point
        Returns:
        World point
      • toLocal

        public net.runelite.api.coords.LocalPoint toLocal​(net.runelite.api.coords.WorldPoint point)
        Converts a world point to local coordinates
        Parameters:
        point - World point
        Returns:
        Local point
      • walkable

        public boolean walkable​(net.runelite.api.coords.LocalPoint point)
        Checks if a local point is walkable
        Parameters:
        point - Local point to check
        Returns:
        true if walkable
      • walkable

        public boolean walkable​(net.runelite.api.coords.WorldPoint point)
        Checks if a world point is walkable
        Parameters:
        point - World point to check
        Returns:
        true if walkable
      • getWalkable

        public java.util.List<net.runelite.api.coords.WorldPoint> getWalkable()
        Gets a list of all walkable tiles in the scene Uses caching for performance
        Returns:
        List of walkable world points
      • distanceTo

        public double distanceTo​(net.runelite.api.coords.LocalPoint a,
                                 net.runelite.api.coords.LocalPoint b)
        Calculates the distance between two local points
        Parameters:
        a - First local point
        b - Second local point
        Returns:
        Distance in tiles
      • distanceTo

        public double distanceTo​(net.runelite.api.coords.LocalPoint location,
                                 net.runelite.api.coords.WorldPoint point)
        Calculates the distance from a local point to a world point
        Parameters:
        location - Local point
        point - World point
        Returns:
        Distance in tiles
      • distanceTo

        public double distanceTo​(net.runelite.api.coords.WorldPoint a,
                                 net.runelite.api.coords.WorldPoint b)
        Calculates the distance between two world points
        Parameters:
        a - First world point
        b - Second world point
        Returns:
        Distance in tiles
      • distanceTo

        public int distanceTo​(net.runelite.api.coords.WorldPoint worldPoint)
        Calculates the distance from player to a world point
        Parameters:
        worldPoint - Destination point
        Returns:
        Distance in tiles
      • distanceTo

        public int distanceTo​(KSPlayer player)
        Calculates the distance from player to another player
        Parameters:
        player - Target player
        Returns:
        Distance in tiles
      • distanceTo

        public int distanceTo​(KSNPC npc)
        Calculates the distance from player to an NPC
        Parameters:
        npc - Target NPC
        Returns:
        Distance in tiles
      • distanceTo

        public int distanceTo​(Locatable obj)
        Calculates the distance from player to any locatable object
        Parameters:
        obj - Target locatable object
        Returns:
        Distance in tiles
      • distanceTo

        public int distanceTo​(KSObject obj)
        Calculates the distance from player to a game object
        Parameters:
        obj - Target game object
        Returns:
        Distance in tiles
      • inRegion

        public boolean inRegion​(int... ids)
        Checks if player is in one of the specified regions
        Parameters:
        ids - Region IDs to check
        Returns:
        true if player is in one of the regions
      • getRegion

        public int getRegion()
        Gets the current region ID
        Returns:
        The region ID, or -1 if unable to determine
      • inInstance

        public boolean inInstance()
        Checks if the player is in an instanced region
        Returns:
        true if in an instance
      • isRunning

        public boolean isRunning()
        Checks if run mode is enabled
        Returns:
        true if running is enabled
      • toggleRun

        public void toggleRun​(boolean enable)
        Toggles run mode on or off
        Parameters:
        enable - true to enable running, false to disable
      • getRunEnergy

        public int getRunEnergy()
        Gets the current run energy percentage
        Returns:
        Run energy (0-100)
      • navThroughWorldPath

        public boolean navThroughWorldPath​(java.util.List<net.runelite.api.coords.WorldPoint> pathToSafety)
        Navigates along a world path by finding the next point to move to
        Parameters:
        pathToSafety - The path to follow
        Returns:
        true if navigation succeeded
      • navThroughLocalPath

        public boolean navThroughLocalPath​(java.util.List<net.runelite.api.coords.LocalPoint> pathToSafety)
        Navigates along a local path by finding the next point to move to
        Parameters:
        pathToSafety - The local path to follow
        Returns:
        true if navigation succeeded
      • getPathToSafety

        public java.util.List<net.runelite.api.coords.WorldPoint> getPathToSafety​(java.util.Collection<DangerousTile> dangerous)
        Finds a safe path to escape from dangerous tiles
        Parameters:
        dangerous - Collection of dangerous tiles to avoid
        Returns:
        Path to safety
      • shortestSafePath

        public java.util.List<net.runelite.api.coords.WorldPoint> shortestSafePath​(net.runelite.api.coords.WorldPoint start,
                                                                                   net.runelite.api.coords.WorldPoint end,
                                                                                   java.util.Collection<DangerousTile> dangerous)
        Finds the shortest path between two points that avoids dangerous tiles Uses breadth-first search algorithm
        Parameters:
        start - The starting point
        end - The destination point
        dangerous - Collection of dangerous tiles to avoid
        Returns:
        List of WorldPoints forming a path, or empty list if no path exists
      • findMeleeRangePath

        public java.util.List<net.runelite.api.coords.WorldPoint> findMeleeRangePath​(net.runelite.api.NPC npc,
                                                                                     java.util.Collection<DangerousTile> dangerous)
        Finds a path to get within melee range of an NPC while avoiding dangerous tiles
        Parameters:
        npc - The NPC to path to
        dangerous - Collection of tiles to avoid
        Returns:
        List of WorldPoints forming a path, or empty list if no path exists
      • withinReaction

        public boolean withinReaction​(net.runelite.api.coords.WorldPoint point,
                                      java.util.Collection<DangerousTile> dangerous)
        Checks if a point is within reaction range of any dangerous tile
        Parameters:
        point - Point to check
        dangerous - Collection of dangerous tiles
        Returns:
        true if within reaction range
      • withinReaction

        public boolean withinReaction​(net.runelite.api.coords.WorldPoint point,
                                      java.util.Collection<DangerousTile> dangerous,
                                      int i)
        Checks if a point is within a specific reaction range of any dangerous tile
        Parameters:
        point - Point to check
        dangerous - Collection of dangerous tiles
        i - Reaction radius multiplier
        Returns:
        true if within specified reaction range
      • withinDanger

        public boolean withinDanger​(net.runelite.api.coords.WorldPoint point,
                                    java.util.Collection<DangerousTile> dangerous)
        Checks if a point is within damage range of any dangerous tile
        Parameters:
        point - Point to check
        dangerous - Collection of dangerous tiles
        Returns:
        true if within damage range
      • safestPath

        public java.util.List<net.runelite.api.coords.WorldPoint> safestPath​(net.runelite.api.coords.WorldPoint start,
                                                                             net.runelite.api.coords.WorldPoint end,
                                                                             java.util.Collection<DangerousTile> dangerous)
        Finds the safest path between two points, avoiding dangerous tiles
        Parameters:
        start - Starting point
        end - Target point
        dangerous - Collection of dangerous tiles to avoid
        Returns:
        Safest path
      • calculateDanger

        public int calculateDanger​(net.runelite.api.coords.WorldPoint point,
                                   java.util.Collection<DangerousTile> dangerous)
        Calculates the danger level of a specific tile
        Parameters:
        point - Tile to check
        dangerous - Collection of dangerous tiles
        Returns:
        Danger level, or Integer.MAX_VALUE if impassable
      • countDangerousTiles

        public int countDangerousTiles​(java.util.List<net.runelite.api.coords.WorldPoint> path,
                                       java.util.Collection<DangerousTile> dangerous)
        Counts how many dangerous tiles are on a path
        Parameters:
        path - Path to check
        dangerous - Collection of dangerous tiles
        Returns:
        Count of dangerous tiles on the path
      • isPathCompletelySafe

        public boolean isPathCompletelySafe​(java.util.List<net.runelite.api.coords.WorldPoint> path,
                                            java.util.Collection<DangerousTile> dangerous)
        Checks if a path is completely safe from dangerous tiles
        Parameters:
        path - Path to check
        dangerous - Collection of dangerous tiles
        Returns:
        true if the path is completely safe
      • inArea

        public boolean inArea​(WorldArea area)
        Checks if the player is within a specified area
        Parameters:
        area - Area to check
        Returns:
        true if player is in the area
      • getGameRegion

        public GameArea getGameRegion()
        Gets the current game region
        Returns:
        Current game region
      • inGameRegion

        public boolean inGameRegion​(GameArea region)
        Checks if player is in a specific game region
        Parameters:
        region - Region to check
        Returns:
        true if player is in the specified region
      • derive

        public net.runelite.api.coords.WorldPoint derive​(net.runelite.api.coords.WorldPoint point,
                                                         int min,
                                                         int max)
        Derives a random point near the specified point
        Parameters:
        point - Base point
        min - Minimum offset
        max - Maximum offset
        Returns:
        Random point within range
      • derive

        public WorldArea derive​(WorldArea toOffset,
                                int offset)
        Expands a WorldArea by a specified offset in all directions
        Parameters:
        toOffset - The area to offset
        offset - The number of tiles to expand in each direction
        Returns:
        The expanded WorldArea
      • derive

        public net.runelite.api.coords.WorldArea derive​(net.runelite.api.coords.WorldArea toOffset,
                                                        int offset)
        Expands a WorldArea by a specified offset in all directions
        Parameters:
        toOffset - The area to offset
        offset - The number of tiles to expand in each direction
        Returns:
        The expanded WorldArea
      • compress

        public int compress​(net.runelite.api.coords.WorldPoint wp)
        Compresses a WorldPoint into a single integer for efficient storage
        Parameters:
        wp - WorldPoint to compress
        Returns:
        Compressed integer representation
      • compress

        public int compress​(int x,
                            int y,
                            int z)
        Compresses x, y, z coordinates into a single integer
        Parameters:
        x - X coordinate (0-16383)
        y - Y coordinate (0-32767)
        z - Z/plane coordinate (0-7)
        Returns:
        Compressed integer representation
      • fromCompressed

        public net.runelite.api.coords.WorldPoint fromCompressed​(int compressed)
        Decompresses a compressed WorldPoint integer back into a WorldPoint
        Parameters:
        compressed - Compressed integer
        Returns:
        WorldPoint
      • getCompressedX

        public short getCompressedX​(int compressed)
        Extracts the X coordinate from a compressed WorldPoint
        Parameters:
        compressed - Compressed WorldPoint
        Returns:
        X coordinate
      • getCompressedY

        public short getCompressedY​(int compressed)
        Extracts the Y coordinate from a compressed WorldPoint
        Parameters:
        compressed - Compressed WorldPoint
        Returns:
        Y coordinate
      • getCompressedPlane

        public byte getCompressedPlane​(int compressed)
        Extracts the plane from a compressed WorldPoint
        Parameters:
        compressed - Compressed WorldPoint
        Returns:
        Plane (0-7)
      • dx

        public int dx​(int compressed,
                      int n)
        Offsets a compressed WorldPoint by X
        Parameters:
        compressed - Compressed WorldPoint
        n - X offset
        Returns:
        New compressed WorldPoint
      • dy

        public int dy​(int compressed,
                      int n)
        Offsets a compressed WorldPoint by Y
        Parameters:
        compressed - Compressed WorldPoint
        n - Y offset
        Returns:
        New compressed WorldPoint
      • dxy

        public int dxy​(int compressed,
                       int nx,
                       int ny)
        Offsets a compressed WorldPoint by X and Y
        Parameters:
        compressed - Compressed WorldPoint
        nx - X offset
        ny - Y offset
        Returns:
        New compressed WorldPoint
      • fromInstance

        public net.runelite.api.coords.WorldPoint fromInstance​(net.runelite.api.coords.WorldPoint worldPoint)
        Converts an instanced WorldPoint to its template location
        Parameters:
        worldPoint - WorldPoint in instance
        Returns:
        Template WorldPoint
      • fromWorldInstance

        public net.runelite.api.coords.LocalPoint fromWorldInstance​(net.runelite.api.coords.WorldPoint worldPoint)
        Converts an instanced WorldPoint to LocalPoint
        Parameters:
        worldPoint - WorldPoint in instance
        Returns:
        LocalPoint localPoint
      • toInstance

        public java.util.ArrayList<net.runelite.api.coords.WorldPoint> toInstance​(net.runelite.api.coords.WorldPoint worldPoint)
        Get all possible instance world points for the given world point.
        Parameters:
        worldPoint - worldpoint
        Returns:
        the list of possible instance world points
      • inMotion

        public boolean inMotion()
        Checks if the player is currently moving
        Returns:
        true if player is in motion
      • walkToTile

        public void walkToTile​(Pathing.Direction direction,
                               int steps)
        Walks to a destination based on direction and number of steps
        Parameters:
        direction - The direction to move in
        steps - The number of tiles to move
      • getTile

        public net.runelite.api.coords.WorldPoint getTile​(Pathing.Direction direction,
                                                          int steps)
        Gets a tile in a specific direction and distance from the player
        Parameters:
        direction - The direction from player
        steps - The number of tiles away
        Returns:
        WorldPoint at the specified position
      • toTile

        public net.runelite.api.Tile toTile​(net.runelite.api.coords.WorldPoint wp)
      • toCompressedPoints

        public int[] toCompressedPoints​(WorldArea... area)
        compresses all the points in the given WorldAreas into a single array of compressed points
        Parameters:
        area - the WorldAreas
        Returns:
        the compressed points
      • toCompressedPoints

        public int[] toCompressedPoints​(net.runelite.api.coords.WorldArea[] area)