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.

Widgets

Featured Replies

It works but is it the right way of using the new widget system ?

			        if (bankBooth.interact(new String[] { "Bank" }))
			            sleep(random(800, 1200));
			        {
			        	if (widgets.isVisible(12)) {
				    		inventory.interact("Deposit-All", new String[] { "Bones" });
	}
				        }

There's no need to use an array there because there's only 1 string in it. Just use a string instead of an array. You should also null check that widget.

Edited by Kristoffer OSBot

There's no need to use an array there because there's only 1 string in it. Just use a string instead of an array. You should also null check that widget.

thats because de decompiled a .class fiel fo someone ;)

 

 

 

It works but is it the right way of using the new widget system ?

			        if (bankBooth.interact(new String[] { "Bank" }))
			            sleep(random(800, 1200));
			        {
			        	if (widgets.isVisible(12)) {
				    		inventory.interact("Deposit-All", new String[] { "Bones" });
	}
				        }

 

Not sure what you are trying to do here, why a widget check?

  • Author

thats because de decompiled a .class fiel fo someone wink.png

 

 

 

Not sure what you are trying to do here, why a widget check?

To check if the bank interface is open.

bank.isOpen(), bank.depositAll() none of them works.

Edited by iJodix

thats because de decompiled a .class fiel fo someone ;)

He is checking to see if bank is open.

Not sure what you are trying to do here, why a widget check?

Also bank. IsOpen doesn't work for now use widget. Bank. Isopen. Until the devs fixed that. Diviniry will make an official post about this later

Edited by josedpay

  • Author

thats because de decompiled a .class fiel fo someone wink.png

Not really decompiling, if i struggle with something, i just get reference from codes posted to pastebin.

  • Author

Why use this then:

new String[] { "Bones" }

 

That only gets generated by JAD decompiler xD

Just use "Bones" instead? smile.png

I guess whoever posted those scripts on pastebin got em by decompiling.

And thanks, i will.

I guess whoever posted those scripts on pastebin got em by decompiling.

And thanks, i will.

 

haha could be biggrin.png

You can alos just ask me on skype if you got troubles ^^

Also bank. IsOpen doesn't work for now use widget. Bank. Isopen. Until the devs fixed that. Diviniry will make an official post about this later

 

No way I'm going to change this in all my script at maybe 100 positions -_-

They better get this fixed asap :p

Edited by Khaleesi

  • Developer

To check if the bank interface is open.

bank.isOpen(), bank.depositAll() none of them works.

I don't see why not. I've been running a NON ported script that runs fine, banking, interacting etc.

aLiQX6r.png

  • Author

I don't see why not. I've been running a NON ported script that runs fine, banking, interacting etc.

aLiQX6r.png

 

		RS2Object bankBooth = objects.closest("Bank booth");
	    if (bankBooth != null) {
	        if (bankBooth.interact("Bank")) {
		          while (bank.isOpen())
		          {
		            sleep(random(800, 1200));
		            bank.depositAll();
		            sleep(random(800, 1200));
		            bank.close();
		            sleep(random(800, 1200));
		          }
	        }
	    }

This one just hovers the close button, so am guessing that isOpen() works in this case but i also tried widgets.bank.close(); & widgets.bank.isOpen(); & widgets.bank.depositAll(); and it doesn't do anything, i guess i must be doing something wrong then.

Edited by iJodix

  • Developer
		RS2Object bankBooth = objects.closest("Bank booth");
	    if (bankBooth != null) {
	        if (bankBooth.interact("Bank")) {
		          while (bank.isOpen())
		          {
		            sleep(random(800, 1200));
		            bank.depositAll();
		            sleep(random(800, 1200));
		            bank.close();
		            sleep(random(800, 1200));
		          }
	        }
	    }
This one just hovers the close button, so am guessing that isOpen() works in this case but i also tried widgets.bank.close(); & widgets.bank.isOpen(); & widgets.bank.depositAll(); and it doesn't do anything, i guess i must be doing something wrong then.

There is no need to do widgets.bank, it is the same instance as bank. That code will of course not work, because at the moment the interact method returns the interface is not open so the code between the while block is never executed.

 

pseudo code

if booth.interact("Bank") {
    // wait for the bank to be open
    new ConditionalSleep... {
        boolean { return bank.isOpen }
    }.sleep
    // perform banking logic here
    if (logic performed correctly) {
        close bank
            conditional sleep to make sure bank is closed
                continue what you want to do
}
There is a method in the API to open banks, you know that right?

This is the actual code:


    /**
     * Searches for the best bank, based on type and distance from player. This
     * method will only interact with RS2Objects.
     *
     * @return If bank was already open, or opened successfully.
     */
    public boolean open() throws InterruptedException {
        if (isOpen())
            return true;

        final RS2Object bankObject = bot.getMethods().objects.closest(
                new NameFilter<RS2Object>("Bank booth", "Bank chest"),
                new ActionFilter<RS2Object>("Bank", "Use"));
        if (bankObject != null && map.canReach(bankObject)) {
            Event event = new InteractionEvent(bankObject, "Bank", "Use");
            execute(event);
            if (event.hasFinished()) {
                return new ConditionalSleep(5000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return isOpen();
                    }
                }.sleep();
            }
        }
        return isOpen();
    }

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.