Package com.epicbot.api.shared.methods
Interface IWalkingAPI
-
public interface IWalkingAPI
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.Function<APIContext,java.lang.Boolean>
NO_SLEEP
static java.util.function.Function<APIContext,java.lang.Boolean>
SLEEP
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description LocalPath
findPath(Locatable destination)
Finds a local path.LocalPath
findPath(Locatable destination, double precision)
Finds a local path.LocalPath
findPath(Locatable origin, Locatable destination)
Finds a local path.LocalPath
findPath(Locatable origin, Locatable destination, double precision)
Finds a local path.ScreenPath
findPathOnScreen(Locatable destination)
Finds a screen path.ScreenPath
findPathOnScreen(Locatable destination, double precision)
Finds a screen path.SceneObject
getBlockingObjectBetween(Locatable start, Locatable end)
Searches for a local blocking object between two tiles provided and returns it if it exists.Tile
getClosestTileOnMap(Locatable destination)
Gets the closest tile on the minimap towards the given destination.Tile
getClosestTileOnScreen(Locatable destination)
Gets the closest tile that is on screen towards the given destination.int[][]
getCollisionFlags(int plane)
Tile
getCollisionOffset(int plane)
Tile
getDestination()
Gets the current walking destination.Tile
getNext(Tile[] tiles)
Gets the next best available tile to use.Tile
getNextOnScreen(Tile[] tiles)
Gets the next best available tile to use on screen.int
getRunEnergy()
Gets the current run energy.byte[][][]
getTileFlags()
int[][][]
getTileHeights()
boolean
isRunEnabled()
Gets whether or not running is enabled.default boolean
isWalkingTo(Locatable destination)
Determines if we are walking towards the given destination.boolean
isWalkingTo(Locatable destination, double precision)
Determines if we are walking towards the given destination with precision.boolean
setRun(boolean enabled)
Toggles running by using the running orb.void
setSleepFunction(java.util.function.Function<APIContext,java.lang.Boolean> sleepFunction)
Set the sleep function used after clicking on the minimap or a tile to walk to on screen.boolean
walkOnMap(Locatable destination)
Clicks the given destination on the minimap to walk towards it.boolean
walkOnMap(Locatable destination, double precision)
Clicks the given destination on the minimap to walk towards with precision.boolean
walkOnScreen(Locatable destination)
Click the given destination tile on screen.boolean
walkOnScreen(Locatable destination, double precision)
Click the given destination tile on screen.boolean
walkPath(TilePath path)
Walks along the given path.boolean
walkPath(Tile[] tilePath)
Walks along the given path.boolean
walkPath(Tile[] tilePath, double precision)
Walks along the given path with precision.boolean
walkPathOnScreen(ScreenPath tilePath)
Walks along the given path on screen.boolean
walkPathOnScreen(Tile[] tilePath)
Walks along the given path on screen.boolean
walkPathOnScreen(Tile[] tilePath, double precision)
Walks along the given path on screen with precision.boolean
walkTo(Locatable destination)
Walks towards the destination.boolean
walkTo(Locatable destination, double precision)
Walks towards the destination with precision.boolean
walkToOnScreen(Locatable destination)
Walks towards the destination by clicking on screen.boolean
walkToOnScreen(Locatable destination, double precision)
Walks towards the destination with precision by clicking on screen.
-
-
-
Field Detail
-
NO_SLEEP
static final java.util.function.Function<APIContext,java.lang.Boolean> NO_SLEEP
-
SLEEP
static final java.util.function.Function<APIContext,java.lang.Boolean> SLEEP
-
-
Method Detail
-
setSleepFunction
void setSleepFunction(java.util.function.Function<APIContext,java.lang.Boolean> sleepFunction)
Set the sleep function used after clicking on the minimap or a tile to walk to on screen. By default the API usesSLEEP
and it's implementation looks like this:
Useboolean moving = Time.sleep(1000, () -> ctx.localPlayer().isMoving(), 5); if(!moving) return false; Time.sleep(500, 1200, () -> !ctx.localPlayer().isMoving(), 200); return moving;
}NO_SLEEP
which simply returns true if you want NO sleeping at all.- Parameters:
sleepFunction
-
-
walkTo
boolean walkTo(Locatable destination)
Walks towards the destination. The path is calculated with the available collision data of the current scene. When the destination tile is outside the current scene it will attempt to walk in a straight line.- Parameters:
destination
- the destination- Returns:
- true if we are attempting to walk towards the destination, false otherwise
- See Also:
findPath(Locatable)
-
walkTo
boolean walkTo(Locatable destination, double precision)
Walks towards the destination with precision. The path is calculated with the available collision data of the current scene. When the destination tile is outside the current scene it will attempt to walk in a straight line.- Parameters:
destination
- the destinationprecision
- how far off the destination this path is considered completed- Returns:
- true if we are attempting to walk towards the destination, false otherwise
- See Also:
findPath(Locatable, double)
-
walkToOnScreen
boolean walkToOnScreen(Locatable destination)
Walks towards the destination by clicking on screen. The path is calculated with the available collision data of the current scene. When the destination tile is outside the current scene it will attempt to walk in a straight line.- Parameters:
destination
- the destination- Returns:
- true if we are attempting to walk towards the destination, false otherwise
- See Also:
findPathOnScreen(Locatable)
-
walkToOnScreen
boolean walkToOnScreen(Locatable destination, double precision)
Walks towards the destination with precision by clicking on screen. The path is calculated with the available collision data of the current scene. When the destination tile is outside the current scene it will attempt to walk in a straight line.- Parameters:
destination
- the destinationprecision
- how far off the destination this path is considered completed- Returns:
- true if we are attempting to walk towards the destination, false otherwise
- See Also:
findPathOnScreen(Locatable, double)
-
walkOnMap
boolean walkOnMap(Locatable destination)
Clicks the given destination on the minimap to walk towards it.- Parameters:
destination
- the destination- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkOnMap
boolean walkOnMap(Locatable destination, double precision)
Clicks the given destination on the minimap to walk towards with precision.- Parameters:
destination
- the destinationprecision
- how far off the destination this path is considered completed- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkOnScreen
boolean walkOnScreen(Locatable destination)
Click the given destination tile on screen.- Parameters:
destination
- the destination on screen to click- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkOnScreen
boolean walkOnScreen(Locatable destination, double precision)
Click the given destination tile on screen.- Parameters:
destination
- the destination on screen to clickprecision
- how far off the destination this path is considered completed- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkPath
boolean walkPath(Tile[] tilePath)
Walks along the given path.- Parameters:
tilePath
- the tiles of the path to follow- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkPath
boolean walkPath(Tile[] tilePath, double precision)
Walks along the given path with precision.- Parameters:
tilePath
- the tiles of the path to followprecision
- how far off the destination this path is considered completed- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkPath
boolean walkPath(TilePath path)
Walks along the given path. Simply callsTilePath.traverse(com.epicbot.api.shared.APIContext)
.- Parameters:
path
- the path to follow- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkPathOnScreen
boolean walkPathOnScreen(Tile[] tilePath)
Walks along the given path on screen.- Parameters:
tilePath
- the tiles of the path to follow- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkPathOnScreen
boolean walkPathOnScreen(Tile[] tilePath, double precision)
Walks along the given path on screen with precision.- Parameters:
tilePath
- the tiles of the path to followprecision
- how far off the destination this path is considered completed- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
walkPathOnScreen
boolean walkPathOnScreen(ScreenPath tilePath)
Walks along the given path on screen. Simply callsTilePath.traverse(com.epicbot.api.shared.APIContext)
.- Parameters:
tilePath
- the path to follow- Returns:
- true if we are attempting to walk towards the destination, false otherwise
-
findPath
LocalPath findPath(Locatable destination)
Finds a local path. This path is built using available collision data of the current scene.- Parameters:
destination
- the destination- Returns:
- the local path
- See Also:
LocalPath
-
findPath
LocalPath findPath(Locatable destination, double precision)
Finds a local path. This path is built using available collision data of the current scene.- Parameters:
destination
- the destinationprecision
- how far off the destination this path is considered completed- Returns:
- the local path
- See Also:
LocalPath
-
findPath
LocalPath findPath(Locatable origin, Locatable destination)
Finds a local path. This path is built using available collision data of the current scene.- Parameters:
origin
- the origin to calculate fromdestination
- the destination- Returns:
- the local path
- See Also:
LocalPath
-
findPath
LocalPath findPath(Locatable origin, Locatable destination, double precision)
Finds a local path. This path is built using available collision data of the current scene.- Parameters:
origin
- the origin to calculate fromdestination
- the destinationprecision
- how far off the destination this path is considered completed- Returns:
- the local path
- See Also:
LocalPath
-
findPathOnScreen
ScreenPath findPathOnScreen(Locatable destination)
Finds a screen path.- Parameters:
destination
- the destination- Returns:
- the screen path
- See Also:
ScreenPath
-
findPathOnScreen
ScreenPath findPathOnScreen(Locatable destination, double precision)
Finds a screen path.- Parameters:
destination
- the destinationprecision
- how far off the destination this path is considered completed- Returns:
- the screen path
- See Also:
ScreenPath
-
getNext
Tile getNext(Tile[] tiles)
Gets the next best available tile to use.- Parameters:
tiles
- the tile array- Returns:
- the next tile or null if no tile can be used to traverse the given path
-
getNextOnScreen
Tile getNextOnScreen(Tile[] tiles)
Gets the next best available tile to use on screen.- Parameters:
tiles
- the tile array- Returns:
- the next tile or null if no tile can be used to traverse the given path
-
getClosestTileOnMap
Tile getClosestTileOnMap(Locatable destination)
Gets the closest tile on the minimap towards the given destination.- Parameters:
destination
- the destination you want to get to- Returns:
- closest till on screen or null
-
getClosestTileOnScreen
Tile getClosestTileOnScreen(Locatable destination)
Gets the closest tile that is on screen towards the given destination.- Parameters:
destination
- the destination you want to get to- Returns:
- closest till on screen or null
-
isWalkingTo
default boolean isWalkingTo(Locatable destination)
Determines if we are walking towards the given destination.- Parameters:
destination
- the destination- Returns:
- true if we are walking towards it, false otherwise
-
isWalkingTo
boolean isWalkingTo(Locatable destination, double precision)
Determines if we are walking towards the given destination with precision.- Parameters:
destination
- the destinationprecision
- how far off the destination is still considered OK- Returns:
- true if we are walking towards it, false otherwise
-
getBlockingObjectBetween
SceneObject getBlockingObjectBetween(Locatable start, Locatable end)
Searches for a local blocking object between two tiles provided and returns it if it exists.- Parameters:
start
- The first tile to search for a blocking object at.end
- The second tile to search for a blocking object at.- Returns:
- The SceneObject between the 2 tiles if it exists. null otherwise.
-
getRunEnergy
int getRunEnergy()
Gets the current run energy.- Returns:
- int
-
isRunEnabled
boolean isRunEnabled()
Gets whether or not running is enabled.- Returns:
- true if enabled, false otherwise
-
setRun
boolean setRun(boolean enabled)
Toggles running by using the running orb.- Parameters:
enabled
- whether or not to enable running- Returns:
- true if successful, false otherwise
-
getCollisionOffset
Tile getCollisionOffset(int plane)
-
getCollisionFlags
int[][] getCollisionFlags(int plane)
-
getTileFlags
byte[][][] getTileFlags()
-
getTileHeights
int[][][] getTileHeights()
-
-