Package rsb.methods
Class Bank
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.Bank
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int[]
static int[]
static int[]
static int[]
static Point[]
Fields inherited from class rsb.methods.MethodProvider
methods
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Assigns the ID constants for all the banking objects in RuneScapeboolean
close()
Closes the bank interface.boolean
deposit
(int itemID, int number) If bank is open, deposits specified amount of an item into the bank.boolean
Deposits all items in methods.inventory.boolean
Deposit everything your player has equipped.boolean
depositAllExcept
(int... items) Deposits all items in inventory except for the given IDs.int
int
Gets the count of all items in your inventory ignoring stack sizes while deposit box is open.int
getBoxCount
(int... ids) Gets the count of all the items in the inventory with the any of the specified IDs while deposit box is open.Gets the deposit box interface.int
getCount
(int... items) Returns the sum of the count of the given items in the bank.int
Get current tab open in the bank.getEquipmentItem
(int id) Gets a equipment item from the bank interface.int
getEquipmentItemID
(String name) Gets the ID of a equipment item based on name.RSItem[]
Gets the equipment items from the bank interface.Gets the bank interface.getItem
(int id) Gets the first item with the provided ID in the bank.getItemAt
(int index) Gets theRSWidget
of the given item at the specified index.int
Gets the item ID of a item side the bank.getItemPoint
(int slot) Gets the point on the screen for a given item.RSItem[]
getItems()
Gets all the items in the bank's inventory.getTab
(int index) Gets a tabboolean
Checks whether the deposit box is open.boolean
isOpen()
Checks whether the bank is open.boolean
boolean
open()
Opens one of the supported banker NPCs, booths, or chests nearby.boolean
Opens one of the supported deposit boxes nearby.boolean
openTab
(int tabNumber) Opens the bank tab.boolean
searchItem
(String itemName) Searches for an item in the bank.boolean
Sets the bank rearrange mode to insert.boolean
Sets the bank rearrange mode to swap.boolean
Sets the bank withdraw mode to item.boolean
Sets the bank withdraw mode to note.boolean
withdraw
(int itemID, int count) Tries to withdraw an item.
-
Field Details
-
BANKERS
public static int[] BANKERS -
BANK_DEPOSIT_BOX
public static int[] BANK_DEPOSIT_BOX -
BANK_CHESTS
public static int[] BANK_CHESTS -
BANK_BOOTHS
public static int[] BANK_BOOTHS -
UNREACHABLE_BANKERS
-
-
Method Details
-
assignConstants
public void assignConstants()Assigns the ID constants for all the banking objects in RuneScape -
close
public boolean close()Closes the bank interface. Supports deposit boxes.- Returns:
true
if the bank interface is no longer open.
-
getAvailableBankSpace
public int getAvailableBankSpace() -
deposit
public boolean deposit(int itemID, int number) If bank is open, deposits specified amount of an item into the bank. Supports deposit boxes.- Parameters:
itemID
- The ID of the item.number
- The amount to deposit. 0 deposits All. 1,5,10 deposit corresponding amount while other numbers deposit X.- Returns:
true
if successful; otherwisefalse
.
-
depositAll
public boolean depositAll()Deposits all items in methods.inventory. Supports deposit boxes.- Returns:
true
on success.
-
depositAllExcept
public boolean depositAllExcept(int... items) Deposits all items in inventory except for the given IDs. Supports deposit boxes.- Parameters:
items
- The items not to deposit.- Returns:
- true on success.
-
depositAllEquipped
public boolean depositAllEquipped()Deposit everything your player has equipped. Supports deposit boxes.- Returns:
true
on success.- Since:
- 6 March 2009.
-
getCount
public int getCount(int... items) Returns the sum of the count of the given items in the bank.- Parameters:
items
- The array of items.- Returns:
- The sum of the stacks of the items.
-
getCurrentTab
public int getCurrentTab()Get current tab open in the bank.- Returns:
- int of tab (0-8), or -1 if none are selected (bank is not open).
-
getTab
Gets a tab- Parameters:
index
- Gets the bank tab at the specified index- Returns:
- The bank tab
-
getBoxInterface
Gets the deposit box interface.- Returns:
- The deposit box
RSWidget
.
-
getItemAt
Gets theRSWidget
of the given item at the specified index.- Parameters:
index
- The index of the item.- Returns:
RSWidget
if item is found at index; otherwise null.
-
getInterface
Gets the bank interface.- Returns:
- The bank
RSWidget
.
-
getItem
Gets the first item with the provided ID in the bank.- Parameters:
id
- ID of the item to get.- Returns:
- The component of the item; otherwise null.
-
getItemPoint
Gets the point on the screen for a given item. Numbered left to right then top to bottom.- Parameters:
slot
- The index of the item.- Returns:
- The point of the item or new Point(-1, -1) if null.
-
getItems
Gets all the items in the bank's inventory.- Returns:
- an
RSItem
array of the bank's inventory interface.
-
isOpen
public boolean isOpen()Checks whether the bank is open.- Returns:
true
if the bank interface is open; otherwisefalse
.
-
isDepositOpen
public boolean isDepositOpen()Checks whether the deposit box is open.- Returns:
true
if the deposit box interface is open; otherwisefalse
.
-
getNearest
-
open
public boolean open()Opens one of the supported banker NPCs, booths, or chests nearby. If they are not nearby, and they are not null, it will automatically walk to the closest one.- Returns:
true
if the bank was opened; otherwisefalse
.
-
openDepositBox
public boolean openDepositBox()Opens one of the supported deposit boxes nearby. If they are not nearby, and they are not null, it will automatically walk to the closest one.- Returns:
true
if the deposit box was opened; otherwisefalse
.
-
openTab
public boolean openTab(int tabNumber) Opens the bank tab.- Parameters:
tabNumber
- The tab number - e.g. view all is 1.- Returns:
true
on success.
-
isSearchOpen
public boolean isSearchOpen()- Returns:
true
if currently searching the bank.
-
searchItem
Searches for an item in the bank. Returns true if succeeded (does not necessarily mean it was found).- Parameters:
itemName
- The item name to find.- Returns:
true
on success.
-
setRearrangeModeToInsert
public boolean setRearrangeModeToInsert()Sets the bank rearrange mode to insert.- Returns:
true
on success.
-
setRearrangeModeToSwap
public boolean setRearrangeModeToSwap()Sets the bank rearrange mode to swap.- Returns:
true
on success.
-
setWithdrawModeToItem
public boolean setWithdrawModeToItem()Sets the bank withdraw mode to item.- Returns:
true
on success.
-
setWithdrawModeToNote
public boolean setWithdrawModeToNote()Sets the bank withdraw mode to note.- Returns:
true
on success.
-
withdraw
public boolean withdraw(int itemID, int count) Tries to withdraw an item. 0 is All. 1,5,10 use Withdraw 1,5,10 while other numbers Withdraw X.- Parameters:
itemID
- The ID of the item.count
- The number to withdraw.- Returns:
true
on success.
-
getBoxCount
public int getBoxCount(int... ids) Gets the count of all the items in the inventory with the any of the specified IDs while deposit box is open.- Parameters:
ids
- the item IDs to include- Returns:
- The count.
-
getBoxCount
public int getBoxCount()Gets the count of all items in your inventory ignoring stack sizes while deposit box is open.- Returns:
- The count.
-
getEquipmentItems
Gets the equipment items from the bank interface.- Returns:
- All equipment items that are being worn.
-
getEquipmentItem
Gets a equipment item from the bank interface.- Parameters:
id
- ID of the item.- Returns:
- RSItem
-
getEquipmentItemID
Gets the ID of a equipment item based on name.- Parameters:
name
- Name of the item.- Returns:
- -1 if item is not found.
-
getItemID
Gets the item ID of a item side the bank.- Parameters:
name
- Name of the item.- Returns:
- -1 if item is not found.
-