imJordanB Posted November 1, 2015 Share Posted November 1, 2015 So I'm trying to store a chat message into a variable and String doesn't work, i'm new to Java and don't really know how to go about this as it seems that getChatbox().getMessages(MessageType.PLAYER) does not return something that can simply go under a String variable. I am currently working on a mimmick bot and will store the players message to then output it. I have tried simply outputting without saving to a variable also, with the line: getKeyboard().typeString(getChatbox().getMessages(MessageType.PLAYER)); (This is probably horribly wrong, i am completely new to the keyboard api. Any help is appreciated Quote Link to comment Share on other sites More sharing options...
Explv Posted November 1, 2015 Share Posted November 1, 2015 (edited) So I'm trying to store a chat message into a variable and String doesn't work, i'm new to Java and don't really know how to go about this as it seems that getChatbox().getMessages(MessageType.PLAYER) does not return something that can simply go under a String variable. I am currently working on a mimmick bot and will store the players message to then output it. I have tried simply outputting without saving to a variable also, with the line: getKeyboard().typeString(getChatbox().getMessages(MessageType.PLAYER)); (This is probably horribly wrong, i am completely new to the keyboard api. Any help is appreciated List<String> messages = getChatbox().getMessages(MessageType.PLAYER); it returns a list of messages, not a single message. Edit: If you are trying to get the most recent message you would use something like: List<String> messages = getChatbox().getMessages(MessageType.PLAYER); String message = messages.get(messages.size() - 1); Edited November 1, 2015 by Explv 1 Quote Link to comment Share on other sites More sharing options...