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.

Accepting trade issues

Featured Replies

Hey ^^ I've seen another thread about an issue with trading, but no solution has been posted so I'm posting another one :3

 

I'm writing some merching scripts and when trading, "trade.acceptTrade()" sometimes fails to accept the trade and instead

only shakes the mouse over Decline trade button doing nothing? It's been bugging me out for hours -.-

 

Anyone knows how to solve this?

Thx

do u have a:

getTrade().isCurrentlyTrading()

in your code

 

edit: post ur code

Edited by Acerd

  • Author

do u have a:

getTrade().isCurrentlyTrading()

in your code

 

edit: post ur code

 

 

Trader 1:

        if(trade.isCurrentlyTrading())
        {
            if(trade.isFirstInterfaceOpen())
            {
                trade.acceptTrade();
                while(trade.isCurrentlyTrading() && !trade.isSecondInterfaceOpen()) sleep(50);
            }

            if(trade.isSecondInterfaceOpen())
            {
                trade.acceptTrade();
                while(trade.isCurrentlyTrading()) sleep(50);
            }

            return;
        }

Trader 2:

        if(trade.isCurrentlyTrading())
        {
            if(trade.isFirstInterfaceOpen())
            {
                while(!trade.didOtherAcceptTrade()) sleep(50);
                trade.acceptTrade();
            }

            if(trade.isSecondInterfaceOpen())
            {
                while(!trade.didOtherAcceptTrade()) sleep(50);
                trade.acceptTrade();
            }
        }

This isn't exactly how my code looks like, but this is an example of my logic. smile.png (There are sleeps in betwen)

Edited by Xious

use conditionalsleeps instead of while loops

 

try tis:

           if (getTrade().isCurrentlyTrading()) {
                  if (getTrade().isFirstInterfaceOpen()) {
                      if (getTrade().acceptTrade()) {
                        new ConditionalSleep(5000) {
                          @Override
                          public boolean condition() throws InterruptedException {
                           return getTrade().isSecondInterfaceOpen();
                           }
                          }.sleep();
                         }
                        } else {
                       if (getTrade().acceptTrade()) {
                         new ConditionalSleep(5000) {
                          @Override
                          public boolean condition() throws InterruptedException {
                           return !getTrade().isCurrentlyTrading();
                           }
                          }.sleep();
                         }
                       }
                             

idk 100% if code will work cause i wrote it on browser

 

  • Author

use conditionalsleeps instead of while loops

 

try tis:

           if (getTrade().isCurrentlyTrading()) {
                  if (getTrade().isFirstInterfaceOpen()) {
                      if (getTrade().acceptTrade()) {
                        new ConditionalSleep(5000) {
                          @Override
                          public boolean condition() throws InterruptedException {
                           return getTrade().isSecondInterfaceOpen();
                           }
                          }.sleep();
                         }
                        } else {
                       if (getTrade().acceptTrade()) {
                         new ConditionalSleep(5000) {
                          @Override
                          public boolean condition() throws InterruptedException {
                           return !getTrade().isCurrentlyTrading();
                           }
                          }.sleep();
                         }
                       }
                             

idk 100% if code will work cause i wrote it on browser

 

Thx, gonna try this ^^

  • Author

I tested and it doesn't seem to be the logic of how I implemented it, acceptTrade(); just fails at some point >:<

 

Edit: It was my bad, figured it out ^^

Edited by Xious

I tested and it doesn't seem to be the logic of how I implemented it, acceptTrade(); just fails at some point >:<

report it to alek

  • Author

report it to alek

 

Thanks for your help anyways, gave me ideas ^_^

  • 3 months later...

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.