Xellic Posted December 25, 2014 Share Posted December 25, 2014 What do I input into my loop in order to activate my Message Listener method? Here it is: private void onMessage(String message) { if(message.contains("You get some oak logs.")) { itemsMade ++; } } Do I put something like String message = chatbox.getMessage(idk what goes here) ? Link to comment Share on other sites More sharing options...
Czar Posted December 25, 2014 Share Posted December 25, 2014 (edited) In your onStart method, make sure to activate the listener by doing getBot().addMessageListener(this); Then it will start listening for messages Edited December 25, 2014 by Czar 1 Link to comment Share on other sites More sharing options...
Xellic Posted December 25, 2014 Author Share Posted December 25, 2014 In your onStart method, make sure to activate the listener by doing getBot().addMessageListener(this); Then it will start listening for messages Where do I add the Message Listener method call? and with what parameters? Link to comment Share on other sites More sharing options...
Joseph Posted December 25, 2014 Share Posted December 25, 2014 Where do I add the Message Listener method call? and with what parameters? On the onStart add the method czar said. The parameter of that method is asking for any object that implements the message listener interface. The script implements the interface that why he use the keyword this. All you have to do now is override the onMessage Link to comment Share on other sites More sharing options...