use of net.runelite.api.queries.NPCQuery in project runelite by runelite.
the class ImplingsPlugin method onGameTick.
@Subscribe
public void onGameTick(GameTick event) {
NPCQuery implingQuery = new NPCQuery().idEquals(Ints.toArray(ids.keySet()));
implings = queryRunner.runQuery(implingQuery);
}
use of net.runelite.api.queries.NPCQuery in project runelite by runelite.
the class FishingPlugin method checkSpots.
@Subscribe
public void checkSpots(GameTick event) {
NPCQuery query = new NPCQuery().idEquals(Ints.toArray(spotIds));
fishingSpots = queryRunner.runQuery(query);
}
use of net.runelite.api.queries.NPCQuery in project runelite by runelite.
the class PestControlOverlay method renderSpinners.
private void renderSpinners(Graphics2D graphics) {
Query query = new NPCQuery().nameEquals("Spinner");
NPC[] result = queryRunner.runQuery(query);
Arrays.stream(result).forEach(npc -> OverlayUtil.renderActorOverlay(graphics, npc, npc.getName(), Color.CYAN));
}
use of net.runelite.api.queries.NPCQuery in project runelite by runelite.
the class ClueScrollPlugin method checkForClues.
@Schedule(period = 600, unit = ChronoUnit.MILLIS)
public void checkForClues() {
if (client.getGameState() == GameState.LOGIN_SCREEN) {
clue = null;
return;
}
npcsToMark = null;
objectsToMark = null;
equippedItems = null;
if (clue instanceof NpcClueScroll) {
String npc = ((NpcClueScroll) clue).getNpc();
if (npc != null) {
Query query = new NPCQuery().nameContains(npc);
npcsToMark = queryRunner.runQuery(query);
}
}
if (clue instanceof ObjectClueScroll) {
int objectId = ((ObjectClueScroll) clue).getObjectId();
if (objectId != -1) {
GameObjectQuery query = new GameObjectQuery().idEquals(objectId);
objectsToMark = queryRunner.runQuery(query);
}
}
if (clue instanceof EmoteClue) {
equippedItems = new HashSet<>();
Item[] result = queryRunner.runQuery(new InventoryItemQuery(InventoryID.EQUIPMENT));
if (result != null) {
for (Item item : result) {
equippedItems.add(item.getId());
}
}
}
ClueScroll clue = findClueScroll();
if (clue == null && this.clue != null) {
// wait for WAIT_DURATION before discarding the knowledge of the player having a clue.
if (Instant.now().compareTo(clueTimeout.plus(WAIT_DURATION)) < 0) {
return;
}
}
// so the clue window doesn't have to be open.
if (clue != null) {
this.clue = clue;
this.clueTimeout = Instant.now();
}
}
use of net.runelite.api.queries.NPCQuery in project runelite by runelite.
the class FightCavePlugin method findJad.
private NPC findJad() {
Query query = new NPCQuery().nameContains("TzTok-Jad");
NPC[] result = queryRunner.runQuery(query);
return result.length >= 1 ? result[0] : null;
}
Aggregations