Bank¶
Methods to interact with the Bank.
Bank.IsOpen¶
function TBank.IsOpen(waitForItems: Boolean = True): Boolean;
Returns true if the Bank is visible.
waitForItems determines if the method waits up to one second for item to appears. There can be a small delay before items are visible.
Bank.Close¶
function TBank.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.FindItemBoundaries¶
function TBank.FindItemBoundaries(): TBoxArray;
Finds item boundaries. This is an internal function used to retrieve the boxes we search for items in.
Example:
Boxes := Self.FindItemBoundaries();
WriteLn Items.Find(Item, Boxes);
Bank.Setup¶
procedure Bank.Setup;
Initializes Bank variables.
Note
This is automatically called on the Bank variable.
Bank.Search¶
function TBank.Search(item: String): Boolean;
Searches for an item.
Example:
Bank.Search('logs'); // Search for logs
Bank.CloseSearch¶
function TBank.CloseSearch(): Boolean;
Closes the bank search if it’s open.
Example:
Bank.Search('logs'); // Search for logs
Wait(1000);
Bank.CloseSearch();
Bank.Open()¶
function TBank.Open(P: TPoint): Boolean;
Function to open a bank at a specified P TPoint. This function will move the mouse to P and if the uptext matches the bank or a banker uptext it will open the bank.
Example:
P := CustomBankFinderFunction();
Bank.Open(P);
Bank.CountTabs¶
function TBank.CountTabs: Int32;
Counts the existing bank tabs.
Example:
WriteLn Bank.CountTabs;
Bank.GetCurrentTab¶
function TBank.GetCurrentTab(): Int32;
Get the current active bank tab.
Example:
WriteLn Bank.GetCurrentTab;
Bank.OpenTab¶
function TBank.OpenTab(tab: Int32): Boolean;
Open the specified bank tab.
Example:
Bank.OpenTab(0);
Bank._SimplifyItemName¶
function TBank._SimplifyItemName(item: TItem): 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 TBank.FindItemTab(Item: TItem; OpenTab: Boolean = True): Int32;
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 jewlry) 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');
Bank.FindItem¶
function TBank.FindItem(Item: TItem; out box: TBox): Boolean;
function TBank.FindItem(item: TBankItem; out box: TBox; attempts: Int32 = 0): Boolean; overload;
Finds and returns the bounds of an item in the bank The TBankItem version of the method will actually search the bank for the item while the TItem will not.
Example:
Bank.FindItem('Coins', Box);
Debug(Box);
Bank.ContainsItem¶
function TBank.ContainsItem(Item: TItem): Boolean;
function TBank.ContainsItem(out item: TBankItem): Boolean; overload;
Returns true/false whether a item is found in the bank or not. The TBankItem version of the method will actually search the bank for the item while the TItem will not.
Example:
WriteLn Bank.ContainsItem('Coins');
Bank.DiscoverAll¶
function TBank.DiscoverAllEx(): array of TItemArray;
function TBank.DiscoverAll(): TItemArray;
Returns all possible items found visible in the bank.
The extended version returns an array of TItemArray while the other returns
a flat TItemArray.
Example:
if Bank.Open() then
WriteLn Bank.DiscoverAll();
Bank.Discover¶
function TBank.Discover(slot: Int32): TItemArray;
Discovers what item is on the specified bank slot.
Example:
if Bank.Open() then
WriteLn Bank.Discover(0);
Bank.ContainsAny¶
function TBank.ContainsAny(items: TItemArray): Boolean;
Returns true/false whether any item in items is visible in the bank.
Bank.CountItem¶
function TBank.CountItem(Item: TItem): Int32;
Counts the amount of items that share the same sprite in the bank. This are extremely rare but do exist, e.g.: Edible seaweed, seaweed, giant seaweed.
Example:
WriteLn Bank.CountItem('Seaweed');
Bank.CountItemStack¶
function TBank.CountItemStack(Item: TItem): Int32;
Counts the stack amount of a item in the bank.
Example:
WriteLn Bank.CountItemStack('Coins');
Bank.MouseItem¶
function TBank.MouseItem(Item: TItem): Boolean;
Moves the mouse to an item.
Example:
Bank.MouseItem('Coins');
Bank.ClickItem¶
function TBank.ClickItem(Item: TItem; Option: String = ''): Boolean;
Clicks an item in the bank. If an Option is specified and it’s not in the uptext it will right click the item and look for the Option.
Example:
Bank.ClickItem('Coins', 'All');
Bank.WithdrawItem¶
function TBank.WithdrawItem(item: TBankItem; useQuantityButtons: Boolean): Boolean;
function TBank.WithdrawItem(item: TItem; useQuantityButtons: Boolean): Boolean; overload;
Finds and withdraws an item.
Parameters:
Item TItem, TBankItem to withdraw. Item to withdraw, quantity and noted if using TBankItem.
useQuantityButtons Determines if to use the 1,5,10,X,ALL
Quantitybuttons.
Example:
var
ItemToWithdraw: TBankItem;
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.DepositItem¶
function TBank.DepositItem(item: TBankItem; useQuantityButtons: Boolean): Boolean; overload
Deposits the specified item into the bank.
Example:
WriteLn BankDepositItem(['Coins', TBank.QUANTITY_ALL, False]);
Bank.DepositAll¶
function TBank.DepositAll: Boolean;
Depositis your inventory by clicking the deposit inventory button
Bank.DepositEquipment¶
function TBank.DepositEquipment: Boolean;
Depositis your equipment by clicking the deposit equipment button
var Bank¶
Global Bank variable.
GameTabs.Open() override;¶
function TGameTabs.Open(Tab: EGameTab): Boolean; override;
Overrides GameTabs.Open() to close the bank if the bank open.