Package rs.kreme.ksbot.api.wrappers
Class KSPlayer
- java.lang.Object
-
- rs.kreme.ksbot.api.wrappers.KSPlayer
-
- All Implemented Interfaces:
Locatable
,Positionable
public class KSPlayer extends java.lang.Object implements Locatable
-
-
Constructor Summary
Constructors Constructor Description KSPlayer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getActionIndex(java.lang.String action)
Gets the index of a specific action in the player's available actions.java.lang.String[]
getActions()
Gets the available action options for interacting with the player.int
getAnimation()
int
getCombatLevel()
Gets the combat level of the player.net.runelite.api.PlayerComposition
getComp()
Gets the player's composition (e.g., appearance details).int
getGraphics()
int
getId()
Gets the unique ID of the player.net.runelite.api.Actor
getInteracting()
Gets the actor that the player is currently interacting with, if any.net.runelite.api.coords.LocalPoint
getLocalLocation()
net.runelite.api.coords.LocalPoint
getLocalPoint()
java.lang.String
getName()
Gets the name of the player.net.runelite.api.coords.WorldPoint
getWorldLocation()
Gets the current world location of the player.boolean
hasAction(java.lang.String action)
Checks if the player has a specific action available.boolean
inMotion()
void
interact(int action)
Interacts with the player using a specific action index.boolean
interact(java.lang.String option)
Interacts with the player using a specified action option by name.void
interact(net.runelite.api.MenuAction menuAction)
Interacts with the player using the specified `MenuAction`.boolean
isAnimating()
boolean
isDead()
Checks if the player is dead.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface rs.kreme.ksbot.api.interfaces.Locatable
distanceTo, distanceTo, getPlane, getWorldX, getWorldY
-
-
-
-
Method Detail
-
getId
public int getId()
Gets the unique ID of the player.- Returns:
- the player's ID as an integer
-
getName
public java.lang.String getName()
Gets the name of the player.- Returns:
- the player's name as a string
-
getWorldLocation
public net.runelite.api.coords.WorldPoint getWorldLocation()
Gets the current world location of the player.- Specified by:
getWorldLocation
in interfaceLocatable
- Specified by:
getWorldLocation
in interfacePositionable
- Returns:
- the player's world location as a WorldPoint object
-
getLocalPoint
public net.runelite.api.coords.LocalPoint getLocalPoint()
-
getCombatLevel
public int getCombatLevel()
Gets the combat level of the player.- Returns:
- the player's combat level as an integer
-
getInteracting
public net.runelite.api.Actor getInteracting()
Gets the actor that the player is currently interacting with, if any.- Returns:
- the Actor instance the player is interacting with, or null if none
-
isDead
public boolean isDead()
Checks if the player is dead.- Returns:
- true if the player is dead, false otherwise
-
getComp
public net.runelite.api.PlayerComposition getComp()
Gets the player's composition (e.g., appearance details).- Returns:
- the player's PlayerComposition object
-
getActions
public java.lang.String[] getActions()
Gets the available action options for interacting with the player.- Returns:
- an array of strings representing the player's available actions
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hasAction
public boolean hasAction(java.lang.String action)
Checks if the player has a specific action available.- Parameters:
action
- the name of the action to check- Returns:
- true if the action is available, false otherwise
-
getActionIndex
public int getActionIndex(java.lang.String action)
Gets the index of a specific action in the player's available actions.- Parameters:
action
- the name of the action to find- Returns:
- the index of the action, or -1 if the action is not found
-
interact
public boolean interact(java.lang.String option)
Interacts with the player using a specified action option by name.- Parameters:
option
- the name of the action to perform- Returns:
- true if the interaction was successful, false otherwise
-
interact
public void interact(int action)
Interacts with the player using a specific action index.- Parameters:
action
- the index of the action (between 0 and 7)
-
interact
public void interact(net.runelite.api.MenuAction menuAction)
Interacts with the player using the specified `MenuAction`.- Parameters:
menuAction
- the `MenuAction` enum that specifies which action to perform on the player.
-
getAnimation
public int getAnimation()
-
isAnimating
public boolean isAnimating()
-
getGraphics
public int getGraphics()
-
inMotion
public boolean inMotion()
-
getLocalLocation
public net.runelite.api.coords.LocalPoint getLocalLocation()
- Specified by:
getLocalLocation
in interfaceLocatable
-
-