Package rs.kreme.ksbot.api.wrappers
Class KSNPC
- java.lang.Object
-
- rs.kreme.ksbot.api.wrappers.KSNPC
-
- All Implemented Interfaces:
Interactable,Locatable,Positionable
public class KSNPC extends java.lang.Object implements Locatable, Interactable
-
-
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.intgetAnimation()intgetCombatLevel()net.runelite.api.NPCCompositiongetComp()Gets the NPC composition, which contains detailed data about the NPC.net.runelite.api.HeadIcongetHeadIcon()intgetHealth()intgetHealthPercentage()intgetHealthRatio()intgetId()Gets the NPC ID.intgetIndex()Gets the NPC Index.net.runelite.api.ActorgetInteracting()java.lang.StringgetName()Gets the name of the NPC.net.runelite.api.coords.WorldAreagetWorldArea()Gets the NPC's world area (the region in which the NPC is located).net.runelite.api.coords.WorldPointgetWorldLocation()voidinteract(int action)Interacts with the NPC using a specified action index.voidinteract(int index, net.runelite.api.MenuAction menuAction)voidinteract(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)booleaninteract(java.lang.String action)Interacts with the NPC using a specified action name.voidinteract(net.runelite.api.MenuAction menuAction)booleanisAnimating()booleanisDead()Checks if the NPC is dead.java.lang.StringtoString()-
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()
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.- Specified by:
getActionsin interfaceInteractable- Returns:
- an array of Strings representing the available actions.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getComp
public net.runelite.api.NPCComposition getComp()
Gets the NPC composition, which contains detailed data about the NPC.- Returns:
- the
NPCCompositionobject for the NPC.
-
getWorldArea
public net.runelite.api.coords.WorldArea getWorldArea()
Gets the NPC's world area (the region in which the NPC is located).- Returns:
- the
WorldAreaobject representing the NPC's location.
-
isDead
public boolean isDead()
Checks if the NPC is dead.- Returns:
trueif the NPC is dead,falseotherwise.
-
interact
public void interact(int action)
Interacts with the NPC using a specified action index.- Specified by:
interactin interfaceInteractable- 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.- Specified by:
interactin interfaceInteractable- Parameters:
action- the name of the action to perform (e.g., "Talk-to").
-
interact
public void interact(net.runelite.api.MenuAction menuAction)
- Specified by:
interactin interfaceInteractable
-
getWorldLocation
public net.runelite.api.coords.WorldPoint getWorldLocation()
- Specified by:
getWorldLocationin interfaceLocatable- Specified by:
getWorldLocationin 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()
-
interact
public void interact(int index, net.runelite.api.MenuAction menuAction, int param0, int param1)- Specified by:
interactin interfaceInteractable
-
interact
public void interact(int index, net.runelite.api.MenuAction menuAction)- Specified by:
interactin interfaceInteractable
-
-