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.

How to send an ingame message?

Featured Replies

I can't figure out how to send a message ingame, I can figure out how to send key events to the bot but I don't think splitting strings to char arrays and for looping through them to send messages is very efficient lol.

Is there a better way? I can't find one in the API and have thoroughly googled.

  • Author

Shit lol I keep asking dumb questions :( Sorry, and thanks.

  • Author

 

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? :( 

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.

  • Author

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

 

Eclipse throws an error when I don't cast ArrayList<String> for some reason. I think I'll clean and rebuild my project and see if that resolves.

 

Edit: Clean > Rebuild resolved the issue.

Edited by Spork

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.