Package rs.kreme.ksbot.api.queries
Class NPCQuery
- java.lang.Object
-
- rs.kreme.ksbot.api.queries.Query<KSNPC,NPCQuery>
-
- rs.kreme.ksbot.api.queries.NPCQuery
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NPCQuery
aboveDistance(int distance)
Filters NPCs above a certain distance from the local player.NPCQuery
alive()
Filters NPCs that are alive (not dead).NPCQuery
atLocation(net.runelite.api.coords.WorldPoint wp)
Filters NPCs located at a specific world point.KSNPC
closest()
Retrieves the closest npc to the local player.KSNPC
furthest()
Retrieves the furthest npc to the local player.NPCQuery
hasHintArrow()
Filters NPCs that have a hint arrow above their head.NPCQuery
interacting()
Filters NPCs that are interacting with any actor.NPCQuery
interactingWith(net.runelite.api.Actor actor)
Filters NPCs that are interacting with a specific actor.NPCQuery
interactingWithLocal()
Filters NPCs that are interacting with the local player.NPCQuery
meleeable()
Filters NPCs that are meleeable (can be attacked in melee combat).NPCQuery
noOneInteractingWith()
Filters NPCs that no player is interacting with.NPCQuery
notInteracting()
Filters NPCs that are not interacting with any actor.NPCQuery
withAnimation(int id)
Filters NPCs by a specific animation.NPCQuery
withGraphic(int graphic)
Filters NPCs by a specific graphic.NPCQuery
withIndex(int index)
Filters NPCs by their index.NPCQuery
withinDistance(int distance)
Filters NPCs within a certain distance from the local player.NPCQuery
withinLevel(int low, int high)
Filters NPCs within a specific combat level range.NPCQuery
withLoS()
Filters NPCs that have a line of sight to the local player.NPCQuery
withoutAnimation(int id)
Filters NPCs excluding a specific animation.NPCQuery
withoutGraphic(int graphic)
Filters NPCs that do not have a specific graphic.-
Methods inherited from class rs.kreme.ksbot.api.queries.Query
count, empty, exists, filter, first, first, last, list, list, max, min, omit, omit, omit, random, shuffledList, shuffledList, sorted, stream, unique, withId, withName, withNameOrId, withOption, withoutId, withoutName, withoutNameOrId, withoutOption
-
-
-
-
Constructor Detail
-
NPCQuery
public NPCQuery(java.util.Collection<KSNPC> npcs)
Constructs a new NPCQuery instance.- Parameters:
npcs
- the collection of NPCs to query.
-
-
Method Detail
-
atLocation
public NPCQuery atLocation(net.runelite.api.coords.WorldPoint wp)
Filters NPCs located at a specific world point.- Parameters:
wp
- the world point to filter by.- Returns:
- the updated NPCQuery instance.
-
withIndex
public NPCQuery withIndex(int index)
Filters NPCs by their index.- Parameters:
index
- the NPC index to filter by.- Returns:
- the updated NPCQuery instance.
-
interactingWithLocal
public NPCQuery interactingWithLocal()
Filters NPCs that are interacting with the local player.- Returns:
- the updated NPCQuery instance.
-
interactingWith
public NPCQuery interactingWith(net.runelite.api.Actor actor)
Filters NPCs that are interacting with a specific actor.- Parameters:
actor
- the actor to filter by.- Returns:
- the updated NPCQuery instance.
-
interacting
public NPCQuery interacting()
Filters NPCs that are interacting with any actor.- Returns:
- the updated NPCQuery instance.
-
notInteracting
public NPCQuery notInteracting()
Filters NPCs that are not interacting with any actor.- Returns:
- the updated NPCQuery instance.
-
noOneInteractingWith
public NPCQuery noOneInteractingWith()
Filters NPCs that no player is interacting with.- Returns:
- the updated NPCQuery instance.
-
hasHintArrow
public NPCQuery hasHintArrow()
Filters NPCs that have a hint arrow above their head.- Returns:
- the updated NPCQuery instance.
-
meleeable
public NPCQuery meleeable()
Filters NPCs that are meleeable (can be attacked in melee combat).- Returns:
- the updated NPCQuery instance.
-
alive
public NPCQuery alive()
Filters NPCs that are alive (not dead).- Returns:
- the updated NPCQuery instance.
-
withLoS
public NPCQuery withLoS()
Filters NPCs that have a line of sight to the local player.- Returns:
- the updated NPCQuery instance.
-
withinLevel
public NPCQuery withinLevel(int low, int high)
Filters NPCs within a specific combat level range.- Parameters:
low
- the minimum combat level.high
- the maximum combat level.- Returns:
- the updated NPCQuery instance.
-
withinDistance
public NPCQuery withinDistance(int distance)
Filters NPCs within a certain distance from the local player.- Parameters:
distance
- the maximum distance to filter by.- Returns:
- the updated NPCQuery instance.
-
aboveDistance
public NPCQuery aboveDistance(int distance)
Filters NPCs above a certain distance from the local player.- Parameters:
distance
- the minimum distance to filter by.- Returns:
- the updated NPCQuery instance.
-
withoutGraphic
public NPCQuery withoutGraphic(int graphic)
Filters NPCs that do not have a specific graphic.- Parameters:
graphic
- the graphic ID to exclude.- Returns:
- the updated NPCQuery instance.
-
withGraphic
public NPCQuery withGraphic(int graphic)
Filters NPCs by a specific graphic.- Parameters:
graphic
- the graphic ID to include.- Returns:
- the updated NPCQuery instance.
-
withAnimation
public NPCQuery withAnimation(int id)
Filters NPCs by a specific animation.- Parameters:
id
- the animation ID to filter by.- Returns:
- the updated NPCQuery instance.
-
withoutAnimation
public NPCQuery withoutAnimation(int id)
Filters NPCs excluding a specific animation.- Parameters:
id
- the animation ID to exclude.- Returns:
- the updated NPCQuery instance.
-
closest
public KSNPC closest()
Retrieves the closest npc to the local player.- Returns:
- the closest KSNPC, or null if no npcs are found.
-
furthest
public KSNPC furthest()
Retrieves the furthest npc to the local player.- Returns:
- the furthest KSNPC, or null if no npcs are found.
-
-