Package rs.kreme.ksbot.api.wrappers
Class KSNPC
- java.lang.Object
-
- rs.kreme.ksbot.api.wrappers.KSNPC
-
- All Implemented Interfaces:
Locatable
,Positionable
public class KSNPC extends java.lang.Object implements Locatable
-
-
Constructor Summary
Constructors Constructor Description KSNPC(net.runelite.api.NPC npc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getActions()
Gets the actions available for the NPC.int
getAnimation()
int
getCombatLevel()
net.runelite.api.NPCComposition
getComp()
Gets the NPC composition, which contains detailed data about the NPC.net.runelite.api.HeadIcon
getHeadIcon()
int
getHealth()
int
getHealthPercentage()
int
getHealthRatio()
int
getId()
Gets the NPC ID.int
getIndex()
Gets the NPC Index.net.runelite.api.Actor
getInteracting()
net.runelite.api.coords.LocalPoint
getLocalLocation()
java.lang.String
getName()
Gets the name of the NPC.int
getOptionIndex(java.lang.String action)
Finds the index of a specified action in the NPC's available actions.net.runelite.api.coords.WorldArea
getWorldArea()
Gets the NPC's world area (the region in which the NPC is located).net.runelite.api.coords.WorldPoint
getWorldLocation()
boolean
interact(int action)
Interacts with the NPC using a specified action index.boolean
interact(java.lang.String action)
Interacts with the NPC using a specified action name.void
interact(net.runelite.api.MenuAction menuAction)
boolean
isAnimating()
boolean
isDead()
Checks if the NPC 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 NPC ID.- Returns:
- the ID of the NPC.
-
getIndex
public int getIndex()
Gets the NPC Index.- Returns:
- the Index of the NPC.
-
getName
public java.lang.String getName()
Gets the name of the NPC.- Returns:
- the name of the NPC as a String.
-
getActions
public java.lang.String[] getActions()
Gets the actions available for the NPC.- Returns:
- an array of Strings representing the available actions.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getComp
public net.runelite.api.NPCComposition getComp()
Gets the NPC composition, which contains detailed data about the NPC.- Returns:
- the
NPCComposition
object for the NPC.
-
getOptionIndex
public int getOptionIndex(java.lang.String action)
Finds the index of a specified action in the NPC's available actions.- Parameters:
action
- the name of the action to search for.- Returns:
- the index of the action in the action array, or -1 if not found.
-
getWorldArea
public net.runelite.api.coords.WorldArea getWorldArea()
Gets the NPC's world area (the region in which the NPC is located).- Returns:
- the
WorldArea
object representing the NPC's location.
-
isDead
public boolean isDead()
Checks if the NPC is dead.- Returns:
true
if the NPC is dead,false
otherwise.
-
interact
public boolean interact(int action)
Interacts with the NPC using a specified action index.- Parameters:
action
- the index of the action to perform (1-based).
-
interact
public boolean interact(java.lang.String action)
Interacts with the NPC using a specified action name.- Parameters:
action
- the name of the action to perform (e.g., "Talk-to").
-
interact
public void interact(net.runelite.api.MenuAction menuAction)
-
getLocalLocation
public net.runelite.api.coords.LocalPoint getLocalLocation()
- Specified by:
getLocalLocation
in interfaceLocatable
-
getWorldLocation
public net.runelite.api.coords.WorldPoint getWorldLocation()
- Specified by:
getWorldLocation
in interfaceLocatable
- Specified by:
getWorldLocation
in interfacePositionable
-
getAnimation
public int getAnimation()
-
isAnimating
public boolean isAnimating()
-
getHealthRatio
public int getHealthRatio()
-
getHealth
public int getHealth()
-
getHealthPercentage
public int getHealthPercentage()
-
getHeadIcon
public net.runelite.api.HeadIcon getHeadIcon()
-
getInteracting
public net.runelite.api.Actor getInteracting()
-
getCombatLevel
public int getCombatLevel()
-
-