Bank ==== Methods to interact with the Bank. ---- TRSBank.Find ~~~~~~~~~~~~ :: function TRSBank.Find(Item: TRSItem; out Box: TBox): Boolean; Uses itemfinder to find a item in the current bank view. If found the item box is returned in the `out Box: TBox` parameter. The bank can be scrolled for this to work. Example:: if Bank.Find('fire rune', Box) then ShowOnClient(Box); ---- TRSBank.GetItemArea ~~~~~~~~~~~~~~~~~~~ :: function TRSBank.GetItemArea: TBox; Returns the area in the bank where items are. Example:: ShowOnClient(Bank.GetItemArea()); ---- TRSBank.GetItemBoxes ~~~~~~~~~~~~~~~~~~~~ :: function TRSBank.GetItemBoxes: TBoxArray; Returns static item boxes based on when the bank is fully scrolled up. Example:: ShowOnClient(Bank.GetItemBoxes()); ---- TRSBank.HasItems ~~~~~~~~~~~~~~~~ :: function TRSBank.HasItems: Boolean; Returns True if the bank has items. Uses the black item border to determines if items exist. ---- TRSBank.Open ~~~~~~~~~~~~ :: function TRSBank.IsOpen: Boolean; Returns true if the bank screen is open. Example:: if Bank.IsOpen() then WriteLn('Bank is open!') else WriteLn('Bank is not open'); ---- TRSBank.IsOpen ~~~~~~~~~~~~~~ :: function TRSBank.IsOpen(WaitTime: Integer; Interval: Integer = -1): Boolean; overload; Overload which waits up to `WaitTime` in milliseconds for the bank screen to open. Example:: if Bank.IsOpen(3000) then WriteLn('Bank is open within 3000ms'); ---- Bank.Close ~~~~~~~~~~ :: function TRSBank.Close(PressEscape: Boolean = False): Boolean; Closes the bank, Depending on `PressEscape` the function will either click the button or press backspace. Example:: WriteLn Bank.Close(); ---- Bank.CloseSearch ~~~~~~~~~~~~~~~~ :: function TRSBank.CloseSearch: Boolean; Closes the bank search if it's open. Example:: Bank.Search('logs'); // Search for logs Wait(1000); Bank.CloseSearch(); ---- Bank.Search ~~~~~~~~~~~ :: function TRSBank.Search(Item: String): Boolean; Searches for an item. Example:: Bank.Search('logs'); // Search for logs ---- Bank.FindItemBoundaries ~~~~~~~~~~~~~~~~~~~~~~~ :: function TRSBank.FindItemBoundaries: TBoxArray; Finds item boundaries. This is an internal function used to retrieve the boxes we search for items in with itemfinder. Example:: ShowOnClient(Self.FindItemBoundaries()); ---- Bank._SimplifyItemName ~~~~~~~~~~~~~~~~~~~~~~ :: function TRSBank._SimplifyItemName(Item: TRSItem): String; Internal function to get a human like search term for an item. This could be improved for better antiban but I decided to keep it simple since it's not used very frequently. This basically strips the item name from things humans won't usually type when searching, like brackets. It also makes the string lower case because people searching don't usually care about casing. Once that's done wee crop some characters from the final string, because humans don't usually search the full item name, but just enough until it's seen on screen. .. note:: Could be improved to in the future for only using the relevant part of the string. For example, an human searching for 'Amulet of glory(6)' would probably search for 'glory' instead of 'amulet of gl'. Example:: WriteLn Bank._SimplifyItemName('Amulet of glory(6)'); ---- Bank.FindItemTab ~~~~~~~~~~~~~~~~ :: function TRSBank.FindItemTab(Item: TRSItem; OpenTab: Boolean = True): Integer; Find the bank tab of an item just by knowing it's name. This is very useful when you want to support people having items in any tab they want without much hassle for people to setup. By default it will open the banktab if the item is found. This can be changed by setting **OpenTab** to false. The result will be the BankTab of the item. **-1** means we didn't find a BankTab. .. note:: A known limitation of this is that if several items match the sprite of the item (for example multiple charged jewelry) the tab retrieved will be the first one found. If you have 'Games necklace(1)' in tab 1 and 'Games necklace(8)' in tab 5 and search for the latter, you will get tab 1. Example:: WriteLn Bank.FindItemTab('Molten glass'); ---- TRSBank.GetTabCount ~~~~~~~~~~~~~~~~~~~ :: function TRSBank.GetTabCount: Integer; Counts how many tabs the bank has. Example:: WriteLn Bank.GetTabCount(); ---- TRSBank.GetTabBoxes ~~~~~~~~~~~~~~~~~~~ :: function TRSBank.GetTabBoxes: TBoxArray; Returns boxes of every possible bank tab (10 of them). The first box is the "all items" tab. Example:: ShowOnClient(Bank.GetTabBoxes()) ---- TRSBank.GetCurrentTab ~~~~~~~~~~~~~~~~~~~~~ :: function TRSBank.GetCurrentTab: Integer; Get the current active bank tab. Example:: WriteLn Bank.GetCurrentTab; ---- TRSBank.IsCurrentTab ~~~~~~~~~~~~~~~~~~~~ :: function TRSBank.IsCurrentTab(Index: Integer): Boolean; Returns true if the current tab index is `Index`. Example:: if Bank.IsCurrentTab(0) then WriteLn('Current bank tab index is 0, aka the "all items" tab'); ---- TRSBank.OpenTab ~~~~~~~~~~~~~~~ :: function TRSBank.OpenTab(TabIndex: Integer): Boolean; Opens the desired tab index. Example:: Bank.OpenTab(0); ---- Bank.WithdrawItem ~~~~~~~~~~~~~~~~~ :: function TRSBank.WithdrawItem(Item: TRSBankWithdrawItem; UseQuantityButtons: Boolean): Boolean; Finds and withdraws an item. Parameters ---------- Item TRSBankWithdrawItem variable to withdraw. UseQuantityButtons Determines if to use the 1,5,10,X,ALL `Quantity` buttons. Example:: var ItemToWithdraw: TRSBankWithdrawItem; ItemToWithdraw.Item := 'Iron full helm'; ItemToWithdraw.Quantity := 5; ItemToWithdraw.Noted := False; Bank.WithdrawItem(ItemToWithdraw, True); // OR you can shorthand by passing an open array. Bank.WithdrawItem(['Iron full helm', 5, False], True); ---- Bank.DepositAll ~~~~~~~~~~~~~~~ :: function TRSBank.DepositAll: Boolean; Deposits the entire inventory by clicking the deposit inventory button ---- :: var Bank ~~~~~~~~ Global Bank variable. ---- GameTabs.Open ~~~~~~~~~~~~~ :: function TRSGameTabs.Open(Tab: ERSGameTab): Boolean; override; Overrides **GameTabs.Open** to close the bank if the bank open.