Class Walking


  • public class Walking
    extends java.lang.Object
    This class provides methods for walking, setting destination and walk conditions, checking run energy and more.
    • Constructor Detail

      • Walking

        public Walking()
    • Method Detail

      • getBlacklistedTeleports

        public static java.util.HashSet<Teleport> getBlacklistedTeleports()
      • addBlacklistedTeleport

        public static void addBlacklistedTeleport​(Teleport teleport)
      • removeBlacklistedTeleport

        public static void removeBlacklistedTeleport​(Teleport teleport)
      • isBlacklisted

        public static boolean isBlacklisted​(Teleport teleport)
      • clearBlacklistedTeleports

        public static void clearBlacklistedTeleports()
      • setLogging

        public static void setLogging​(boolean logging)
        Parameters:
        logging - true if the walking actions should be logged, false otherwise
      • setApiKey

        public static void setApiKey​(java.lang.String apiKey)
        Sets the api key to use for the walker api.
        Parameters:
        apiKey -
      • setApiSecret

        public static void setApiSecret​(java.lang.String apiSecret)
        Sets the api secret to use for the walker api.
        Parameters:
        apiSecret -
      • addPathLink

        public static void addPathLink​(PathLink pathLink)
        Adds a path link.
        Parameters:
        pathLink -
      • removePathLink

        public static void removePathLink​(PathLink pathLink)
        Removes a path link.
        Parameters:
        pathLink -
      • setWaitDistanceSupplier

        public static void setWaitDistanceSupplier​(java.util.function.Supplier<java.lang.Integer> waitDistanceSupplier)
        Sets the supplier for wait distance used in walking actions.
        Parameters:
        waitDistanceSupplier - the supplier for wait distance
      • setDestinationDistanceSupplier

        public static void setDestinationDistanceSupplier​(java.util.function.Supplier<java.lang.Integer> destinationDistanceSupplier)
        Sets the supplier for the destination distance.
        Parameters:
        destinationDistanceSupplier - the supplier for the destination distance.
      • walk

        public static WalkState walk​(Positionable destination)
        Walks the player to the specified destination.
        Parameters:
        destination - the location the player should walk to
        Returns:
        the state indicating the success of the walk operation
      • walk

        public static WalkState walk​(Positionable destination,
                                     WalkCondition walkCondition)
        Walks to a specified destination and returns the current walking state.
        Parameters:
        destination - the location to walk to
        walkCondition - the condition to continue walking
        Returns:
        the current walking state
      • walkExact

        public static WalkState walkExact​(Positionable destination)
        Walks the character to the exact location specified by the given destination.
        Parameters:
        destination - the target location to walk to
        Returns:
        the state of the walking action
      • walkExact

        public static WalkState walkExact​(Positionable destination,
                                          WalkCondition walkCondition)
        Walks to a specified destination using exact coordinates, until a specified walk condition is met.
        Parameters:
        destination - the location to walk to
        walkCondition - the condition to be met to continue the walking
        Returns:
        the current walking state
      • walkToBank

        public static WalkState walkToBank()
        Returns the walk state to the bank.
        Returns:
        the walk state to the bank
      • walkToBank

        public static WalkState walkToBank​(WalkCondition walkCondition)
        Walks the character to the bank based on a specified walk condition.
        Parameters:
        walkCondition - the condition for walking to the bank
        Returns:
        the state of the walking operation
      • walkToBank

        public static WalkState walkToBank​(BankLocation bank)
        Walks the player character to the specified bank location.
        Parameters:
        bank - the bank location to walk to
        Returns:
        the current walk state
      • walkToBank

        public static WalkState walkToBank​(BankLocation bank,
                                           WalkCondition walkCondition)
        Walks to the specified bank location using the given walk condition.
        Parameters:
        bank - the bank location to walk to
        walkCondition - the condition to stop walking
        Returns:
        the state of the walking operation
      • walkPath

        public static WalkState walkPath​(java.util.List<Positionable> path)
        Walks the provided path of tiles.
        Parameters:
        path - the list of tiles representing the path to be walked
        Returns:
        the current state of the walking process
      • walkPath

        public static WalkState walkPath​(java.util.List<Positionable> path,
                                         WalkCondition walkCondition)
        Walks along the specified path of tiles, checking the specified walk condition, and returns the current state of walking.
        Parameters:
        path - the list of tiles representing the desired path to walk along
        walkCondition - the condition to check before each step of walking
        Returns:
        the state of walking
      • setWalkFlag

        public static void setWalkFlag​(int gridX,
                                       int gridY)
        Sets the walk flag at the specified coordinates.
        Parameters:
        gridX - the x-coordinate of the flag
        gridY - the y-coordinate of the flag
      • setWalkFlag

        public static void setWalkFlag​(Positionable positionable)
        Sets the walk flag for a given Positionable object.
        Parameters:
        positionable - the object to set the walk flag for
      • setWalkFlagWithConfirm

        public static boolean setWalkFlagWithConfirm​(int gridX,
                                                     int gridY)
        Sets the walk flag at the specified coordinates.
        Parameters:
        gridX - the x-coordinate of the flag
        gridY - the y-coordinate of the flag
      • setWalkFlagWithConfirm

        public static boolean setWalkFlagWithConfirm​(Positionable positionable)
        Sets the walk flag for a given Positionable object.
        Parameters:
        positionable - the object to set the walk flag for
      • isDestinationSet

        public static boolean isDestinationSet()
        Checks if a destination is set for the character to walk towards.
        Returns:
        true if a destination is set, false otherwise.
      • getDestination

        public static Positionable getDestination()
        Returns the destination location for walking.
        Returns:
        the Positionable destination for walking
      • getDestinationDistance

        public static double getDestinationDistance()
        Retrieves the distance to the destination from the current location.
        Returns:
        the distance to the destination as a double value.
      • getRunEnergy

        public static int getRunEnergy()
        Retrieves the current run energy level of the character.
        Returns:
        The current run energy level.
      • toggleRun

        public static boolean toggleRun()
        Toggles the running state of the character.
        Returns:
        true if the character is now running, false otherwise.
      • isRunEnabled

        public static boolean isRunEnabled()
        Checks if the Run option is enabled for the current player.
        Returns:
        true if the Run option is enabled, false otherwise.
      • isStaminaActive

        public static boolean isStaminaActive()
        Checks if the player's stamina is currently active.
        Returns:
        true if the player's stamina is active, false otherwise.
      • shouldWalk

        public static boolean shouldWalk​(int distance)
        Determines whether the bot should walk a certain distance.
        Parameters:
        distance - the distance to be walked.
        Returns:
        true if the bot should walk the specified distance, false otherwise.
      • setUseTeleports

        public static void setUseTeleports​(boolean useTeleports)
        Sets whether or not the bot should use teleports for navigation.
        Parameters:
        useTeleports - true if the bot should use teleports, false otherwise
      • setDrawPath

        public static void setDrawPath​(boolean drawPath)
        Sets whether to draw the path while walking.
        Parameters:
        drawPath - true to enable drawing the path, false to disable it
      • setGlobalCondition

        public static void setGlobalCondition​(WalkCondition walkCondition)
        Sets the global condition for walking.
        Parameters:
        walkCondition - the condition to be applied
      • addAndCondition

        public static void addAndCondition​(WalkCondition walkCondition)
        Adds an AND global condition for walking.
        Parameters:
        walkCondition - the condition to be applied
      • addOrCondition

        public static void addOrCondition​(WalkCondition walkCondition)
        Adds an OR global condition for walking.
        Parameters:
        walkCondition - the condition to be applied
      • getPath

        public static java.util.List<Positionable> getPath​(Positionable destination)
        Retrieves a list of tiles representing the shortest path from the current player location to the given destination.
        Parameters:
        destination - the destination to reach in the game world
        Returns:
        a list of tiles representing the shortest path to the destination
      • isAtEndOfPath

        public static boolean isAtEndOfPath​(java.util.List<Positionable> path)
        Checks if the character is at the end of the given path.
        Parameters:
        path - the list of tiles representing the path
        Returns:
        true if the character is at the end of the path, otherwise false
      • getWalkableTile

        public static Positionable getWalkableTile​(Positionable destination,
                                                   int radius)
        Returns a walkable tile within a given radius of the specified destination.
        Parameters:
        destination - the destination where the walkable tile is sought within the radius
        radius - the radius within which the walkable tile is searched
        Returns:
        the walkable tile if found within the radius, null otherwise
      • getWalkingDistance

        public static int getWalkingDistance​(Positionable destination)
        Calculates the walking distance to the specified destination.
        Parameters:
        destination - the location to which the walking distance is calculated
        Returns:
        the walking distance to the destination in steps
      • canReach

        public static boolean canReach​(Positionable destination)
        Determines whether the player can reach the given location.
        Parameters:
        destination - the location to check if reachable
        Returns:
        true if the player can reach the destination, false otherwise
      • canReachSurrounding

        public static boolean canReachSurrounding​(Positionable destination)
        Checks if the bot can reach the surrounding area of a given destination.
        Parameters:
        destination - the location to check for reachability
        Returns:
        true if the bot can reach the surrounding area, false otherwise
      • canReachSurrounding

        public static boolean canReachSurrounding​(Positionable positionable,
                                                  Positionable destination)
        Checks if a given positionable object can reach a specified destination.
        Parameters:
        positionable - the starting point for the reachability check
        destination - the destination to check reachability to
        Returns:
        true if the positionable can reach the destination, false otherwise
      • canReach

        public static boolean canReach​(Positionable positionable,
                                       Positionable destination)
        Determines if the given positionable can reach the destination.
        Parameters:
        positionable - the starting point.
        destination - the destination point.
        Returns:
        true if the positionable can reach the destination, false otherwise.
      • isLocalWalking

        public static boolean isLocalWalking()
        Returns:
        true if we are trying to handle pathing locally when possible
      • setLocalWalking

        public static void setLocalWalking​(boolean localWalking)
        Parameters:
        localWalking - true if we should try to handle pathing locally if possible
      • isInstanceWalking

        public static boolean isInstanceWalking()
        Returns:
        true if eternal walker should try to path find within instances
      • setInstanceWalking

        public static void setInstanceWalking​(boolean instanceWalking)
        Parameters:
        instanceWalking - true if eternal walker should try to path find within instances