Class SceneObjects

java.lang.Object
com.botwithus.bot.api.entities.SceneObjects

public final class SceneObjects extends Object
Scene-object query facade. Singleton per GameAPI; obtain via api.objects().

Snapshot-backed (v15+) — reads from api.snapshot().locations() each time the source is materialised, mirroring the Npcs and Players pattern. The producer publishes scene Locations every tick; the filter chain below picks the resolvable rows (direct LOCATIONs with a real interactId) and wraps them in rich SceneObjects with lazy LocationType resolution.

The LocationType cache is held here so repeat SceneObject.getType() hits don't re-RPC.

SceneObject rift = api.objects().query()
    .named("Rift")
    .withinDistance(30)
    .filter(o -> o.hasOption("Convert"))
    .nearest();
if (rift != null) rift.interact("Convert");
  • Constructor Details

    • SceneObjects

      public SceneObjects(GameAPI api)
  • Method Details

    • query

      public SceneObjects.Query query()
    • nearest

      public SceneObject nearest(String name)
    • nearest

      public SceneObject nearest(int typeId)
    • all

      public List<SceneObject> all(String name)
    • all

      public List<SceneObject> all(int typeId)
    • nearestByGameval

      public SceneObject nearestByGameval(String gameval)
      Nearest scene object with the given gameval name (e.g. "MCANNONCAVE"), or null. Distinct from nearest(String), which matches the localised display name — and unlike a display name, a gameval distinguishes the many scenery types that share one label.
    • allByGameval

      public List<SceneObject> allByGameval(String gameval)
      All scene objects with the given gameval name. Distinct from all(String), which matches the localised display name.
    • clearDefinitionCache

      public void clearDefinitionCache()
    • definitionCacheSize

      public int definitionCacheSize()