Class InventoryService
- java.lang.Object
-
- net.openosrs.api.service.inventory.InventoryService
-
@Singleton public class InventoryService extends java.lang.ObjectInventory reads and menu-first slot interactions.
-
-
Constructor Summary
Constructors Constructor Description InventoryService(net.runelite.api.Client client, MenuDispatcher dispatcher)InventoryService(net.runelite.api.Client client, MenuDispatcher dispatcher, InventoryLifetimes lifetimes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<InventoryItem>all()intcount(int id)voiddrop(InventoryItem item)InventoryItemfirst(int id)InventoryItemfirst(java.lang.String name)voidinteract(InventoryItem item, java.lang.String action)booleanisEmpty()booleanisFull()voidrequireCurrent(InventoryItem item)voidrequireHeld(InventoryItem item)Checks that the item is still in its slot, without requiring the inventory to be on screen.InventoryQuerysearch()voiduse(InventoryItem item)SubmissionResultuseAsync(InventoryItem item)Native selection completion; never wait on the client thread.voiduseOn(InventoryItem item, GroundItemRef groundItem)voiduseOn(InventoryItem item, InventoryItem target)voiduseOn(InventoryItem item, NpcRef npc)voiduseOn(InventoryItem item, ObjectRef object)voiduseOn(InventoryItem item, PlayerRef player)SubmissionResultuseOnAsync(InventoryItem item, GroundItemRef groundItem)Selects the item, waits for native acknowledgement, then revalidates and clicks the target.SubmissionResultuseOnAsync(InventoryItem item, InventoryItem target)Selects the item, waits for native acknowledgement, then revalidates and clicks the target.SubmissionResultuseOnAsync(InventoryItem item, NpcRef npc)Selects the item, waits for native acknowledgement, then revalidates and clicks the target.SubmissionResultuseOnAsync(InventoryItem item, ObjectRef object)Selects the item, waits for native acknowledgement, then revalidates and clicks the target.SubmissionResultuseOnAsync(InventoryItem item, PlayerRef player)Selects the item, waits for native acknowledgement, then revalidates and clicks the target.
-
-
-
Constructor Detail
-
InventoryService
public InventoryService(net.runelite.api.Client client, MenuDispatcher dispatcher)
-
InventoryService
@Inject public InventoryService(net.runelite.api.Client client, MenuDispatcher dispatcher, InventoryLifetimes lifetimes)
-
-
Method Detail
-
all
public java.util.List<InventoryItem> all()
-
search
public InventoryQuery search()
-
first
public InventoryItem first(int id)
-
first
public InventoryItem first(java.lang.String name)
-
count
public int count(int id)
-
isEmpty
public boolean isEmpty()
-
isFull
public boolean isFull()
-
use
public void use(InventoryItem item)
-
useAsync
public SubmissionResult useAsync(InventoryItem item)
Native selection completion; never wait on the client thread.
-
useOn
public void useOn(InventoryItem item, NpcRef npc)
-
useOnAsync
public SubmissionResult useOnAsync(InventoryItem item, NpcRef npc)
Selects the item, waits for native acknowledgement, then revalidates and clicks the target.
-
useOn
public void useOn(InventoryItem item, PlayerRef player)
-
useOnAsync
public SubmissionResult useOnAsync(InventoryItem item, PlayerRef player)
Selects the item, waits for native acknowledgement, then revalidates and clicks the target.
-
useOn
public void useOn(InventoryItem item, ObjectRef object)
-
useOnAsync
public SubmissionResult useOnAsync(InventoryItem item, ObjectRef object)
Selects the item, waits for native acknowledgement, then revalidates and clicks the target.
-
useOn
public void useOn(InventoryItem item, GroundItemRef groundItem)
-
useOnAsync
public SubmissionResult useOnAsync(InventoryItem item, GroundItemRef groundItem)
Selects the item, waits for native acknowledgement, then revalidates and clicks the target.
-
useOn
public void useOn(InventoryItem item, InventoryItem target)
-
useOnAsync
public SubmissionResult useOnAsync(InventoryItem item, InventoryItem target)
Selects the item, waits for native acknowledgement, then revalidates and clicks the target.
-
interact
public void interact(InventoryItem item, java.lang.String action)
-
drop
public void drop(InventoryItem item)
-
requireCurrent
public void requireCurrent(InventoryItem item)
-
requireHeld
public void requireHeld(InventoryItem item)
Checks that the item is still in its slot, without requiring the inventory to be on screen. Spells aimed at an item are selected from the spellbook, and the game only brings the inventory back once the spell is selected.
-
-