Jump to content

Detect exit of NMZ dream


Recommended Posts

Posted (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 by Fich420
Posted

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.
        }
    }

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...