SRL Archive - OSR Help

Explanation: Two Bank Routines


NickMystre

2012-01-05 22:18:52

I am trying to get my head around these two Bank routines …

  1. MSTPointToBankPoint
  2. BankPointToBankIndex

Could someone who understands these please explain them in detail for me ?

Thanks! :)

Mark

2012-01-05 22:21:42

From: NickMystre
I am trying to get my head around these two Bank routines …

  1. MSTPointToBankPoint
  2. BankPointToBankIndex

Could someone who understands these please explain them in detail for me ?

Thanks! :)


    function MSTPointToBankPoint(P: TPoint): TPoint;

Converts a point on the Mainscreen to the point in the Bank.

    function BankPointToBankIndex(P: TPoint): Integer;

Converts a Bank Point (Row,Col) to Bank Index (spot in bank). (0, 0) = 1

just double click the function in simba

NickMystre

2012-01-05 22:59:06

From: CRU1Z1N
    function MSTPointToBankPoint(P: TPoint): TPoint;

Converts a point on the Mainscreen to the point in the Bank.

    function BankPointToBankIndex(P: TPoint): Integer;

Converts a Bank Point (Row,Col) to Bank Index (spot in bank). (0, 0) = 1

just double click the function in simba


Some questions …

  1. Why would you want to convert a Mainscreen point to one in the Bank ? I don't understand this.
  2. WRT: BankPointToBankIndex(P: TPoint) -> Does this refer to the first bank tab (Infinity) where you have all the items listed, and you can reference them using the row / column method ie Row 5, Column 2 could be Tab 2 / Item 2 for example.

Thanks!

DemiseScythe

2012-01-06 01:52:52

These are useless by themselves, their real use is in this:

GetMSBankItemAmount(x, y);

Both the above just help this function work. With this, you can find an Item in bank with the method of your choice and once you have x and y coordinates of the item, you can call an Integer and make it equal to the above like this:

Shark: Integer;

Shark := GetMSBankItemAmount(x, y);

This will sell you how many Sharks you have in your bank if you indeed have a Shark in (x, y). This is just an example but you can use this to find the amount of any item in your bank.

smurg

2012-01-06 01:53:08

From: NickMystre
Some questions …

  1. Why would you want to convert a Mainscreen point to one in the Bank ? I don't understand this.
  2. WRT: BankPointToBankIndex(P: TPoint) -> Does this refer to the first bank tab (Infinity) where you have all the items listed, and you can reference them using the row / column method ie Row 5, Column 2 could be Tab 2 / Item 2 for example.

Thanks!


I think the Bank point refers to Col, Row as a TPoint.

NickMystre

2012-01-06 06:53:34

From: DemiseScythe
These are useless by themselves, their real use is in this:

GetMSBankItemAmount(x, y);

Both the above just help this function work. With this, you can find an Item in bank with the method of your choice and once you have x and y coordinates of the item, you can call an Integer and make it equal to the above like this:

Shark: Integer;

Shark := GetMSBankItemAmount(x, y);

This will sell you how many Sharks you have in your bank if you indeed have a Shark in (x, y). This is just an example but you can use this to find the amount of any item in your bank.


@DemiseScythe: Yes, thank you. That is the missing link for me. I appreciate the help. Thanks! :)

NickMystre

2012-01-06 06:56:30

From: smurg
I think the Bank point refers to Col, Row as a TPoint.


I resorted to playing with these routines for a bit and 'discovered' (for want of a better term) the tpoint connection. Thanks for the confirmation. :)