Skip 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.

Oh dear,

Featured Replies

Hey again y'all,

 

Update: would this work properly?

public void onMessage(String message) throws InterruptedException {
     if (message.contains("Oh dear,")) {
          dead = true;
     }
}

I'm still new to understanding the API easily, so sorry for the beginner question.. sad.png

 

Thanks in advance!

Edited by Rawrstin

You use a message listener, look for a game message with that text and then write the code in the onMessage() method. :) 
http://osbot.org/api/org/osbot/rs07/listener/MessageListener.html
http://osbot.org/api/org/osbot/rs07/api/ui/Message.MessageType.html
http://osbot.org/api/org/osbot/rs07/api/ui/Message.html
Those should help out enough.

I've always been a fan of people figuring things out for themselves, but if you require more help be sure to reply :)

Hey again y'all,

 

Quick question in regards to detecting the chatbox spitting back the game message displayed on death..

 

Ex:

*I DIED*

game says "Oh dear, you are dead!"

*I CRY*

 

I'm still new to understanding the API easily, so sorry for the beginner question.. sad.png

 

Thanks in advance!

Oh.. nvm , you'll be wanting to use onMesage.. There is some snippets lying around the forums

Edited by Qubit

  • Author

Updated OP

 

 

 

Like this?

// Suicide Mode
if (getChatbox().getMessages(null).contains("Oh dear,")) {

}

Edited by Rawrstin

implement messagelistener

 

then check for your inventory items if it contains your last saved equipment

 

using getInventory() && using getEquipment() methods

  • Author

Hey again y'all,

 

Update: would this work properly?

public void onMessage(String message) throws InterruptedException {
     if (message.contains("Oh dear,")) {
          dead = true;
     }
}

I'm still new to understanding the API easily, so sorry for the beginner question.. sad.png

 

Thanks in advance!

 

I have updated the OP Post code.. I think that should work.. testing now! (Could still use help, lol)

I have updated the OP Post code.. I think that should work.. testing now! (Could still use help, lol)

 

The onMessage method takes a Message argument, not String

 

Example:

public void onMessage(Message msg) throws InterruptedException {
     if (msg.getType() == MessageType.GAME && msg.getMessage().contains("Oh dear,")) {
          dead = true;
     }
}

 

Edited by FrostBug

  • Author

 

The onMessage method takes a Message argument, not String

 

Example:

public void onMessage(Message msg) throws InterruptedException {
     if (msg.getType() == MessageType.GAME && msg.getMessage().contains("Oh dear,")) {
          dead = true;
     }
}

 

o.o

Thank you!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.