Movement

object Movement

Movement

Types

Builder
Link copied to clipboard
class Builder

Functions

builder
Link copied to clipboard
fun builder(locatable: Locatable?): Movement.Builder

Constructs a web walking builder

closestOnMap
Link copied to clipboard
fun closestOnMap(locatable: Locatable): Tile

Grabs the closest tile on map relative to the given Locatable.

collisionMap
Link copied to clipboard
fun collisionMap(floor: Int): CollisionMap

A collision map.

destination
Link copied to clipboard
fun destination(): Tile

Returns the destination of the player, as represented by the red flag on the mini-map while traversing. If the player is not moving, this will return Tile.Nil.

distance
Link copied to clipboard
fun distance(l: Locatable?): Int

Returns the amount of steps between the player and the location. This will return -1 if the amount of steps was indeterminate (for example, one of the locations wasn't loaded or they are both not on the same floor).



Note: this can be resource intensive, as it generates a path between these two locations to find the distance. This should only be used if you need an accurate measurement for the amount of steps required. Please consider using Tile.distanceTo for euclidean distance for the length of a straight line between these two points.

fun distance(l1: Locatable?, l2: Locatable?): Int

Returns the amount of steps between two locations. This will return -1 if the amount of steps was indeterminate (for example, one of the locations wasn't loaded or they are both not on the same floor).



Note: this can be resource intensive, as it generates a path between these two locations to find the distance. This should only be used if you need an accurate measurement for the amount of steps required. Please consider using Tile.distanceTo for euclidean distance for the length of a straight line between these two points.

energyLevel
Link copied to clipboard
fun energyLevel(): Int

The run energy of the player.

findPath
Link copied to clipboard
fun findPath(locatable: Locatable): OldLocalPath

Creates a local path in the current region.

moveTo
Link copied to clipboard
fun moveTo(locatable: Locatable?): WebWalkingResult
fun moveTo(locatable: Locatable?, refreshQuests: Boolean): WebWalkingResult

Uses web walking to walk to a destination

moveToBank
Link copied to clipboard
fun moveToBank(refreshQuests: Boolean = false): WebWalkingResult

Uses web walking to walk to the nearest bank

newTilePath
Link copied to clipboard
fun newTilePath(vararg tiles: Tile): TilePath

Creates a new tile path.

reachable
Link copied to clipboard
fun reachable(l1: Locatable, l2: Locatable): Boolean
fun reachable(l1: Locatable, l2: Locatable, useBlocked: Boolean): Boolean

Whether or not the location may be reached. This will return false if one of the locations is not loaded, they're not on the same plane, or the distance between them is 0.



Note: this can be resource intensive, as it generates a path between these two locations to determine if they're reachable. This should only be used if you need to be certain that the point is reachable. Please consider using Tile.distanceTo

running
Link copied to clipboard
fun running(): Boolean

Whether or not the player is running.

fun running(running: Boolean): Boolean

Attempts to set the player to the specified running state.

step
Link copied to clipboard
fun step(locatable: Locatable): Boolean
fun step(locatable: Locatable, minDistance: Int): Boolean

Attempts to use the mini-map to step towards the Locatable.

walkTo
Link copied to clipboard
fun walkTo(locatable: Locatable?): Boolean
fun walkTo(locatable: Locatable?, refreshQuests: Boolean): Boolean

Uses web walking to walk to a destination