Jump to content

No reqs banks


Recommended Posts

Posted (edited)

You can access some predefined banks through the API by calling Banks

EX.

Area varrockWestBank = Banks.VARROCK_WEST;

Area[] banks = {Banks.VARROCK_EAST, Banks.VARROCK_WEST, Banks.AL_KHARID, Banks.DRAYNOR};

It has most of the banks in that class.

If you need to add banks you could create a class that extends from Banks than just add custom bank locations like so.

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.constants.Banks;

public final class BanksExtended extends Banks {
    public static final Area CUSTOM_BANK = new Area(0, 0, 0, 0);
}
Edited by BravoTaco
Posted
8 hours ago, BravoTaco said:

You can access some predefined banks through the API by calling Banks

EX.


Area varrockWestBank = Banks.VARROCK_WEST;

Area[] banks = {Banks.VARROCK_EAST, Banks.VARROCK_WEST, Banks.AL_KHARID, Banks.DRAYNOR};

It has most of the banks in that class.

If you need to add banks you could create a class that extends from Banks than just add custom bank locations like so.


import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.constants.Banks;

public final class BanksExtended extends Banks {
    public static final Area CUSTOM_BANK = new Area(0, 0, 0, 0);
}

The bank class just contains some pre defined bank areas, no?

So if your wanted bank is not in the class you have to define an Area constant yourself.

Final area *bankname* = new Area(x1, y1, x2, y2) ;

Add -*bankname* to an enum list.

 

Correct me if im wrong please. Im currently learning to code.

Posted
6 hours ago, Promo said:

The bank class just contains some pre defined bank areas, no?

So if your wanted bank is not in the class you have to define an Area constant yourself.

Final area *bankname* = new Area(x1, y1, x2, y2) ;

Add -*bankname* to an enum list.

 

Correct me if im wrong please. Im currently learning to code.

Yeah for any banks not in that class you will have to create a new object that contains the area information. You can put this into an enum or you can create a class that extends from the Banks class so you don’t have to call two separate things to get all the banks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...