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.

Need help with TradeListener and random execution of code

Featured Replies

Hey guys, back with another question.

I was messing around with my script and trying to get listen in the chat for incoming trades. I've tried the following code and I'm obviously using it wrong:

if (trade.getRequestListener() == null) {
    			keyboard.typeString("Test");	
    		}

Also I want to type in the chat at random times. I know I need keyboard.typeString("");, but how do I make it random?

Same with random execution of code. I need to have a method that contains a few items, and randomly selects one of those items.

 

Any help will be much appreciated!

  • Author

Ok so I'm trying to accept an incoming trade now and the closest thing I can find is getTrade().acceptTrade(); but don't think that's quite it. Code atm:

public void onMessage(Message message) {
    	if (message.getMessage().contains("wishes to trade with you.")) {
            getTrade().acceptTrade();
    	}
    }

Though about getting the players name with

message.getUserName();

and then interacting with that player using "trade" but in the API I can't find a way to do this.

Edited by zorxon

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.