Package rs.kreme.ksbot.api.wrappers
Class KSItem
- java.lang.Object
-
- rs.kreme.ksbot.api.wrappers.KSItem
-
- All Implemented Interfaces:
Interactable
public class KSItem extends java.lang.Object implements Interactable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKSItem.Type
-
Constructor Summary
Constructors Constructor Description KSItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancanNote()Checks if the item can be converted to a noted version.java.lang.String[]getActions()Gets the actions available for the item.net.runelite.api.ItemCompositiongetComp()Retrieves the item composition (definition) for this item.java.lang.StringgetName()Gets the name of the item.intgetOptionIndex(java.lang.String action)Gets the index of an action for this item based on its name.KSItem.TypegetType()voidinteract(int option)Interacts with the item using a specific option (low priority).voidinteract(int option, net.runelite.api.MenuAction menuAction)Interacts with the item using a specific option and menu action.voidinteract(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)Deprecated.booleaninteract(java.lang.String option)Interacts with the item using a specified action name.voidinteract(net.runelite.api.MenuAction menuAction)booleanisNoted()Checks if the item is noted (i.e., a banknote version of an item).java.lang.StringtoString()Provides a string representation of the item, including its name, ID, slot, and widget.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface rs.kreme.ksbot.api.interfaces.Interactable
getClickBounds, hasAction
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the item.- Returns:
- the item's name as a String, or
nullif unavailable.
-
getActions
public java.lang.String[] getActions()
Gets the actions available for the item.- Specified by:
getActionsin interfaceInteractable- Returns:
- an array of Strings representing the available actions, or
nullif none.
-
isNoted
public boolean isNoted()
Checks if the item is noted (i.e., a banknote version of an item).- Returns:
trueif the item is noted,falseotherwise.
-
interact
public void interact(int option)
Interacts with the item using a specific option (low priority).- Specified by:
interactin interfaceInteractable- Parameters:
option- the index of the action to perform.
-
interact
public void interact(int option, net.runelite.api.MenuAction menuAction)Interacts with the item using a specific option and menu action.- Specified by:
interactin interfaceInteractable- Parameters:
option- the index of the action to perform.menuAction- the menu action associated with the interaction.
-
interact
public boolean interact(java.lang.String option)
Interacts with the item using a specified action name.- Specified by:
interactin interfaceInteractable- Parameters:
option- the name of the action to perform (e.g., "Use", "Drop").- Returns:
trueif the interaction is triggered successfully,falseotherwise.
-
getComp
public net.runelite.api.ItemComposition getComp()
Retrieves the item composition (definition) for this item.- Returns:
- the
ItemCompositionobject representing the item.
-
canNote
public boolean canNote()
Checks if the item can be converted to a noted version.- Returns:
trueif the item can be noted,falseotherwise.
-
getOptionIndex
public int getOptionIndex(java.lang.String action)
Gets the index of an action for this item based on its name.- Specified by:
getOptionIndexin interfaceInteractable- Parameters:
action- the name of the action to look for (e.g., "Drop").- Returns:
- the index of the action in the action list, or -1 if the action is not found.
-
interact
public void interact(net.runelite.api.MenuAction menuAction)
- Specified by:
interactin interfaceInteractable
-
interact
@Deprecated public void interact(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)Deprecated.- Specified by:
interactin interfaceInteractable
-
getType
public KSItem.Type getType()
-
toString
public java.lang.String toString()
Provides a string representation of the item, including its name, ID, slot, and widget.- Overrides:
toStringin classjava.lang.Object- Returns:
- a formatted string describing the item.
-
-