GSC Posted March 26, 2015 Posted March 26, 2015 (edited) 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, 2015 by GSC
Isolate Posted March 26, 2015 Posted March 26, 2015 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!"); } }); 1
Shit Posted March 26, 2015 Posted March 26, 2015 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
Isolate Posted March 26, 2015 Posted March 26, 2015 how long u been scripting for mate? curiosity About 3 years now
GSC Posted March 26, 2015 Author Posted March 26, 2015 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!