Jump to content

How to send an ingame message?


Spork

Recommended Posts

 

Edit:

messages = (ArrayList<String>) getChatbox().getMessages(MessageType.PLAYER);
    	String message;
    	if(messages.size() > 0) {
    		message = messages.get(messages.size() - 1);
    	} else {
    		message = "";
    	}

This code works when the bot loads, but after the chatbox updates with a new public message it crashes with an indexOutOfBounds exception: -1 @line 45

After researching this it seems others have this issue and it might have been a game update that broke this function? :( 

Link to comment
Share on other sites

Edit:

messages = (ArrayList<String>) getChatbox().getMessages(MessageType.PLAYER);
    	String message;
    	if(messages.size() > 0) {
    		message = messages.get(messages.size() - 1);
    	} else {
    		message = "";
    	}
This code works when the bot loads, but after the chatbox updates with a new public message it crashes with an indexOutOfBounds exception: -1 @line 45

After researching this it seems others have this issue and it might have been a game update that broke this function? sad.png

Don't cast it like that. Just use the array.

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