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 voiddrop(java.lang.String... items)Drops the first occurrence of the specified items by name from the inventory.voiddropAll(int... items)Drops all occurrences of the specified items by ID from the inventory.voiddropAll(java.lang.String... items)Drops all occurrences of the specified items by name from the inventory.voiddropAllExcept(int... items)Drops all occurrences of the without specified items by ID from the inventory.voiddropAllExcept(java.lang.String... items)Drops all occurrences of the without specified items by name from the inventory.voiditemOnItem(KSItem primary, KSItem secondary)Uses one item on another item in the inventory.booleanitemOnNpc(KSItem item, KSNPC npc)booleanitemOnObject(KSItem item, KSObject object)voidwear(int... items)Equips all occurrences of the specified items by ID from the inventory.voidwear(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.
-
dropAllExcept
public void dropAllExcept(int... items)
Drops all occurrences of the without specified items by ID from the inventory.- Parameters:
items- The IDs of the items not to drop.
-
dropAllExcept
public void dropAllExcept(java.lang.String... items)
Drops all occurrences of the without specified items by name from the inventory.- Parameters:
items- The name of the items not 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.
-
-