Package rsb.methods

Class Objects


public class Objects extends MethodProvider
Provides access to in-game physical objects.
  • Field Details

    • ALL_FILTER

      public static final Predicate<RSObject> ALL_FILTER
      A filter that accepts all matches.
  • Method Details

    • getAll

      public RSObject[] getAll()
      Returns all the RSObjects in the local region.
      Returns:
      An RSObject[] of all objects in the loaded region.
    • getAll

      public RSObject[] getAll(Predicate<RSObject> filter)
      Returns all the RSObjects in the local region accepted by the provided Filter.
      Parameters:
      filter - Filters out unwanted objects.
      Returns:
      An RSObject[] of all the accepted objects in the loaded region.
    • getNearest

      public RSObject getNearest(Predicate<RSObject> filter)
      Returns the RSObject that is nearest out of all objects that are accepted by the provided Filter.
      Parameters:
      filter - Filters out unwanted objects.
      Returns:
      An RSObject representing the nearest object that was accepted by the filter; or null if there are no matching objects in the current region.
    • getNearest

      public RSObject getNearest(int distance, Predicate<RSObject> filter)
      Returns the RSObject that is nearest out of all objects that are accepted by the provided Filter.
      Parameters:
      distance - The distance away from the player to check
      filter - Filters out unwanted objects.
      Returns:
      An RSObject representing the nearest object that was accepted by the filter; or null if there are no matching objects in the current region.
    • getNearest

      public RSObject getNearest(int... ids)
      Returns the RSObject that is nearest, out of all of the RSObjects with the provided ID(s).
      Parameters:
      ids - The ID(s) of the RSObject that you are searching.
      Returns:
      An RSObject representing the nearest object with one of the provided IDs; or null if there are no matching objects in the current region.
    • getNearest

      public RSObject getNearest(String... names)
      Returns the RSObject that is nearest, out of all of the RSObjects with the provided name(s).
      Parameters:
      names - The name(s) of the RSObject that you are searching.
      Returns:
      An RSObject representing the nearest object with one of the provided names; or null if there are no matching objects in the current region.
    • findNearest

      public RSObject findNearest(int distance, String... names)
      Returns the RSObject that is nearest, out of all of the RSObjects with the provided name(s).
      Parameters:
      distance - The distance from the player to search within
      names - The name(s) of the RSObject that you are searching.
      Returns:
      An RSObject representing the nearest object with one of the provided names; or null if there are no matching objects in the current region.
    • getTopAt

      public RSObject getTopAt(RSTile t)
      Returns the top RSObject on the specified tile.
      Parameters:
      t - The tile on which to search.
      Returns:
      The top RSObject on the provided tile; or null if none found.
    • getTopAt

      public RSObject getTopAt(RSTile t, int mask)
      Returns the top RSObject on the specified tile matching types specified by the flags in the provided mask.
      Parameters:
      t - The tile on which to search.
      mask - The type flags.
      Returns:
      The top RSObject on the provided tile matching the specified flags; or null if none found.
    • getAt

      public RSObject[] getAt(RSTile t, int mask)
      Returns the RSObjects which are on the specified RSTile matching types specified by the flags in the provided mask.
      Parameters:
      t - The tile on which to search.
      mask - The type flags.
      Returns:
      An RSObject[] of the objects on the specified tile.
    • getAllAt

      public RSObject[] getAllAt(RSTile t)
      Returns the RSObjects which are on the specified RSTile .
      Parameters:
      t - The tile on which to search.
      Returns:
      An RSObject[] of the objects on the specified tile.