Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

last chatbox message

Featured Replies

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!

  • Author
12 minutes ago, Alek said:

It's the first message in the list

Yes, but it doesn't even work.

According to Alek you want:

chatbox.getMessages().get(0); 

If there is an error, then post the logs. 

  • 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)

  • Author
5 minutes ago, Juggles said:

onMessage

No error logs but doesn't print out the message

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 :D

 

 

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 by dreameo

  • 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 :D

 

 

 

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.

Implement the MessageListening interface in your main class and use that to process messages as they come in.

  • 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 <3

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.