Class GroundItems
java.lang.Object
privbot.hooks.GroundItems
Ground loot query (KSBot-style). Refreshes the snapshot once per game tick while querying.
-
Method Summary
Modifier and TypeMethodDescriptionNearest ground item matching any supplied name, ornull.closest(Predicate<PrivGroundItem> pred) Nearest ground item matchingpred(same asquery().closest(pred)).configuredDrop(Predicate<LootDrop> policy, int range) The nearest ground stack withinrangetiles thatpolicyaccepts.booleanWhether a ground item matching any supplied name is currently loaded.net.runelite.api.ClientAlias ofclosest(String...).static PrivGroundItemnearest(Predicate<PrivGroundItem> pred) Static nearest-loot helper that needs noctx.query()booleanTakes the closest ground item matching any supplied name.booleantakeClosest(String... names) Takes the closest ground item matching any supplied name.takeConfiguredDrop(Predicate<LootDrop> policy, int range) Scans likeconfiguredDrop(java.util.function.Predicate<privbot.hooks.LootDrop>, int), rechecks the policy and sends a Take on the nearest accepted stack, all on the client thread.
-
Method Details
-
configuredDrop
The nearest ground stack withinrangetiles thatpolicyaccepts. The policy runs on the client thread inside the scan, so it should read only config and snapshots. Nothing is dispatched.- Parameters:
policy- which stacks count as lootrange- Manhattan distance in tiles, capped at 104- Returns:
- the nearest accepted stack, or null when none is in range (or this facade has no item API)
- Since:
- 1.1.0
-
takeConfiguredDrop
Scans likeconfiguredDrop(java.util.function.Predicate<privbot.hooks.LootDrop>, int), rechecks the policy and sends a Take on the nearest accepted stack, all on the client thread. A full inventory takes only a stackable the inventory already holds. Callers confirm the inventory gain themselves.- Parameters:
policy- which stacks count as lootrange- Manhattan distance in tiles, capped at 104- Returns:
- the stack the Take was sent for, or null when nothing was sent
- Since:
- 1.1.0
-
getClient
public net.runelite.api.Client getClient()- Returns:
- the client this facade reads
-
query
- Returns:
- a query over the ground items in the scene, read once on the client thread
-
closest
Nearest ground item matchingpred(same asquery().closest(pred)). -
closest
Nearest ground item matching any supplied name, ornull. -
nearest
Alias ofclosest(String...). -
exists
Whether a ground item matching any supplied name is currently loaded. -
takeClosest
Takes the closest ground item matching any supplied name. -
take
Takes the closest ground item matching any supplied name. -
nearest
Static nearest-loot helper that needs noctx. Namednearestbecauseclosestalready belongs to the instance API.
-