Jump to content

OSBot 2.3.4 - Bank API and Comparators


Alek

Recommended Posts

The Bank API is now the second class to undergo the interface value cache transformation talked about in previous releases. Please note that the withdraw and rearrange modes are deprecated and WILL NOT be updated when they break. Please ensure your scripts are using the new dynamic methods.
 
This is a pretty large update to banking. If you have any issues please let me know immediately!
 
Bank API Changes:
-Deprecated:
Bank.WithdrawAsMode
Bank.RearrangeMode
Bank.setRearrangeMode
Bank.setWithdrawAsMode
Bank.INTERFACE_ID
Bank.INTERFACE_CHILD_ID
Bank.SCROLL_CONTAINER
 
-Added:
Bank.MAIN_INTERFACE_ID_CACHE
Bank.CHILD_INTERFACE_ID_CACHE
Bank.REARRANGE_SWAP_CACHE
Bank.REARRANGE_INSERT_CACHE
Bank.WITHDRAW_NOTE_CACHE
Bank.WITHDRAW_ITEM_CACHE
Bank.BankMode
Bank.getInsertMode()
Bank.getWithdrawMode()
Bank.enableMode(BankMode)
 
-Retrieves values dynamically:
-Bank main interface id
-Bank child id
-Bank swap modes
-Bank deposit modes
-Bank deposit inventory/equipment
 
In other news:
Preset collection comparators have been added; the first one being InterfaceComparator. Comparators are useful for sorting varying objects which in our case can be NPCs, Game objects, Interfaces, and other components we typically find while scripting. Specifically in this case, the Bank API retrieves interface ids for the various buttons dependent on their location within the window (specifically their getX() value).
 
For instance:
List<RS2InterfaceChild> children = new ArrayList<>();
Collections.sort(children, InterfaceComparator.yComparator);

In this case, all the RS2InterfaceChilds are arranged within the list from least to greatest in getY() value. In the future I plan to apply similar comparators to NPCs with sorting by values such as height, polygon count, position, etc.

 

Also for the new Bank API usage:

bank.enableMode(Bank.BankMode.REARRANGE_INSERT)

API Docs have been updated, clear your browser file cache if they haven't updated.

 

Sincerely,

-The OSBot Staff

 
  • Like 2
Link to comment

@Alek since Banks is a class that has static polygonsArea. Can you make a static method that returns all the polygons in banks. So it will be easier for the scripters to cycle through the different banks with out manually creating an array of polygonsArea like i had to do. Unless you want to add in my method. i dont mind.

Edited by josedpay
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...