Bank Screen

The bankscreen file holds functions and procedures that are used in the runescape bank screen.

The source for this file can be found here.

Consts, Types, Vars

The following constants, types and variables are used throughout the bankScreen methods.

const Deposit Buttons

Constants that represent the the quick deposit buttons.

  • QUICK_DEPOSIT_INVENTORY
  • QUICK_DEPOSIT_EQIUPMENT
  • QUICK_DEPOSIT_BOB
  • QUICK_DEPOSIT_MONEY_POUCH

const Bank Buttons

Constants that represent the bank buttons.

  • BANK_BUTTON_PIN
  • BANK_BUTTON_PRESET_SETUP
  • BANK_BUTTON_PRESET_1
  • BANK_BUTTON_PRESET_2
  • BANK_BUTTON_NOTE

const Withdraw Options

Constants that represent different withdraw options.

  • WITHDRAW_AMOUNT_ALL
  • WITHDRAW_AMOUNT_ALL_BUT_ONE

const Bank Open Options

Constants that represent the different banks supported by SRL-6

  • BANK_NPC_BLUE
  • BANK_NPC_GREY
  • BANK_NPC_GREEN
  • BANK_NPC_DRAYNOR
  • BANK_BOOTH
  • BANK_GE
  • BANK_CHEST_SW
  • BANK_CHEST_SHANTAY
  • BANK_CHEST_DUEL
  • BANK_CHEST_CW
  • BANK_CHEST_GROTTO
  • BANK_CHEST_LUMBRIDGE
  • BANK_TABLE_BURTHORPE
  • BANK_CHEST_PRIFDDINAS
  • BANK_CHEST_BARB_OUTPOST

type TRSBankScreen

type
  TRSBankScreen = type TRSInterface;

A type that stores the bankScreen interface properties.

var bankScreen

var
  bankScreen: TRSBankScreen;

A variable through which scripters can access the TRSBankScreen type methods.

TRSBankScreen methods

The following methods should be called through the bankScreen variable.

Example:

if bankScreen.isOpen() then
  writeln('Bank screen is open!');

isOpen

function TRSBankScreen.isOpen(waitTime: integer = 0): boolean;

Returns true if the bankScreen interface is open. The optional waitTime parameter (default = 0) is the maximum time (in milliseconds) it will keep looking.

Note

  • by Olly
  • Last Updated: 17 March 2015 by The Mayor

Example:

if bankScreen.isOpen() then
  writeln('The banks is open! Let's start banking items!');

close

function TRSBankScreen.close(escape: boolean = true): boolean;

Returns true if the bankScreen is successfully closed. It uses the ESC key by default, but the escape parameter can be set to false to close via the mouse.

Note

  • by Olly
  • Last Updated: 19 March 2014 by Coh3n

Example:

if bankScreen.close() then
  writeln('Closed the bankscreen');

getBankSlotBoxes

function TRSBankScreen.getBankSlotBoxes(): TBoxArray;

Returns a TBoxArray of all of the bank slot boxes.

Note

  • by Olly
  • Last Updated: 04 October 2013 by Olly

Example:

var
  boxArr: TBoxArray;
begin
  boxArr := bankScreen.getBankSlotBoxes();

end;

getBankSlotBox

function TRSBankScreen.getBankSlotBox(slot: integer): TBox;

Returns a TBox of the bank slot slot . The layout of the slots can be seen here.

Note

  • by Olly
  • Last Updated: 04 October 2013 by Olly

Example:

var
  box: TBox;
begin
  box := bankScreen.getBankSlotBox(1);
  mouseBox(box, MOUSE_MOVE);
end;

getPackSlotBoxes

function TRSBankScreen.getPackSlotBoxes: TBoxArray;

Returns a TBoxArray of all of the backpack slots in the bank interface.

Note

  • by Olly
  • Last Updated: 15 July 2014 by The Mayor

Example:

var
  boxArr: TBoxArray;
begin
  boxArr := bankScreen.getPackSlotBoxes();

end;

getPackSlotBox

function TRSBankScreen.getPackSlotBox(slot: integer): TBox;

Returns the TBox of the desired backpack slot in the bank interface. Pack slots start at the top left at 1 and count across the columns.

Note

  • by Coh3n
  • Last Updated: 15 July 2014 by The Mayor

Example:

var
  b: TBox;
begin
  b := bankscreen.getPackSlotBox(1);
  mouseBox(b, MOUSE_RIGHT);
end;

getPackCount

function TRSBankScreen.getPackCount(): integer;

Returns the number of items in the bankscreen’s pack.

Note

  • by Coh3n
  • Last Updated: 24 November 2013 by Coh3n

Example:

var
  c: integer;
begin
  c := bankscreen.getPackCount();
  writeLn('There is ' + toStr(c) + ' items in the pack');
end;

isItemInPackSlot

function TRSBankScreen.isItemInPackSlot(slot: integer): boolean;

Returns true if an item is in the backpack slot slot inside the bankscreen interface.

Note

  • by Olly
  • Last Updated: 02 January 2013 by Ashaman88

Example:

if bankScreen.isItemInPackSlot(1) then
  writeln('We have an item in pack slot number 1');

isPackFull

function TRSBankScreen.isPackFull(): boolean;

Returns true if the backpack inside the bankscreen interface is full.

Note

  • by Olly
  • Last Updated: 02 January 2013 by Ashaman88

Example:

if bankScreen.isPackFull() then
  writeln('Our bankscreen pack is full!');

isPackEmpty

function TRSBankScreen.isPackEmpty(): boolean;

Returns true if the backpack inside the bankscreen interface is empty.

Note

  • by Olly
  • Last Updated: 5 February 2015 by HKbotz

Example:

if bankScreen.isPackEmpty() then
  writeln('Our bankscreen pack is empty!');

getPackCountDTM

function TRSBankScreen.getPackCountDTM(dtm: integer): integer;

Return the number of backpack slots that contain the DTM dtm inside the bank screen interface.

Note

  • by Olly
  • Last Updated: 02 January 2013 by Ashaman88

Example:

var
  dtm: integer;
  i: integer;
begin
  dtm := dtmFromString('lotsofstuffhere');
  i := bankScreen.getPackCountDTM(dtm);
  writeln('We counted ' + intToStr(i) + ' items in our bankScreen pack.');
end;

getPackCountBitmap

function TRSBankScreen.getPackCountBitmap(bmp, tolerance: integer): integer;

Return the number of backpack slots that contain the bitmap bmp inside the bank screen interface.

Note

  • by Olly
  • Last Updated: 02 January 2013 by Ashaman88

Example:

var
  bmp: integer;
  i: integer;
begin
  bmp := bitmapFromString('lotsofstuffhere');
  i := bankScreen.getPackCountBitmap(bmp, 10);
  writeln('We counted ' + intToStr(i) + ' items in our pack.');
end;

isTabActive

function TRSBankScreen.isTabActive(tab: integer): boolean;

Returns true if the bankScreen tab is the currently active tab.

Note

  • by Coh3n
  • Last Updated: 4 April 2014 by riwu

Example:

if (not bankscreen.isTabActive(3)) then
  bankscreen.openTab(3);

openTab

function TRSBankScreen.openTab(tab: integer): boolean;

Returns true if it successfully opens the bank tab tab .

Note

  • by Coh3n
  • Last Updated: 10 August 2013 by Coh3n

Example:

bankscreen.openTab(4);

quickDeposit

function TRSBankScreen.quickDeposit(depositType: integer): boolean;

Returns true if it clicks the quick deposit button depositType . Valid depositType constants are located at the top of this page.

Note

  • by Olly
  • Last Updated: 29 June 2015 by Turpinator

Example:

if bankScreen.isOpen(5000) then
  bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);

clickButton

function TRSBankScreen.clickButton(button: integer; useKey: boolean = true): boolean;

Returns true if it clicks the bank button button . If useKey is set to true (default = true) it will use the keyboard, else it will click the button with the mouse. Vaild button constants are located at the top of this page.

Note

  • by Olly
  • Last Updated: 29 June 2015 by Turpinator

Example:

if bankScreen.isOpen(5000) then
  bankScreen.clickButton(BANK_BUTTON_PRESET_1);

pointToSlot

function TRSBankScreen.pointToSlot(pnt: TPoint): integer;

Returns the bank slot which the TPoint pnt fall within. If it doesn’t fall within any slot, it returns -1.

Note

  • by Olly
  • Last Updated: 20 October 2013 by Olly

Example:

var
  x, y, myDTM: Integer;
begin
  myDTM := DTMFromString('heapsofstuff');

  if findDTM(myDTM, x, y, getClientBounds()) then
    writeLn('Found DTM in slot ' + toStr(bankScreen.pointToSlot([x, y]));
end;

enterAmount

function TRSBankScreen.enterAmount(amount, waitTime: integer): boolean;

Returns true if it enters the amount amount when depositing or withdrawing a custom amount of an item. It will keep trying until successful or waitTime is reached.

Note

  • by Olly
  • Last Updated: 19 December by Thomas

Example:

bankScreen.enterAmount(50, 5000);

deposit

function TRSBankScreen.deposit(slots: TIntegerArray; amounts: TIntegerArray = []; oneByOne: boolean = false): boolean;

Rturns true if it deposits items from the backpack into the bank. It can deposit all items, or specific slots and amounts. It can also deposit each item one by one.

  • slots : The slots you want to deposit
  • amounts : The amounts of the slots to deposit. Set to -1 to deposit all. Deposits all of every item by default.
  • oneByOne : Will click items one by one to deposit (default = false)

Note

  • by Coh3n
  • Last Updated: 24 May 2015 by The Mayor

Examples:

bankScreen.deposit([2..28]);
bankScreen.deposit([1, 2, 3, 4], [-1, 10, 15, 14]);
bankScreen.deposit([1..28], [], true); // one by one

withdraw

function TRSBankScreen.withdraw(slot, amount: integer; mouseOverText: TStringArray; asNote: boolean = false; toFamiliar: boolean = false): boolean;

Returns true if items are withdrawn from the bank.

  • slot : The bank slot to withdraw from
  • amount : The amount to withdraw. This can be any number, or one of the contants at the top of this page.
  • mouseOverText : The overText of the item. To ignore the overText, leave it blank ([‘’])
  • asNote : Withdraw the item as a note? (default = false)
  • toFamiliar : Withdraw the item to a familiar? (default = false)

Note

  • by Olly
  • Last Updated: 04 December 2014 by Serajin

Example:

// To withdraw 28 items from slot 1 if mouseOverText is vaild
bankscreen.withdraw(1, 28, ['Yew Log', 'Log']);

// To withdraw 500 items as notes from slot 1 if mouseOverText is valid
bankscreen.withdraw(1, 500, ['Yew Log', 'Log'], true);

 // To withdraw all items from slot 10 if mouseOverText is vaild
bankscreen.withdraw(10, WITHDRAW_AMOUNT_ALL, ['Yew Log', 'Log']);

// To withdraw 28 items from slot 1 and will *ignore* mouseOverText
bankScreen.withdraw(1, 28, ['']);

// To withdraw 28 items from slot 1 into your beast of burden familiar if mouseOverText is valid
bankScreen.withdraw(1, 28, ['Yew Log', 'Log'], false, true);

withdraw (overload 1)

function TRSBankScreen.withdraw(dtm, amount: integer; asNote: boolean = false; toFamiliar: boolean = false): boolean; overload;

Returns true if items are withdrawn from the bank. This overload takes a DTM instead of an array of slots.

  • dtm : The DTM to look for
  • amount : The amount to withdraw. This can be any number, or one of the contants at the top of this page.
  • asNote : Withdraw the item as a note? (default = false)
  • toFamiliar : Withdraw the item to a familiar? (default = false)

Note

  • by Olly
  • Last Updated: 04 December 2014 by Serajin

Example:

//To withdraw 28 items normally
bankScreen.withdraw(dtm, 28);

//To withdraw 50 items as notes
bankScreen.withdraw(dtm, 28, true);

//To withdraw 28 items to your beast of burden familiar
bankScreen.withdraw(dtm, 28, false, true);

withdraw (overload 2)

function TRSBankScreen.withdraw(bitmap, tolerance, amount: integer; asNote: boolean = false; toFamiliar: boolean = false): boolean; overload;

Returns true if items are withdrawn from the bank. This overload takes a bitmap instead of an array of slots or a DTM.

  • bitmap : The bitmap to look for
  • tolerance : The tolerance used in the bitmap search
  • amount : The amount to withdraw. This can be any number, or one of the contants at the top of this page.
  • asNote : Withdraw the item as a note? (default = false)
  • toFamiliar : Withdraw the item to a familiar? (default = false)

Note

  • by Olly
  • Last Updated: 04 December 2014 by Serajin

Example:

//To withdraw 28 items normally from slot 10
bankScreen.withdraw(bmp, 10, 28);

//To withdraw 50 items as notes from slot 10
bankScreen.withdraw(bmp, 10, 50, true);

//To withdraw 28 items from slot 10 to your beast of burden familiar
bankScreen.withdraw(bmp, 10, 28, false, true);

withdraw (overload 3)

function TRSBankScreen.withdraw(text: String; acc: extended; slot, amount: integer; waitTime: integer = 0; asNote: boolean = false; toFamiliar: boolean = false): boolean; overload;

Returns true if items are withdrawn from the bank. This overload uses the ‘string match’ method for the mouseOverText.

  • text : The mouseOverText of the item
  • acc : The minimum accuracy of the string match
  • slot : The bank slot to look in
  • amount : The amount to withdraw. This can be any number, or one of the contants at the top of this page.
  • waitTime : The max time to wait for the string to match
  • asNote : Withdraw the item as a note? (default = false)
  • toFamiliar : Withdraw the item to a familiar? (default = false)

Note

  • by Kevin
  • Last Updated: 04 December 2014 by Serajin

Example:

// To withdraw 28 items from slot 1 if mouseover text is valid, and waitTime of 1500ms
bankscreen.withdraw('Yew Log', 0.8, 1, 28, 1500);

 // To withdraw all items from slot 10 if mouseover text is valid, with default waitTime
bankscreen.withdraw('Yew Log', 0.8, 10, WITHDRAW_AMOUNT_ALL);

//To withdraw all items from slot 10 if mouseover text is valid, as notes
bankscreen.withdraw('Yew Log', 0.8, 10, WITHDRAW_AMOUNT_ALL, 1000, true);

// To withdraw 28 items from slot 1 into your beast of burden familiar if mouseover text is valid, and waitTime of 1000ms
bankScreen.withdraw('Yew Log', 0.8, 1, 28, 1000, false, true);

withdraw (overload 4)

function TRSBankScreen.withdraw(dtm, amount: integer; waitTime: integer = 0; text: string; acc: extended; asNote: boolean = false; toFamiliar: boolean = false): boolean;

Returns true if items are withdrawn from the bank. This overload takes a DTM and also uses the string match method. It is essentially a combination of overload 1 and 3.

  • dtm : The DTM to look for
  • amount : The amount to withdraw. This can be any number, or one of the contants at the top of this page.
  • waitTime : The max time to wait for the string to match
  • text : The mouseOverText of the item
  • acc : The minimum accuracy of the string match
  • asNote : Withdraw the item as a note? (default = false)
  • toFamiliar : Withdraw the item to a familiar? (default = false)

Note

  • by Kevin
  • Last Updated: 04 December 2014 by Serajin

Example:

//To withdraw 28 items normally
bankScreen.withdraw(dtm, 28);

//To withdraw 28 items named 'Potato seed'
bankScreen.withdraw(dtm, 28, 1000, 'Potato seed', 0.8);

//To withdraw 28 items named 'Potato seed' as notes
bankScreen.withdraw(dtm, 28, 1000, 'Potato seed', 0.8, true);

//To withdraw 28 items named 'Potato seed' to your beast of burden familiar, and 1500ms waitTime
bankScreen.withdraw(dtm, 28, 1500, 'Potato seed', 0.8, false, true);

_waitBankOrPinScreen

function _waitBankOrPinScreen(waitTime: integer): boolean;

Returns true if the bankScreen or pinScreen is open within waitTime

Note

  • by Olly
  • Last Updated: 22 November 2013 by Olly

Example:

_waitBankOrPinscreen(5000);

open

function TRSBankScreen.open(bankType: integer): boolean;

Opens the desired bank, current vaild ‘bankType’ constants are:

  • BANK_NPC_BLUE
  • BANK_NPC_GREY
  • BANK_NPC_GREEN
  • BANK_NPC_DRAYNOR
  • BANK_BOOTH
  • BANK_GE
  • BANK_CHEST_SW
  • BANK_CHEST_SHANTAY
  • BANK_CHEST_DUEL
  • BANK_CHEST_CW
  • BANK_CHEST_GROTTO
  • BANK_TABLE_BURTHORPE
  • BANK_CHEST_LUMBRIDGE
  • BANK_CHEST_PRIFDDINAS
  • BANK_CHEST_BARB_OUTPOST

Note

  • by Olly
  • Last Updated: 17 February 2014 by Turpinator

Example:

if bankScreen.open(BANK_NPC_BLUE) then
begin
  writeLn('The bank is open!');
  bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
  bankScreen.close();
end;

isButtonActive

function TRSBankScreen.isButtonActive(button: integer): boolean;

Returns true if the bank button button is activated. Valid button types consants are:

  • BANK_BUTTON_SEARCH
  • BANK_BUTTON_NOTE

Note

  • by Serajin
  • Last Updated: 29 June 2015 by Turpinator

Example:

bankScreen.isButtonActive(BANK_BUTTON_NOTE);

searchBank

function TRSBankScreen.searchBank(item: string): boolean;

Returns true if the item item is searched for and found. Items that are found appear in bank slot 1.

Note

  • by Serajin
  • Last Updated: 30 November 2014 by Serajin

Example:

if bankScreen.searchBank('Chaos rune') then
begin
  bankscreen.withdraw(1, WITHDRAW_AMOUNT_ALL, ['']);
  bankScreen.close();
end;