Class GameObjects
java.lang.Object
privbot.hooks.GameObjects
Scene object query (KSBot-style). Refreshes once per game tick on the game thread.
query() is safe from any thread; ObjectQuery.withName(String...),
ObjectQuery.withAction(String...), ObjectQuery.closest(), and PrivObject.exists()
marshal to the client thread when needed so filters (which call getObjectDefinition) and player distance
are not evaluated from a script/background thread.
Player-relative filters (north/south/east/west of an object) live on ObjectQuery;
single-object checks are on PrivObject.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classToA / Tombs rewards-room anchor classifier (legacyWardenLootTaskreference): firstGameObjecton the anchor scene tile, matching sarcophagus id, gate action on resolved composition (defaultOpen). -
Method Summary
Modifier and TypeMethodDescriptionClosest object matching any of the supplied names, ornull.closest(Predicate<PrivObject> pred) Closest object matching the predicate.booleanWhether an object matching any of the supplied names is currently loaded.net.runelite.api.ClientbooleanInteracts with the closest object matchingnameusingaction.booleaninteractClosest(String action, String... names) Interacts with the closest object matching any supplied name.Alias ofclosest(String...).static PrivObjectnearest(Predicate<PrivObject> pred) Static lookup that needs noctx; preferctx.objects.closest(pred).query()A query over the scene's objects, read once per game tick on the client thread and reused within the tick.withAction(String... actions) Start a query filtered to objects with at least one of the given actions.withId(int... ids) Start a query filtered to objects matching the given ID(s).Start a query filtered to objects matching the given name(s).
-
Method Details
-
getClient
public net.runelite.api.Client getClient()- Returns:
- the client this facade reads
-
query
A query over the scene's objects, read once per game tick on the client thread and reused within the tick.- Returns:
- the query
-
closest
Closest object matching the predicate. -
closest
Closest object matching any of the supplied names, ornull. -
nearest
Alias ofclosest(String...). -
exists
Whether an object matching any of the supplied names is currently loaded. -
interactClosest
-
interact
-
withAction
Start a query filtered to objects with at least one of the given actions. -
withName
Start a query filtered to objects matching the given name(s). -
withId
Start a query filtered to objects matching the given ID(s). -
nearest
Static lookup that needs noctx; preferctx.objects.closest(pred).- Parameters:
pred- the test- Returns:
- the nearest matching object, or null
-