Class SceneObjects
java.lang.Object
com.botwithus.bot.api.entities.SceneObjects
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");
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall(int typeId) allByGameval(String gameval) All scene objects with the given gameval name.voidintnearest(int typeId) nearestByGameval(String gameval) Nearest scene object with the given gameval name (e.g.query()
-
Constructor Details
-
SceneObjects
-
-
Method Details
-
query
-
nearest
-
nearest
-
all
-
all
-
nearestByGameval
Nearest scene object with the given gameval name (e.g."MCANNONCAVE"), ornull. Distinct fromnearest(String), which matches the localised display name — and unlike a display name, a gameval distinguishes the many scenery types that share one label. -
allByGameval
All scene objects with the given gameval name. Distinct fromall(String), which matches the localised display name. -
clearDefinitionCache
public void clearDefinitionCache() -
definitionCacheSize
public int definitionCacheSize()
-