February 20, 20187 yr How do I get the last chatbox message or the one which is previous it? I tried chatbox.getMessages().get(chatbox.getMessages().size()-1); That @Team Cape provided here but it doesn't work Writing the code will be very useful, thanks!
February 20, 20187 yr Author 12 minutes ago, Alek said: It's the first message in the list Yes, but it doesn't even work.
February 20, 20187 yr According to Alek you want: chatbox.getMessages().get(0); If there is an error, then post the logs.
February 20, 20187 yr Author 9 minutes ago, dreameo said: According to Alek you want: chatbox.getMessages().get(0); If there is an error, then post the logs. @Alek https://imgur.com/a/S9l0g from logger I get this java.lang.NullPointerException at org.osbot.rs07.api.Chatbox.getMessages(he:258)
February 20, 20187 yr Author 5 minutes ago, Juggles said: onMessage No error logs but doesn't print out the message
February 20, 20187 yr 22 minutes ago, nano mano said: No error logs but doesn't print out the message Would recommend using onMessage() getMessages() is bugged. How are you trying to print it? Also, my mistake - it should've been getMessages().get(0) not the other way around !
February 20, 20187 yr lol my bad, kinda rushed it but, you want this: getChatbox().getMessages(Chatbox.MessageType.ALL).get(0); change type of message if you don't want all. the only reason you're getting null is because of poor referencing Edited February 20, 20187 yr by dreameo
February 20, 20187 yr Author 17 minutes ago, Team Cape said: Would recommend using onMessage() getMessages() is bugged. How are you trying to print it? Also, my mistake - it should've been getMessages().get(0) not the other way around ! 16 minutes ago, dreameo said: lol my bad, kinda rushed it but, you want this: getChatbox().getMessages(Chatbox.MessageType.ALL).get(0); change type of message if you don't want all. the only reason you're getting null is because of poor referencing I tried onMessage(Chatbox.MessageType.ALL).get(0) and getChatbox().getMessages(Chatbox.MessageType.ALL).get(0); I get an error from eclipse.
February 20, 20187 yr Author @dreameo @Team Cape @Juggles Sorry for spam. Please help I have been 3 hours trying to figure it out with no luck
February 20, 20187 yr Implement the MessageListening interface in your main class and use that to process messages as they come in.
February 20, 20187 yr Author 8 minutes ago, Night said: Implement the MessageListening interface in your main class and use that to process messages as they come in. Thanks
Create an account or sign in to comment