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.

Featured Replies

1 hour ago, sn0wman said:

https://gist.github.com/git-sm/a07058582302b7c8af76a83cd26cdc81 so heres a rewrite with @progamerz edit. Has one issue any suggestions or help more than welcome.

 

To come:

gui with a combobox to select which bank with a nearest option as default.

Again why u used that in the onstart() method? onstart is only for the script to run specific code when started what i sent should be in the onloop.

Edit: not being rude, but do you know basic java? and did you try looking at the tutorial section? would help you out

https://osbot.org/forum/forum/250-tutorials/

 

Edited by progamerz

Spoiler
3 hours ago, sn0wman said:

https://gist.github.com/git-sm/a07058582302b7c8af76a83cd26cdc81 so heres a rewrite with @progamerz edit. Has one issue any suggestions or help more than welcome.

 

To come:

gui with a combobox to select which bank with a nearest option as default.

Issues sorted, rewite is finished should work not tested.

new link : https://gist.github.com/git-sm/fb8f52b2089ec3fb41ea258b67a702cc

TODO: GUI with selection of banks and nearest options.

 

Edited by sn0wman
link edit

  • 6 months later...

Is it me or is this way over complicated? This is what I use...

private Area closestBank;
    
public void onStart() {     
    closestBank = getClosestBank(); 
}
private Area getClosestBank(){

    Area SHILOBANK = new Area(new Position(2854,2957,0),new Position(2850,2951,0));
    Area PORTSARIMBANK = new Area(new Position(3047,3233,0),new Position(3043,3237,0));

    org.osbot.rs07.api.map.Area[] bankAreas = {
            Banks.AL_KHARID, Banks.ARCEUUS_HOUSE, Banks.ARDOUGNE_NORTH, Banks.ARDOUGNE_SOUTH, Banks.CAMELOT, Banks.CANIFIS,
            Banks.CASTLE_WARS, Banks.CATHERBY, Banks.DRAYNOR, Banks.DUEL_ARENA, Banks.EDGEVILLE, Banks.FALADOR_EAST, Banks.FALADOR_WEST,
            Banks.GNOME_STRONGHOLD, Banks.GRAND_EXCHANGE, Banks.HOSIDIUS_HOUSE, Banks.LOVAKENGJ_HOUSE, Banks.LOVAKITE_MINE,
            Banks.LUMBRIDGE_LOWER, Banks.LUMBRIDGE_UPPER, Banks.PEST_CONTROL, Banks.PISCARILIUS_HOUSE, Banks.SHAYZIEN_HOUSE,
            Banks.TZHAAR, Banks.VARROCK_EAST, Banks.VARROCK_WEST, Banks.YANILLE,SHILOBANK,PORTSARIMBANK
    };

    Area closestBank = null;

    for (int i = 0; i < bankAreas.length; i++) {
        if (closestBank == null) {
            closestBank = bankAreas[i];
        } else if (myPosition().distance(bankAreas[i].getRandomPosition()) < myPosition().distance(closestBank.getRandomPosition())) {
            closestBank = bankAreas[i];
        }
    }
    return closestBank;
}
18 minutes ago, Cloxygen said:

Is it me or is this way over complicated? This is what I use...


private Area closestBank;
    
public void onStart() {     
    closestBank = getClosestBank(); 
}

private Area getClosestBank(){

    Area SHILOBANK = new Area(new Position(2854,2957,0),new Position(2850,2951,0));
    Area PORTSARIMBANK = new Area(new Position(3047,3233,0),new Position(3043,3237,0));

    org.osbot.rs07.api.map.Area[] bankAreas = {
            Banks.AL_KHARID, Banks.ARCEUUS_HOUSE, Banks.ARDOUGNE_NORTH, Banks.ARDOUGNE_SOUTH, Banks.CAMELOT, Banks.CANIFIS,
            Banks.CASTLE_WARS, Banks.CATHERBY, Banks.DRAYNOR, Banks.DUEL_ARENA, Banks.EDGEVILLE, Banks.FALADOR_EAST, Banks.FALADOR_WEST,
            Banks.GNOME_STRONGHOLD, Banks.GRAND_EXCHANGE, Banks.HOSIDIUS_HOUSE, Banks.LOVAKENGJ_HOUSE, Banks.LOVAKITE_MINE,
            Banks.LUMBRIDGE_LOWER, Banks.LUMBRIDGE_UPPER, Banks.PEST_CONTROL, Banks.PISCARILIUS_HOUSE, Banks.SHAYZIEN_HOUSE,
            Banks.TZHAAR, Banks.VARROCK_EAST, Banks.VARROCK_WEST, Banks.YANILLE,SHILOBANK,PORTSARIMBANK
    };

    Area closestBank = null;

    for (int i = 0; i < bankAreas.length; i++) {
        if (closestBank == null) {
            closestBank = bankAreas[i];
        } else if (myPosition().distance(bankAreas[i].getRandomPosition()) < myPosition().distance(closestBank.getRandomPosition())) {
            closestBank = bankAreas[i];
        }
    }
    return closestBank;
}

 

Nice :)

22 minutes ago, Cloxygen said:

Is it me or is this way over complicated? This is what I use...

Although yours is simpler, both solutions are incorrect as you are calculating straight line distance instead of actual path distance. So it may return a bank that is not actually closest (you may have to walk around a bunch of stuff to get there).

Why do you need to know which bank is closest anyway?

If you use web walking with an Area[] it will walk to the closest Area in the array, so:

getWalking().webWalk(bankAreas)

will walk to the closest bank.

51 minutes ago, Explv said:

Although yours is simpler, both solutions are incorrect as you are calculating straight line distance instead of actual path distance. So it may return a bank that is not actually closest (you may have to walk around a bunch of stuff to get there).

Why do you need to know which bank is closest anyway?

If you use web walking with an Area[] it will walk to the closest Area in the array, so:

getWalking().webWalk(bankAreas)

will walk to the closest bank.

Didn't know it would do that, thanks. would this work if you're under ground as well? Also how would you check if your player is in the bank? you would have to loop through the whole array constantly right?

Edited by Cloxygen

22 minutes ago, Cloxygen said:

Didn't know it would do that, thanks. would this work if you're under ground as well? Also how would you check if your player is in the bank? you would have to loop through the whole array constantly right?

If webwalking works there, yes. In regards to your second question, I can't remember if osbot has an isInBank method but if it doesn't, why would you need to check the area. Just check a bank object like a booth or a banker exists.

32 minutes ago, HeyImJamie said:

If webwalking works there, yes. In regards to your second question, I can't remember if osbot has an isInBank method but if it doesn't, why would you need to check the area. Just check a bank object like a booth or a banker exists.

that works i guess

  • 2 years later...

this might be crazy but after 3 years this post helped my with my problem opening the bank i got it to work now you guy`s are awsome!!!!

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.