MrBooter 0 Share Posted October 27, 2018 I'm new to this, and im having real trouble reading things from chat, and executing lines when a specific msg pops up. Idea is that when i get stuck on "You can't light a fire here", it notices from chat, and i move. If anyone could teach me how to use MessageListener id be gratefull. Link to comment Share on other sites More sharing options...
Banker 175 Featured Comment Share Posted October 27, 2018 I'd personally recommend just using AdvancedMessageListener public class Main extends AbstractScript implements AdvancedMessageListener { public int onLoop() { return 0; } ... public void onGameMessage(Message msg) { if(msg.getMessage().toLowerCase().contains("you can't light") { // do something } } } Not sure of the exact usage but what I've written should work as at least a base for what you're trying to do. This should also work for other types of messages. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.