Jump to content

Detect exit of NMZ dream


BananaTown

Recommended Posts

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
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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