Class Equipment
java.lang.Object
privbot.hooks.Equipment
Worn equipment:
ctx.equipment. Reads go through the plugin's adapter, which knows where each server
keeps the worn items (on some servers that is not the RuneLite item container), so they answer on every server.
Prefer snapshot() for decisions: one immutable read per tick. query() re-reads on every
call. Writes (unequip(java.lang.String...)) return dispatch acceptance; verify the slot emptied.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(int... ids) booleanintcount(int id) static PrivItemStatic lookup that needs noctx; preferctx.equipment.get(pred).Same asget(Predicate).booleanInteract with a worn item without moving it into inventory.booleanisEmpty()query()A fresh query over the worn items (one read per call).snapshot()Immutable worn-slot facts; seeInventory.snapshot()for source and read-scope rules.booleanRemoves the first worn item matchingnameswith its "Remove" action, sent the way this server's own Remove click is sent.
-
Method Details
-
snapshot
Immutable worn-slot facts; seeInventory.snapshot()for source and read-scope rules. -
query
-
contains
public boolean contains(int... ids) - Parameters:
ids- item ids- Returns:
- whether any worn item has one of
ids
-
contains
- Parameters:
names- item names (matched asItemQuery.withName(java.lang.String...)does)- Returns:
- whether any worn item matches one of
names
-
count
public int count(int id) - Parameters:
id- an item id- Returns:
- the total quantity worn with that id (ammunition stacks count their quantity)
-
get
-
first
Same asget(Predicate).- Parameters:
pred- the test- Returns:
- the first worn item that matches, or null
-
isEmpty
public boolean isEmpty()- Returns:
- whether nothing is worn (also true when the worn container could not be read: use
snapshot()to tell the two apart)
-
unequip
Removes the first worn item matchingnameswith its "Remove" action, sent the way this server's own Remove click is sent.- Parameters:
names- item names- Returns:
- dispatch acceptance; false when nothing worn matches
-
interact
Interact with a worn item without moving it into inventory. On a server where PrivBot does not know how to sendactionon a worn item, this refuses (returns false) rather than sending an inventory action, which would not address the equipped item. -
find
-