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 class
KSItem.Type
-
Constructor Summary
Constructors Constructor Description KSItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canNote()
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.ItemComposition
getComp()
Retrieves the item composition (definition) for this item.java.lang.String
getName()
Gets the name of the item.int
getOptionIndex(java.lang.String action)
Gets the index of an action for this item based on its name.KSItem.Type
getType()
void
interact(int option)
Interacts with the item using a specific option (low priority).void
interact(int option, net.runelite.api.MenuAction menuAction)
Interacts with the item using a specific option and menu action.void
interact(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)
Deprecated.boolean
interact(java.lang.String option)
Interacts with the item using a specified action name.void
interact(net.runelite.api.MenuAction menuAction)
boolean
isNoted()
Checks if the item is noted (i.e., a banknote version of an item).java.lang.String
toString()
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
null
if unavailable.
-
getActions
public java.lang.String[] getActions()
Gets the actions available for the item.- Specified by:
getActions
in interfaceInteractable
- Returns:
- an array of Strings representing the available actions, or
null
if none.
-
isNoted
public boolean isNoted()
Checks if the item is noted (i.e., a banknote version of an item).- Returns:
true
if the item is noted,false
otherwise.
-
interact
public void interact(int option)
Interacts with the item using a specific option (low priority).- Specified by:
interact
in 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:
interact
in 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:
interact
in interfaceInteractable
- Parameters:
option
- the name of the action to perform (e.g., "Use", "Drop").- Returns:
true
if the interaction is triggered successfully,false
otherwise.
-
getComp
public net.runelite.api.ItemComposition getComp()
Retrieves the item composition (definition) for this item.- Returns:
- the
ItemComposition
object representing the item.
-
canNote
public boolean canNote()
Checks if the item can be converted to a noted version.- Returns:
true
if the item can be noted,false
otherwise.
-
getOptionIndex
public int getOptionIndex(java.lang.String action)
Gets the index of an action for this item based on its name.- Specified by:
getOptionIndex
in 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:
interact
in interfaceInteractable
-
interact
@Deprecated public void interact(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)
Deprecated.- Specified by:
interact
in 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:
toString
in classjava.lang.Object
- Returns:
- a formatted string describing the item.
-
-