March 26, 201510 yr Is there a way to listen to NPC yells that are not visible in the chatbox? For example, the messages by random event NPCs or cows saying 'Moo'? onMessage() only works if the message is shown in the ingame chatbox. Thanks. Edited March 26, 201510 yr by GSC
March 26, 201510 yr Don't honestly know. But i'd assume something like this. npcs.closest(new Filter<NPC>() { @Override public boolean match(NPC npc) { return npc.getHeadMessage().equals("YOLO!") && npc.getRecentMessages().contains("YOLO!"); } });
March 26, 201510 yr Don't honestly know. But i'd assume something like this. npcs.closest(new Filter<NPC>() { @Override public boolean match(NPC npc) { return npc.getHeadMessage().equals("YOLO!") && npc.getRecentMessages().contains("YOLO!"); } }); how long u been scripting for mate? curiosity
March 26, 201510 yr Author Don't honestly know. But i'd assume something like this. npcs.closest(new Filter<NPC>() { @Override public boolean match(NPC npc) { return npc.getHeadMessage().equals("YOLO!") && npc.getRecentMessages().contains("YOLO!"); } }); You clearly know what you're doing. Somehow I had missed the getHeadMessage() API. It returns null when there's no head message so one null check needs to be added and I didn't need the recent messages myself. But essentially solved my problem, thanks!
Create an account or sign in to comment