November 1, 201510 yr 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
November 1, 201510 yr 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, 201510 yr by Explv
Create an account or sign in to comment