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.

client.getBank().isOpen() true returning too early

Featured Replies

client.getBank().isOpen() is returning true slightly early, to the point where if something is attempted on the bank as soon as it returns true, it will most likely fail because the bank interface is not yet open even though the method is returning true. As a work around I have had to rely on the bank interface being open and not on the isOpen() method.

 

Suggestion: Have isOpen() return true when the interface is actually visible.

You mean once the bot clicks the bank it returns true? If so just put it to sleep for like 750 then continue. Same goes for most interacting interfaces

  • Author

You mean once the bot clicks the bank it returns true? If so just put it to sleep for like 750 then continue. Same goes for most interacting interfaces

 

 

Not once it clicks. Like right before the interface is actually visible. Static sleeping for 750ms is not efficient.

You mean once the bot clicks the bank it returns true? If so just put it to sleep for like 750 then continue. Same goes for most interacting interfaces

Could just sleep until it's visible.
  • Author

Could just sleep until it's visible.

 

That is what I am doing, this is just a suggestion to get isOpen() to do the same.

sleep(random(1250,1500);

 

Try that. It does work or just condition is to sleep until it's visible like Erza just said

  • Author

sleep(random(1250,1500);

 

Try that. It does work or just condition is to sleep until it's visible like Erza just said

 

 

Why the static sleeping?

  • Author
while(!bank.isOpen) {
   sleep(50);
}

 

 

You seem to be misunderstanding the suggestion.

I'd rather support the fact that they make banking in general faster..

inb4 dev response is "OSBot 2 has faster banking"

  • 3 weeks later...

@OP:

 

Yes, I agree that isOpen should only return true when the interfaces have loaded, causes a few problems in my script as well.

 

@Others:

 

You guys are missing the point. What you're proposing is that he change the timing of the check. Right now client.getBank().isOpen() is returning true too early (AKA when it's not true). So therefore the problem needs to be fixed because it's causing timing issues. Sleeping after every-time you check isn't going to fix his problem, just make it occur less often.

  • Administrator

Current:

    public boolean isOpen() {
        RS2Interface i = client.getInterface(BANK_INTERFACE);
        if (i != null && i.isValid()) {
            return true;
        }
        return false;
    }
to

Proposed version: (note the isVisible)

    public boolean isOpen() {
        RS2Interface i = client.getInterface(BANK_INTERFACE);
        if (i != null && i.isValid() && i.isVisible()) {
            return true;
        }
        return false;
    }
Acceptable?

Current:

    public boolean isOpen() {
        RS2Interface i = client.getInterface(BANK_INTERFACE);
        if (i != null && i.isValid()) {
            return true;
        }
        return false;
    }
to

Proposed version: (note the isVisible)

    public boolean isOpen() {
        RS2Interface i = client.getInterface(BANK_INTERFACE);
        if (i != null && i.isValid() && i.isVisible()) {
            return true;
        }
        return false;
    }
Acceptable?

 

I'm not sure why you're using if statements though, lol.

Current:

    public boolean isOpen() {
        RS2Interface i = client.getInterface(BANK_INTERFACE);
        if (i != null && i.isValid()) {
            return true;
        }
        return false;
    }
to

Proposed version: (note the isVisible)

    public boolean isOpen() {
        RS2Interface i = client.getInterface(BANK_INTERFACE);
        if (i != null && i.isValid() && i.isVisible()) {
            return true;
        }
        return false;
    }
Acceptable?

 

public boolean isOpen() {
    RS2Interface i = client.getInterface(BANK_INTERFACE);
    return i != null && i.isValid() && i.isVisible();
}

@Swizzbeat4developer :troll:

 

I'm not to sure what the BANK_INTERFACE represents, but in my opinion it should also look for the child interface which contains the bank items to be visible as well. I think this is whats causing issues where the contains() method return false even though the items are there (parent interface being loaded but not all of the children are or visible yet).

Guest
This topic is now closed to further replies.

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.