public class Bank extends ItemContainer
Modifier and Type | Class and Description |
---|---|
static class |
Bank.BankMode |
Modifier and Type | Field and Description |
---|---|
static int |
STORE_1 |
static int |
STORE_10 |
static int |
STORE_5 |
static int |
STORE_ALL |
static int |
WITHDRAW_1 |
static int |
WITHDRAW_10 |
static int |
WITHDRAW_5 |
static int |
WITHDRAW_ALL |
static int |
WITHDRAW_ALL_BUT_ONE |
bank, bot, camera, chatbox, client, colorPicker, combat, configs, depositBox, dialogues, diaries, display, doorHandler, equipment, experienceTracker, favour, grandExchange, graphicObjects, groundItems, hintArrow, inventory, keyboard, logger, logoutTab, magic, map, menu, mouse, npcs, objects, players, prayer, projectiles, quests, settings, skills, store, tabs, trade, walking, widgets, worlds
Constructor and Description |
---|
Bank() |
Modifier and Type | Method and Description |
---|---|
boolean |
close()
Closes the Bank interface.
|
Entity |
closest() |
boolean |
deposit(Filter<Item> filter,
int amount_)
Deposits the specified item with the specified amount in the bank.
|
boolean |
deposit(int id,
int amount)
Deposits the specified item with the specified amount in the bank.
|
boolean |
deposit(java.lang.String name,
int amount)
Deposits the specified item with the specified amount in the bank.
|
boolean |
depositAll()
Deposits all items in the inventory in the bank.
|
boolean |
depositAll(boolean checkResults)
Deposits all items in the inventory in the bank.
|
boolean |
depositAll(boolean checkResults,
Filter<Item>... filters) |
boolean |
depositAll(boolean checkResults,
java.util.List<Item> items) |
boolean |
depositAll(Filter<Item>... filters)
Deposits all the items in the filter in the bank.
|
boolean |
depositAll(int... ids)
Deposits all the items in the filter in the bank.
|
boolean |
depositAll(java.util.List<Item> items)
Deposits all the items in the filter in the bank.
|
boolean |
depositAll(java.lang.String... names)
Deposits all the items in the filter in the bank.
|
boolean |
depositAllExcept(boolean checkResults,
Filter<Item>... filters) |
boolean |
depositAllExcept(Filter<Item>... filters)
Deposits all the items in the inventory excluding the items in the
filters passed.
|
boolean |
depositAllExcept(int... ids)
Deposits all the items in the inventory excluding items with the ids
passed.
|
boolean |
depositAllExcept(java.util.List<Item> items)
Deposits all the items in the inventory excluding the list of items
passed.
|
boolean |
depositAllExcept(java.lang.String... names)
Deposits all the items in the inventory excluding items with the names
passed.
|
boolean |
depositWornItems()
Deposits any worn items.
|
boolean |
enableMode(Bank.BankMode bankMode)
Enables the specified BankMode.
|
java.util.List<Item> |
filter(Filter<Item>... filters)
Filters the item array with the specified filters.
|
java.awt.Rectangle |
getAbsoluteSlotPosition(int tabSlot,
int absoluteSlot)
Gets the absolute screen position rectangle for specified slot.
|
int |
getCapacity() |
int |
getCurrentTab()
Gets the current tab open.
|
Bank.BankMode |
getInsertMode() |
int |
getInterfaceChildId()
Gets the interface child id that this item container represents.
|
int |
getInterfaceId()
Gets the interface id that this item container represents.
|
RS2Widget |
getItemContainerWidget() |
int |
getItemCountForTab(int tab) |
Item[] |
getItems()
Gets the array of items stored in this container in order.
|
Item[] |
getItemsInTab(int tab)
Gets the item array of the specified tab.
|
RS2Widget |
getSlotWidget(int widgetId) |
int |
getTabForAbsoluteSlot(int slot) |
int |
getTabForItem(int id)
Gets the tab of a particular item.
|
int |
getTabsAvailable()
Sums up how many tabs you have available.
|
Bank.BankMode |
getWithdrawMode() |
void |
initializeModule() |
boolean |
isBankModeEnabled(Bank.BankMode bankMode) |
boolean |
isOpen()
Checks if your bank interface is open.
|
boolean |
isSlotVisible(Bot bot,
int tabSlot,
int absoluteSlot)
Deprecated.
Use isSlotVisible(int tabSlot, int absoluteSlot) instead
|
boolean |
isSlotVisible(int tabSlot,
int absoluteSlot)
Returns whether the specified slot is visible or not.
|
boolean |
open()
Searches for the best bank, based on type and distance from player.
|
boolean |
openTab(int tab)
Opens the selected bank tab.
|
boolean |
scrollToSlot(int tabSlot,
int absoluteSlot)
Scrolls to the specified slot, using the mouse scroll wheel.
|
boolean |
withdraw(Filter<Item> filter,
int amount_)
Withdraws the first item returned by the filter with the specified
amount.
|
boolean |
withdraw(Filter<Item> filter,
int amount_,
boolean checkResults)
Withdraws the first item returned by the filter with the specified
amount.
|
boolean |
withdraw(java.util.HashMap<java.lang.String,java.lang.Integer> items)
Withdraws all items in the HashMap.
|
boolean |
withdraw(int id,
int amount)
Withdraw an item with the specified amount which its name matches the
specified id.
|
boolean |
withdraw(java.lang.String name,
int amount)
Withdraws an item with the specified amount which its name matches the
specified name.
|
boolean |
withdrawAll(Filter<Item> filter)
Withdraws all of the specified item.
|
boolean |
withdrawAll(int id)
Withdraws all of the specified item.
|
boolean |
withdrawAll(java.lang.String name)
Withdraws all of the specified item.
|
boolean |
withdrawAllButOne(Filter<Item> filter)
Withdraws all but one of the specified item.
|
boolean |
withdrawAllButOne(int id)
Withdraws all but one of the specified item.
|
boolean |
withdrawAllButOne(java.lang.String name)
Withdraws all but one of the specified item.
|
contains, contains, contains, contains, containsAll, containsAll, getAmount, getAmount, getAmount, getEmptySlots, getItem, getItem, getItem, getItemInSlot, getSlot, getSlot, getSlot, getSlot, getSlot, getSlotForNameThatContains, hover, interact, interact, interact, interact, interactWithNameThatContains, inverseFilter, isEmpty, isFull, onlyContains, onlyContains, onlyContains
exchangeContext, execute, getBank, getBot, getCamera, getChatbox, getClient, getColorPicker, getCombat, getConfigs, getDepositBox, getDialogues, getDiaries, getDisplay, getDoorHandler, getEquipment, getExperienceTracker, getFavour, getGrandExchange, getGraphicObjects, getGroundItems, getHintArrow, getInventory, getKeyboard, getLogoutTab, getMagic, getMap, getMenuAPI, getMouse, getNpcs, getObjects, getPlayers, getPrayer, getProjectiles, getQuests, getSettings, getSkills, getStore, getTabs, getTrade, getWalking, getWidgets, getWorlds, gRandom, gRandom, gRandom, initializeContext, log, log, myPlayer, myPosition, random, random, sleep, stripFormatting, warn
public static final int STORE_ALL
public static final int STORE_1
public static final int STORE_5
public static final int STORE_10
public static final int WITHDRAW_ALL
public static final int WITHDRAW_ALL_BUT_ONE
public static final int WITHDRAW_1
public static final int WITHDRAW_5
public static final int WITHDRAW_10
public void initializeModule()
initializeModule
in class API
public boolean isBankModeEnabled(Bank.BankMode bankMode)
public RS2Widget getItemContainerWidget()
public boolean openTab(int tab)
tab
- The bank tab id. 0 is for all items, 1-9 are the tabs.public int getCurrentTab()
public int getTabsAvailable()
public int getItemCountForTab(int tab)
public Item[] getItemsInTab(int tab)
tab
- The bank tab id. 0 is for all items, 1-9 are the tabs.public int getTabForItem(int id)
id
- The item id to look for.public int getTabForAbsoluteSlot(int slot)
public Bank.BankMode getInsertMode()
public Bank.BankMode getWithdrawMode()
public int getCapacity()
getCapacity
in class ItemContainer
public int getInterfaceId()
ItemContainer
getInterfaceId
in class ItemContainer
public int getInterfaceChildId()
ItemContainer
getInterfaceChildId
in class ItemContainer
public Item[] getItems()
Some entries may be null as place-markers.
getItems
in class ItemContainer
@SafeVarargs public final java.util.List<Item> filter(Filter<Item>... filters)
ItemContainer
filter
in class ItemContainer
filters
- The filters.public boolean isOpen()
public boolean open() throws java.lang.InterruptedException
java.lang.InterruptedException
public Entity closest()
public boolean close()
public boolean enableMode(Bank.BankMode bankMode)
public boolean depositAll()
public boolean depositAll(boolean checkResults)
checkResults
- Wait to check if items were actually withdrawn.public boolean depositAll(int... ids)
ids
- The ids of the items to be deposited in the bank.public boolean depositAll(java.lang.String... names)
names
- The ids of the items to be deposited in the bank.public boolean depositAll(java.util.List<Item> items)
items
- The ids of the items to be deposited in the bank.public boolean depositAll(boolean checkResults, java.util.List<Item> items)
@SafeVarargs public final boolean depositAll(Filter<Item>... filters)
filters
- The filter.@SafeVarargs public final boolean depositAll(boolean checkResults, Filter<Item>... filters)
public boolean depositAllExcept(int... ids)
ids
- Item ids to ignore when depositing.public boolean depositAllExcept(java.lang.String... names)
names
- Item names to ignore when depositing.public boolean depositAllExcept(java.util.List<Item> items)
items
- The list.@SafeVarargs public final boolean depositAllExcept(Filter<Item>... filters)
filters
- The filters.@SafeVarargs public final boolean depositAllExcept(boolean checkResults, Filter<Item>... filters)
public boolean deposit(Filter<Item> filter, int amount_)
Filter
but this should only be used
for one item id/name in the filter. Failing to follow this guideline can
result in unexpected behaviour of this method. It is not recommended to
use this method when you have the item id or name present. If you have
the item id or name present, use the equivalent methods. Instead only use
this when you have created your own specific filter and are sure it will
boil down onto one specific item id. In any case, this method will only
apply to the first item returned from the filter.filter
- The filter.amount_
- The amount to deposit. STORE_ALL
or 0 defines
the option Store-All.public boolean deposit(int id, int amount)
id
- The item id.amount
- The amount to deposit. STORE_ALL
or 0 defines the
option Store-All.public boolean deposit(java.lang.String name, int amount)
name
- The item name.amount
- The amount to deposit. STORE_ALL
or 0 defines the
option Store-All.public java.awt.Rectangle getAbsoluteSlotPosition(int tabSlot, int absoluteSlot)
tabSlot
- The slot.public RS2Widget getSlotWidget(int widgetId)
@Deprecated public boolean isSlotVisible(Bot bot, int tabSlot, int absoluteSlot)
public boolean isSlotVisible(int tabSlot, int absoluteSlot)
tabSlot
- The specified slot to check for if its visible or not.public boolean scrollToSlot(int tabSlot, int absoluteSlot)
tabSlot
- The slot to scroll to.public boolean withdrawAll(int id)
id
- The item id.public boolean withdrawAll(java.lang.String name)
name
- The item name.public boolean withdrawAll(Filter<Item> filter)
filter
- The item filter.public boolean withdrawAllButOne(int id)
id
- The item id.public boolean withdrawAllButOne(java.lang.String name)
name
- The item name.public boolean withdrawAllButOne(Filter<Item> filter)
filter
- The item filter.public boolean withdraw(int id, int amount)
id
- The item id.amount
- The amount to withdraw.public boolean withdraw(java.lang.String name, int amount)
name
- The item name.amount
- The amount to withdraw.public boolean withdraw(java.util.HashMap<java.lang.String,java.lang.Integer> items)
public boolean withdraw(Filter<Item> filter, int amount_)
filter
- The filter.amount_
- The amount to withdraw.public boolean withdraw(Filter<Item> filter, int amount_, boolean checkResults)
filter
- The filter.amount_
- The amount to withdraw.checkResults
- Wait to check if items were actually withdrawn.public boolean depositWornItems()