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 TypeMethodDescriptionvoidAssigns the ID constants for all the banking objects in RuneScapebooleanclose()Closes the bank interface.booleandeposit(int itemID, int number) If bank is open, deposits specified amount of an item into the bank.booleanDeposits all items in methods.inventory.booleanDeposit everything your player has equipped.booleandepositAllExcept(int... items) Deposits all items in inventory except for the given IDs.intintGets the count of all items in your inventory ignoring stack sizes while deposit box is open.intgetBoxCount(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.intgetCount(int... items) Returns the sum of the count of the given items in the bank.intGet current tab open in the bank.getEquipmentItem(int id) Gets a equipment item from the bank interface.intgetEquipmentItemID(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 theRSWidgetof the given item at the specified index.intGets 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 tabbooleanChecks whether the deposit box is open.booleanisOpen()Checks whether the bank is open.booleanbooleanopen()Opens one of the supported banker NPCs, booths, or chests nearby.booleanOpens one of the supported deposit boxes nearby.booleanopenTab(int tabNumber) Opens the bank tab.booleansearchItem(String itemName) Searches for an item in the bank.booleanSets the bank rearrange mode to insert.booleanSets the bank rearrange mode to swap.booleanSets the bank withdraw mode to item.booleanSets the bank withdraw mode to note.booleanwithdraw(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:
trueif 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:
trueif successful; otherwisefalse.
-
depositAll
public boolean depositAll()Deposits all items in methods.inventory. Supports deposit boxes.- Returns:
trueon 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:
trueon 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 theRSWidgetof the given item at the specified index.- Parameters:
index- The index of the item.- Returns:
RSWidgetif 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
RSItemarray of the bank's inventory interface.
-
isOpen
public boolean isOpen()Checks whether the bank is open.- Returns:
trueif the bank interface is open; otherwisefalse.
-
isDepositOpen
public boolean isDepositOpen()Checks whether the deposit box is open.- Returns:
trueif 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:
trueif 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:
trueif 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:
trueon success.
-
isSearchOpen
public boolean isSearchOpen()- Returns:
trueif 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:
trueon success.
-
setRearrangeModeToInsert
public boolean setRearrangeModeToInsert()Sets the bank rearrange mode to insert.- Returns:
trueon success.
-
setRearrangeModeToSwap
public boolean setRearrangeModeToSwap()Sets the bank rearrange mode to swap.- Returns:
trueon success.
-
setWithdrawModeToItem
public boolean setWithdrawModeToItem()Sets the bank withdraw mode to item.- Returns:
trueon success.
-
setWithdrawModeToNote
public boolean setWithdrawModeToNote()Sets the bank withdraw mode to note.- Returns:
trueon 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:
trueon 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.
-