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.

2nd trade window

Featured Replies

Hi!

I can't get a joke-bot to accept past the 2nd trade window. Tried several different widgets, but it just won't work. Anybody know why?

				if (getTrade().isSecondInterfaceOpen()) {
					log("Second trade...");
					if (getTrade().didOtherAcceptTrade() && !getTrade().getTheirOffers().isEmpty()) {
						RS2Widget acceptTrade = getWidgets().get(334, 25);
						if (acceptTrade.interact()) {
								tellJoke = true;
								return random(200, 300);
							}
						}
				}

Also tried replacing:

RS2Widget acceptTrade = getWidgets().get(334, 25);

with:

RS2Widget acceptTrade = getWidgets().getWidgetContainingText("Accept");

 

First time I try messing with Java, so probably something stupid I've missed 😉

Thanks!

I think there is no need to use widgets when accepting trades as API has implemented method. I just use 

trade.acceptTrade();
  • Author

Yeah, solved it with a similar solution!

Thanks!

Do you happen to know how to insert an item in a trade?

----------------------------------------------------------------
public int onLoop() throws InterruptedException {     
        if (trade.isCurrentlyTrading()) {

                if (trade.isFirstInterfaceOpen()) {
                   
                   trade.offer(2140,1);

}

(and a bit more code)

----------------------------------------------------------------
 

^ does not work.

It does however work if I place  "trade.offer(2140,1);" right after the onLoop;

----------------------------------------------------------------

public int onLoop() throws InterruptedException {     

trade.offer(2140,1);
        if (trade.isCurrentlyTrading()) {

                     if (trade.isFirstInterfaceOpen()) {     

}

----------------------------------------------------------------
 

^ does work.

Hmm it seems to be working for me if I check getTrade().isFirstInterfaceOpen() before offering an item. can you print in the logger: log("Is first interface open? " + getTrade().isFirstInterfaceOpen() + "."); to confirm it's detecting that you're in the first interface?

  • Author
9 hours ago, Czar said:

Hmm it seems to be working for me if I check getTrade().isFirstInterfaceOpen() before offering an item. can you print in the logger: log("Is first interface open? " + getTrade().isFirstInterfaceOpen() + "."); to confirm it's detecting that you're in the first interface?

It works, just not always. And when it doesn't work, I have to restart client to get it working again.

Read similar issues, but no solutions. It hovers over decline button when it doesn't work. 

7 hours ago, botelias said:

It works, just not always. And when it doesn't work, I have to restart client to get it working again.

Read similar issues, but no solutions. It hovers over decline button when it doesn't work. 

Alright is there any way you can replicate this bug or is it completely random? In any case I will have a chat with the scripters/devs and see if there's anything wrong ^^ :D 

  • 1 month later...
  • Author
On 7/18/2019 at 11:06 PM, Czar said:

Alright is there any way you can replicate this bug or is it completely random? In any case I will have a chat with the scripters/devs and see if there's anything wrong ^^ :D 

Done more research now after coming back from vacation. The issue appears to be 100% random, and unrelated to account. Sometimes it works, sometimes it doesn't. If it however does work, it will keep working as long as client is running. Same if it doesn't work.

  • Author

Tried simplifying the trade process as much as possible, removing everything that has to do with declining trade (empty window, slow trade, etc etc). Still hovers over "Decline".

Try and use widget id 334, 13 its the one that contains the action accept on the second trade screen.  The other one that you are using contains only the text.

Also I wrote up a basic trading handler here https://osbot.org/forum/topic/155996-trading-api-unpredictable/

Quick addition, to offer an item try and use this method.

public boolean offerItem(String action, String itemName){
        return getInventory().interact(action, itemName);
    }

 

Edited by BravoTaco

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.