Class Bank
java.lang.Object
com.botwithus.bot.api.inventory.InventoryContainer
com.botwithus.bot.api.inventory.Bank
The bank inventory (inv id 95). The bank UI lives at iface 517 with a
separate component for the bank slot grid. Singleton per
GameAPI;
obtain via api.bank().
Inherits read/containment/slot interactions from InventoryContainer.
The high-level verbs (depositAll(), withdraw(int, Bank.TransferAmount), presets, ...)
queue COMPONENT actions against iface 517.
Every interface, component and variable the verbs touch is addressed by its
gameval name through GameAPI.gamevals(), so a game renumber is fixed by
refreshing the gameval index rather than by editing this class. The literal
ids are only the fallback for a host with no index deployed; they were checked
against the gameval table, the CS2 menu-op layout and the V1 bank API.
Item-slot menus on both the banked-items grid and the bank's backpack grid
share one op layout: 1 default quantity, 2 one, 3 five,
4 ten, 5 last X, 6 enter X, 7 all.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumBank interface mode — standard transfer controls or preset selector.static enumSide panel view alongside the bank grid.static enumBank transfer quantity, with itsBANK_CUSTOMOPvarbit value and its op on the item-slot menus.static enumBank withdraw mode: as item or as bank note. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBackpack items shown inside the bank interface (BANK__INVENTORY_CLICK).static final intBanked-items slot grid (BANK__BANK_INV).static final intWithdraw-X / Deposit-X input layer (MESLAYER).static final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanclose()Click the bank's close (X) button.booleandeposit(int itemId, Bank.TransferAmount amount) Deposit one stack ofitemIdfrom the backpack-inside-bank panel.booleanDeposit carried backpack contents.booleanDeposit coin pouch.booleanDeposit worn equipment.booleanDeposit carried items + equipment + familiar + coins, in order.booleanDeposit familiar inventory.booleanfinishTransferX(int amount) Finish a deposit-X or withdraw-X: typeamountinto the enter-amount dialog and submit it, throughInputDialog.enterAmount(long).intPreset page (0 for presets 1-9, 1 for 10-18).intCurrently configured custom withdraw amount.booleanTrue when the withdraw-X / deposit-X dialog is up.booleanisOpen()True when the bank UI (iface 517) is open.setting()Bank interface setting — standard transfer or preset selector.booleanSelect the bank's quantity-mode button.booleanstartDepositX(int itemId) Open the deposit-X dialog foritemId.booleanstartWithdrawX(int itemId) Open the withdraw-X dialog foritemId.Currently selected transfer mode (1 / 5 / 10 / custom / all).view()Side-panel view alongside the bank grid.booleanwithdraw(int itemId, Bank.TransferAmount amount) Withdraw one stack ofitemIdwith the given transfer amount.booleanwithdrawAll(int itemId) Withdraw the entire stack ofitemId.Withdraw mode — items as-is or as bank notes.booleanwithdrawPreset(int presetNumber) Withdraw a saved bank preset (1-18) through the quick-preset buttons, flipping to the preset's page first when needed (presets 10-18 live on the second page).Methods inherited from class InventoryContainer
clearDefinitionCache, componentId, contains, contains, contains, containsAll, containsAny, containsGameval, count, count, countGameval, definitionCacheSize, findFirst, findFirst, findFirstGameval, freeSlots, getAll, getAllSlots, getAllSlotVars, getFirst, getFirst, getFirstGameval, getItems, getSlot, getSlotVars, interact, interact, interactFirst, interactFirst, interactFirstGameval, interactFirstGameval, interfaceId, invId, isEmpty, isFull, isNotEmpty, isNotFull, occupiedSlots, slotCount
-
Field Details
-
INVENTORY_ID
public static final int INVENTORY_ID- See Also:
-
INTERFACE_ID
public static final int INTERFACE_ID- See Also:
-
COMPONENT_ID
public static final int COMPONENT_IDBanked-items slot grid (BANK__BANK_INV). The slot interactions inherited fromInventoryContainerbind this literal; the verbs on this class resolve it by name. Component 195 is the grid's scrollbar.- See Also:
-
BACKPACK_COMPONENT
public static final int BACKPACK_COMPONENTBackpack items shown inside the bank interface (BANK__INVENTORY_CLICK).- See Also:
-
INPUT_INTERFACE
public static final int INPUT_INTERFACEWithdraw-X / Deposit-X input layer (MESLAYER).- See Also:
-
-
Constructor Details
-
Bank
-
-
Method Details
-
isOpen
public boolean isOpen()True when the bank UI (iface 517) is open. -
isInputOpen
public boolean isInputOpen()True when the withdraw-X / deposit-X dialog is up. -
getWithdrawAmount
public int getWithdrawAmount()Currently configured custom withdraw amount. -
getPresetPage
public int getPresetPage()Preset page (0 for presets 1-9, 1 for 10-18). -
view
Side-panel view alongside the bank grid. -
withdrawMode
Withdraw mode — items as-is or as bank notes. -
setting
Bank interface setting — standard transfer or preset selector. -
transferMode
Currently selected transfer mode (1 / 5 / 10 / custom / all). -
close
public boolean close()Click the bank's close (X) button. No-op when the bank isn't open. -
depositAll
public boolean depositAll()Deposit carried backpack contents. -
depositEquipment
public boolean depositEquipment()Deposit worn equipment. -
depositFamiliar
public boolean depositFamiliar()Deposit familiar inventory. -
depositCoins
public boolean depositCoins()Deposit coin pouch. -
depositEverything
public boolean depositEverything()Deposit carried items + equipment + familiar + coins, in order. -
deposit
Deposit one stack ofitemIdfrom the backpack-inside-bank panel. Returns false when the bank isn't open or the item isn't in the backpack. -
startDepositX
public boolean startDepositX(int itemId) Open the deposit-X dialog foritemId. -
finishTransferX
public boolean finishTransferX(int amount) Finish a deposit-X or withdraw-X: typeamountinto the enter-amount dialog and submit it, throughInputDialog.enterAmount(long). Returns false, sending nothing, when the bank is not open or the dialog is not asking for an amount. Atruereturn means queued: the digits and Enter land one per game tick, so the item count moves that many ticks later.- Throws:
IllegalArgumentException- whenamountis negative
-
withdraw
Withdraw one stack ofitemIdwith the given transfer amount. -
withdrawAll
public boolean withdrawAll(int itemId) Withdraw the entire stack ofitemId. -
startWithdrawX
public boolean startWithdrawX(int itemId) Open the withdraw-X dialog foritemId. -
withdrawPreset
public boolean withdrawPreset(int presetNumber) Withdraw a saved bank preset (1-18) through the quick-preset buttons, flipping to the preset's page first when needed (presets 10-18 live on the second page). The caller is responsible for waiting for the bank to drain — this method only queues the clicks. -
setTransferMode
Select the bank's quantity-mode button.
-