GSC Posted March 26, 2015 Share 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 Quote Link to comment Share on other sites More sharing options...
Isolate Posted March 26, 2015 Share 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 Quote Link to comment Share on other sites More sharing options...
Shit Posted March 26, 2015 Share 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 Quote Link to comment Share on other sites More sharing options...
Isolate Posted March 26, 2015 Share Posted March 26, 2015 how long u been scripting for mate? curiosity About 3 years now Quote Link to comment Share on other sites More sharing options...
GSC Posted March 26, 2015 Author Share 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! Quote Link to comment Share on other sites More sharing options...