kamilo 7 Share Posted May 19, 2021 what the hell happened to class implements advancedmessagelistener its not avalible anymore? whats the new one and please show me a sample so i understand how the new thing works Link to comment Share on other sites More sharing options...
Bonfire 331 Share Posted May 19, 2021 7 minutes ago, kamilo said: what the hell happened to class implements advancedmessagelistener its not avalible anymore? whats the new one and please show me a sample so i understand how the new thing works Hey @kamilo! I'll go ahead and paste the message I posted for someone else on the forums below. You can achieve what you've set out to do using the "ChatListener" interface. Simply implement the ChatListener in your script and override the method you'd like to use. I've provided an example for you below. public class TestScript implements ChatListener { ... some code here ... @Override public void onGameMessage(Message message) { if (message.getMessage().contains("The fire catches and the logs begin to burn")) { shouldLightFire = true; } } } You can view all of the methods that can be overridden for ChatListener here: https://dreambot.org/javadocs/org/dreambot/api/script/listener/ChatListener.html You can view all of the information provided by a "Message" here: https://dreambot.org/javadocs/org/dreambot/api/wrappers/widgets/message/Message.html The different overrides are for the different types of message (game message, clan message, etc.). You can also use the catch-all "onMessage()" method. Hope that helps! Best of luck 🙂 Link to comment Share on other sites More sharing options...
kamilo 7 Author Share Posted May 19, 2021 41 minutes ago, Bonfire said: Hey @kamilo! I'll go ahead and paste the message I posted for someone else on the forums below. You can achieve what you've set out to do using the "ChatListener" interface. Simply implement the ChatListener in your script and override the method you'd like to use. I've provided an example for you below. public class TestScript implements ChatListener { ... some code here ... @Override public void onGameMessage(Message message) { if (message.getMessage().contains("The fire catches and the logs begin to burn")) { shouldLightFire = true; } } } You can view all of the methods that can be overridden for ChatListener here: https://dreambot.org/javadocs/org/dreambot/api/script/listener/ChatListener.html You can view all of the information provided by a "Message" here: https://dreambot.org/javadocs/org/dreambot/api/wrappers/widgets/message/Message.html The different overrides are for the different types of message (game message, clan message, etc.). You can also use the catch-all "onMessage()" method. Hope that helps! Best of luck 🙂 ah so it was just renamed then? Link to comment Share on other sites More sharing options...
Bonfire 331 Share Posted May 19, 2021 Just now, kamilo said: ah so it was just renamed then? I'm not too familiar with DB2's API, but I would guess that is the case. Link to comment Share on other sites More sharing options...
PhilBox 24 Share Posted May 19, 2021 Yes it was Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.