Class 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()  
      int getAnimation()
      Retrieves the animation ID of the object, if any.
      net.runelite.api.Point getClickPoint()  
      int getId()  
      java.lang.String getName()  
      net.runelite.api.coords.WorldPoint getWorldLocation()  
      void interact​(int action)
      Interacts with the object using the specified action index.
      void interact​(int index, net.runelite.api.MenuAction menuAction)
      Deprecated.
      void interact​(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)
      Invokes a raw interaction with full parameters.
      boolean interact​(java.lang.String action)
      Interacts with the object using a specific action name.
      boolean interact​(java.lang.String... actions)
      Attempts to interact with the object using the first matching action name.
      void interact​(net.runelite.api.MenuAction menuAction)
      Interacts with the object using a specific MenuAction.
      boolean isAnimating()
      Checks if the object is currently animating.
      java.lang.String toString()
      Returns a formatted string describing this object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • KSObject

        public KSObject()
    • 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:
        getActions in interface Interactable
        Returns:
        an array of action strings available for the object.
      • toString

        public java.lang.String toString()
        Returns a formatted string describing this object.
        Overrides:
        toString in class java.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.
      • 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:
        interact in interface Interactable
        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:
        interact in interface Interactable
        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:
        interact in interface Interactable
        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:
        interact in interface Interactable
        Parameters:
        index - click X position
        menuAction - type of interaction
        param0 - 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:
        interact in interface Interactable