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.

Can't get past 2nd trade screen

Featured Replies

So I've decided to clean and restructure one of my scripts that I've stitched together by a miracle (started scripting roughly a month ago, so don't kill me straight away).
This one has the trading function included in it, but I can't seem to make it complete the second trade window (it does 'accept' the first trade screen (if condition is met) , but closes second one).
I've inserted snippets after the script has opened the trade window (no issues there).
 

			if (getTrade().isFirstInterfaceOpen()
					&& getTrade().getTheirOffers().contains("")) {
				getTrade().acceptTrade();
				Script.sleep(Script.random(1000, 1500));
			}
			if (getTrade().isSecondInterfaceOpen()) {
				getTrade().acceptTrade();
				Script.sleep(Script.random(1000, 1500));
			}

Previously I used something very redundant and fairly stupid, but it got the job done (no need to grill me on that one):

				if (getTrade().isFirstInterfaceOpen()) {
					Script.sleep(Script.random(2000, 3000));
					if (getTrade().getTheirOffers().contains("")) {
						Script.sleep(Script.random(2000, 3000));
						getTrade().acceptTrade();
						Script.sleep(Script.random(2000, 3000));
						getTrade().acceptTrade();
						Script.sleep(Script.random(2000, 3000));
					}

 

Edited by Magerange

This works for me, ignore the "script." that precedes all of my crap, it's a long story.

 

edit: looks like you just need yo use trade instead of getTrade

 

 

 

if (script.trade.isFirstInterfaceOpen() == true){
                script.log("First window open, waiting");
                new ConditionalSleep(30000) {    
                     @Override
                     public boolean condition() throws InterruptedException {
                         return script.trade.didOtherAcceptTrade() == true;
                     }
                 }.sleep();
                script.trade.acceptTrade();
                new ConditionalSleep(30000) {    
                     @Override
                     public boolean condition() throws InterruptedException {
                         return script.trade.didOtherAcceptTrade() == true;
                     }
                 }.sleep();
            script.log("Second window open, accepting");
            Script.sleep(Script.random(2000, 3000));
            script.trade.acceptTrade();

Edited by sudoinit6

2 minutes ago, sudoinit6 said:

This works for me, ignore the "script." that precedes all of my crap, it's a long story.

 

edit: looks like you just need yo use trade instead of getTrade

 

 

 

if (script.trade.isFirstInterfaceOpen() == true){
                script.log("First window open, waiting");
                new ConditionalSleep(30000) {    
                     @Override
                     public boolean condition() throws InterruptedException {
                         return script.trade.didOtherAcceptTrade() == true;
                     }
                 }.sleep();
                script.trade.acceptTrade();
                new ConditionalSleep(30000) {    
                     @Override
                     public boolean condition() throws InterruptedException {
                         return script.trade.didOtherAcceptTrade() == true;
                     }
                 }.sleep();
            script.log("Second window open, accepting");
            Script.sleep(Script.random(2000, 3000));
            script.trade.acceptTrade();

:???: that code nasty

if (trade.isCurrentlyTrading()) {
   if (trade.isFirstInterfaceOpen()) {
	trade.acceptTrade();
    log("accept trade 1");
                                new ConditionalSleep(10000) {
                                    @Override
                                    public boolean condition()
                                            throws InterruptedException {
                                        return trade.isSecondInterfaceOpen() || !trade.isCurrentlyTrading();
                                    }
                                }.sleep();
	} else if (trade.isSecondInterfaceOpen()) {
							log("accept trade 2");
							trade.acceptTrade();
							new ConditionalSleep(5000) {
								@Override
								public boolean condition()
										throws InterruptedException {
									return !trade.isCurrentlyTrading();
								}
							}.sleep();
	}
}

 

3 minutes ago, Lewis said:

:???: that code nasty

 

Meh, I am a horrible coder, but it gets the job done. I was just trying to help out.

30 minutes ago, sudoinit6 said:

Meh, I am a horrible coder, but it gets the job done. I was just trying to help out.

it gets the job done, but theres many flaws in it :)

42 minutes ago, Lewis said:

it gets the job done, but theres many flaws in it :)

Like everything else I will fix them when it doesn't work, that's how one learns.

On 6/8/2017 at 0:03 AM, sudoinit6 said:

looks like you just need yo use trade instead of getTrade

Literally the same thing

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.