Package rs.kreme.ksbot.api.hooks
Class Inventory
- java.lang.Object
-
- rs.kreme.ksbot.api.hooks.Items
-
- rs.kreme.ksbot.api.hooks.Inventory
-
public class Inventory extends Items
The Inventory class provides methods to interact with the player's inventory, including dropping items, using items on each other, and querying items by their name or ID. It extends the Items class and is responsible for managing inventory interactions in the game.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drop(java.lang.String... items)
Drops the first occurrence of the specified items by name from the inventory.void
dropAll(int... items)
Drops all occurrences of the specified items by ID from the inventory.void
dropAll(java.lang.String... items)
Drops all occurrences of the specified items by name from the inventory.void
itemOnItem(KSItem primary, KSItem secondary)
Uses one item on another item in the inventory.boolean
itemOnNpc(KSItem item, KSNPC npc)
boolean
itemOnObject(KSItem item, KSObject object)
void
wear(int... items)
Equips all occurrences of the specified items by ID from the inventory.void
wear(java.lang.String... items)
Equips all occurrences of the specified items by name from the inventory.-
Methods inherited from class rs.kreme.ksbot.api.hooks.Items
contains, contains, contains, containsAll, containsAll, getCount, getCount, getEmptySlots, getItem, isEmpty, isFull, query, size
-
-
-
-
Constructor Detail
-
Inventory
public Inventory(KSContext ctx)
Constructor for Inventory, initializing with the InventoryID and widget info for handling inventory items.
-
-
Method Detail
-
drop
public void drop(java.lang.String... items)
Drops the first occurrence of the specified items by name from the inventory.- Parameters:
items
- The names of the items to drop.
-
dropAll
public void dropAll(java.lang.String... items)
Drops all occurrences of the specified items by name from the inventory.- Parameters:
items
- The names of the items to drop.
-
dropAll
public void dropAll(int... items)
Drops all occurrences of the specified items by ID from the inventory.- Parameters:
items
- The IDs of the items to drop.
-
wear
public void wear(int... items)
Equips all occurrences of the specified items by ID from the inventory.- Parameters:
items
- The IDs of the items to equip.
-
wear
public void wear(java.lang.String... items)
Equips all occurrences of the specified items by name from the inventory.- Parameters:
items
- The name of the items to equip.
-
itemOnItem
public void itemOnItem(KSItem primary, KSItem secondary)
Uses one item on another item in the inventory. This simulates the action of interacting with two inventory items, such as combining them or using them together.- Parameters:
primary
- The primary item to use.secondary
- The secondary item to use the primary item on.
-
-