Package rsb.methods

Class Walking


public class Walking extends MethodProvider
Walking related operations.
  • Method Details

    • newTilePath

      public RSTilePath newTilePath(RSTile[] tiles)
      Creates a new path based on a provided array of tile waypoints.
      Parameters:
      tiles - The waypoint tiles.
      Returns:
      An RSTilePath.
    • getPath

      public RSPath getPath(RSTile destination)
      Generates a path from the player's current location to a destination tile.
      Parameters:
      destination - The destination tile.
      Returns:
      The path as an RSPath.
    • isLocal

      public boolean isLocal(RSTile tile)
      Determines whether a given tile is in the loaded map area.
      Parameters:
      tile - The tile to check.
      Returns:
      true if local; otherwise false.
    • walkTo

      public boolean walkTo(RSTile destination)
      Walks one tile towards the given destination using a generated path.
      Parameters:
      destination - The destination tile.
      Returns:
      true if the next tile was walked to; otherwise false.
    • walkTileMM

      public boolean walkTileMM(RSTile t)
      Walks to the given tile using the minimap with 1 tile randomness.
      Parameters:
      t - The tile to walk to.
      Returns:
      true if the tile was clicked; otherwise false.
      See Also:
    • walkTileMM

      public boolean walkTileMM(RSTile t, int x, int y)
      Walks to the given tile using the minimap with given randomness.
      Parameters:
      t - The tile to walk to.
      x - The x randomness (between 0 and x-1).
      y - The y randomness (between 0 and y-1).
      Returns:
      true if the tile was clicked; otherwise false.
    • walkTileMM

      public boolean walkTileMM(RSTile t, int r)
      Walks to the given tile using the minimap with given randomness.
      Parameters:
      t - The tile to walk to.
      r - The maximum deviation from the tile to allow.
      Returns:
      true if the tile was clicked; otherwise false.
    • walkTileOnScreen

      public boolean walkTileOnScreen(RSTile tileToWalk)
      Walks to a tile using onScreen clicks and not the MiniMap. If the tile is not on the screen, it will find the closest tile that is on screen and it will walk there instead.
      Parameters:
      tileToWalk - Tile to walk.
      Returns:
      True if successful.
    • setRun

      public boolean setRun(boolean enable)
      Turns run on or off using the game GUI controls.
      Parameters:
      enable - true to enable run, false to disable it.
      Returns:
      if run was attempted to be enabled true; otherwise false
    • findPath

      @Deprecated public RSTile[] findPath(RSTile destination)
      Deprecated.
      Generates a path from the player's current location to a destination tile.
      Parameters:
      destination - The destination tile.
      Returns:
      The path as an RSTile array.
    • randomize

      @Deprecated public RSTile randomize(RSTile tile, int maxXDeviation, int maxYDeviation)
      Deprecated.
      Randomizes a single tile.
      Parameters:
      tile - The RSTile to randomize.
      maxXDeviation - Max X distance from tile.getX().
      maxYDeviation - Max Y distance from tile.getY().
      Returns:
      The randomized tile.
    • getClosestTileOnMap

      public RSTile getClosestTileOnMap(RSTile tile)
      Returns the closest tile on the minimap to a given tile.
      Parameters:
      tile - The destination tile.
      Returns:
      Returns the closest tile to the destination on the minimap.
    • isRunEnabled

      public boolean isRunEnabled()
      Returns whether run is enabled.
      Returns:
      true if run mode is enabled; otherwise false.
    • getEnergy

      public int getEnergy()
      Returns the player's current run energy.
      Returns:
      The player's current run energy.
    • getDestination

      public RSTile getDestination()
      Gets the destination tile (where the flag is on the minimap). If there is no destination currently, null will be returned.
      Returns:
      The current destination tile, or null.
    • getCollisionFlags

      public int[][] getCollisionFlags(int plane)
      Gets the collision flags for a given floor level in the loaded region.
      Parameters:
      plane - The floor level (0, 1, 2 or 3).
      Returns:
      the collision flags.
    • getObType

      public String getObType(Field field)
      Checks the obfuscated field to determine if it is collisiondata or not. If it is, then the method will return its obfuscated name.
      Parameters:
      field - The field from the client class to check
      Returns:
      The obfuscated type name for CollisionData[]
    • randomizeTile

      @Deprecated public RSTile randomizeTile(RSTile tile, int maxXDeviation, int maxYDeviation)
      Deprecated.
      Randomizes a single tile.
      Parameters:
      tile - The RSTile to randomize.
      maxXDeviation - Max X distance from tile.getX().
      maxYDeviation - Max Y distance from tile.getY().
      Returns:
      The randomized tile. .
    • walkPathMM

      @Deprecated public boolean walkPathMM(RSTile[] path)
      Deprecated.
      Walks towards the end of a path. This method should be looped.
      Parameters:
      path - The path to walk along.
      Returns:
      true if the next tile was reached; otherwise false.
      See Also:
    • walkPathMM

      @Deprecated public boolean walkPathMM(RSTile[] path, int maxDist)
      Deprecated.
      Walks towards the end of a path. This method should be looped.
      Parameters:
      path - The path to walk along.
      maxDist - See nextTile(RSTile[], int).
      Returns:
      true if the next tile was reached; otherwise false.
      See Also:
    • walkPathMM

      @Deprecated public boolean walkPathMM(RSTile[] path, int randX, int randY)
      Deprecated.
      Walks towards the end of a path. This method should be looped.
      Parameters:
      path - The path to walk along.
      randX - The X value to randomize each tile in the path by.
      randY - The Y value to randomize each tile in the path by.
      Returns:
      true if the next tile was reached; otherwise false.
      See Also:
    • walkPathMM

      @Deprecated public boolean walkPathMM(RSTile[] path, int maxDist, int randX, int randY)
      Deprecated.
      Walks towards the end of a path. This method should be looped.
      Parameters:
      path - The path to walk along.
      maxDist - See nextTile(RSTile[], int).
      randX - The X value to randomize each tile in the path by.
      randY - The Y value to randomize each tile in the path by.
      Returns:
      true if the next tile was reached; otherwise false.
    • walkPathOnScreen

      @Deprecated public boolean walkPathOnScreen(RSTile[] path)
      Deprecated.
      Walks to the end of a path via the screen. This method should be looped.
      Parameters:
      path - The path to walk along.
      Returns:
      true if the next tile was reached; otherwise false.
      See Also:
    • walkPathOnScreen

      @Deprecated public boolean walkPathOnScreen(RSTile[] path, int maxDist)
      Deprecated.
      Walks a path using onScreen clicks and not the MiniMap. If the next tile is not on the screen, it will find the closest tile that is on screen and it will walk there instead.
      Parameters:
      path - Path to walk.
      maxDist - Max distance between tiles in the path.
      Returns:
      True if successful.
    • reversePath

      @Deprecated public RSTile[] reversePath(RSTile[] other)
      Deprecated.
      Reverses an array of tiles.
      Parameters:
      other - The RSTile path array to reverse.
      Returns:
      The reverse RSTile path for the given RSTile path.
    • nextTile

      @Deprecated public RSTile nextTile(RSTile[] path)
      Deprecated.
      Returns the next tile to walk to on a path.
      Parameters:
      path - The path.
      Returns:
      The next RSTile to walk to on the provided path; or null if far from path or at destination.
      See Also:
    • nextTile

      @Deprecated public RSTile nextTile(RSTile[] path, int skipDist)
      Deprecated.
      Returns the next tile to walk to in a path.
      Parameters:
      path - The path.
      skipDist - If the distance to the tile after the next in the path is less than or equal to this distance, the tile after next will be returned rather than the next tile, skipping one. This interlacing aids continuous walking.
      Returns:
      The next RSTile to walk to on the provided path; or null if far from path or at destination.
    • randomizePath

      @Deprecated public RSTile[] randomizePath(RSTile[] path, int maxXDeviation, int maxYDeviation)
      Deprecated.
      Randomizes a path of tiles.
      Parameters:
      path - The RSTiles to randomize.
      maxXDeviation - Max X distance from tile.getX().
      maxYDeviation - Max Y distance from tile.getY().
      Returns:
      The new, randomized path.