Package rs.kreme.ksbot.api.wrappers
Class KSObject
- java.lang.Object
-
- rs.kreme.ksbot.api.wrappers.KSObject
-
- All Implemented Interfaces:
Interactable,Locatable,Positionable
public class KSObject extends java.lang.Object implements Locatable, Interactable
A wrapper class for RuneLite TileObjects, providing interaction and location logic. Supports retrieving metadata and interacting with in-game objects.
-
-
Constructor Summary
Constructors Constructor Description KSObject()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String[]getActions()intgetAnimation()Retrieves the animation ID of the object, if any.net.runelite.api.PointgetClickPoint()intgetId()java.lang.StringgetName()net.runelite.api.coords.WorldPointgetWorldLocation()voidinteract(int action)Interacts with the object using the specified action index.voidinteract(int index, net.runelite.api.MenuAction menuAction)Deprecated.voidinteract(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)Invokes a raw interaction with full parameters.booleaninteract(java.lang.String action)Interacts with the object using a specific action name.booleaninteract(java.lang.String... actions)Attempts to interact with the object using the first matching action name.voidinteract(net.runelite.api.MenuAction menuAction)Interacts with the object using a specific MenuAction.booleanisAnimating()Checks if the object is currently animating.java.lang.StringtoString()Returns a formatted string describing this object.-
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, getOptionIndex, hasAction
-
Methods inherited from interface rs.kreme.ksbot.api.interfaces.Locatable
distanceTo, distanceTo, getLocalLocation, getPlane, getWorldX, getWorldY
-
-
-
-
Method Detail
-
getId
public int getId()
- Returns:
- the object ID of the TileObject.
-
getName
public java.lang.String getName()
- Returns:
- the name of the object.
-
getActions
public java.lang.String[] getActions()
- Specified by:
getActionsin interfaceInteractable- Returns:
- an array of action strings available for the object.
-
toString
public java.lang.String toString()
Returns a formatted string describing this object.- Overrides:
toStringin classjava.lang.Object- Returns:
- string representation of the object.
-
interact
public boolean interact(java.lang.String... actions)
Attempts to interact with the object using the first matching action name.- Parameters:
actions- a list of action names to try.- Returns:
- true if interaction succeeded, false otherwise.
-
getClickPoint
public net.runelite.api.Point getClickPoint()
- Returns:
- the scene click point of the object.
-
getWorldLocation
public net.runelite.api.coords.WorldPoint getWorldLocation()
- Specified by:
getWorldLocationin interfaceLocatable- Specified by:
getWorldLocationin interfacePositionable- Returns:
- the world location of the object.
-
getAnimation
public int getAnimation()
Retrieves the animation ID of the object, if any.- Returns:
- the animation ID or -1 if not animating.
-
isAnimating
public boolean isAnimating()
Checks if the object is currently animating.- Returns:
- true if animating, false otherwise.
-
interact
public void interact(int action)
Interacts with the object using the specified action index.- Specified by:
interactin interfaceInteractable- Parameters:
action- index of the action.
-
interact
public void interact(net.runelite.api.MenuAction menuAction)
Interacts with the object using a specific MenuAction.- Specified by:
interactin interfaceInteractable- Parameters:
menuAction- the menu action to use.
-
interact
public boolean interact(java.lang.String action)
Interacts with the object using a specific action name.- Specified by:
interactin interfaceInteractable- Parameters:
action- the action string.- Returns:
- true if the interaction was successful, false otherwise.
-
interact
public void interact(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)Invokes a raw interaction with full parameters.- Specified by:
interactin interfaceInteractable- Parameters:
index- click X positionmenuAction- type of interactionparam0- param0 (often X position)param1- param1 (often object ID)
-
interact
@Deprecated public void interact(int index, net.runelite.api.MenuAction menuAction)Deprecated.Deprecated interaction method (unused).- Specified by:
interactin interfaceInteractable
-
-