BananaTown Posted October 21, 2020 Share Posted October 21, 2020 (edited) so I am trying to detect the end of a NMZ dream to make the account logout, and client stop. I was thinking the best way of doing this would be using Chatbox.MessageType.valueOf("you wakeup feeling refreshed"); If there is a better way of doing this please comment below. I am struggling fairly hard lol EDIT: could also create a area around player ~15 tiles and create a check for players onloop, what do you guys think is best? Edited October 21, 2020 by Fich420 Quote Link to comment Share on other sites More sharing options...
Nbacon Posted October 21, 2020 Share Posted October 21, 2020 (edited) I would say... override the RandomEvent.BREAK_MANAGER and in shouldActivate make that player in square and in onLoop logout and stop script Edited October 21, 2020 by Nbacon Quote Link to comment Share on other sites More sharing options...
Malcolm Posted October 21, 2020 Share Posted October 21, 2020 Assuming there is a chatbox message, just use the onMessage() method and check for that message and if it appears set youself to stop the script. public void onMessage(final Message message) { if (message.getMessage().contains("you wakeup feeling refreshed")) { //TODO either set a boolean to stop or just stop. } } Quote Link to comment Share on other sites More sharing options...