Jump to content
Tsopic

onMessage

Recommended Posts

Guest Apogee
	public void onMessage(String message) throws InterruptedException {
		if (message.contains("You manage to mine some")) {
                   log("cookies.")
		}

If i mine some ore in-game, and i get a game message that has the text "you manage to mine some", then it will output with something in the If statement. In this case, if i mine something, then the log will display "cookies." :) I hope i helped.

Link to comment
Share on other sites

	public void onMessage(String message) throws InterruptedException {
		if (message.contains("You manage to mine some")) {
                   log("cookies.")
		}

If i mine some ore in-game, and i get a game message that has the text "you manage to mine some", then it will output with something in the If statement. In this case, if i mine something, then the log will display "cookies." smile.png I hope i helped.

 

This^

 

Also, you should note that you don't actually want to perform any actions inside of the onMessage(). Use the message you receive to assign certain variables a value, or determine what you SHOULD do.

Edited by Deffiliate
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Recently Browsing   0 members

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