@@ -34,14 +34,6 @@ Bank enums used to interact with the bank interface.
3434 Slot: TBox;
3535 end;
3636
37- TRSBankItem = record
38- Item: TRSItem;
39- Quantity: Integer;
40- Noted: Boolean;
41- end;
42-
43- TRSBankItemArray = array of TRSBankItem;
44-
4537(*
4638(TRSBank)=
4739## type TRSBank
@@ -127,7 +119,7 @@ procedure Bank.SetupInterface;
127119Initializes Bank interface coordinates.
128120
129121```{note}
130- This is automatically called on the ** Bank** variable.
122+ This is automatically called on the {ref}` Bank` variable.
131123```
132124*)
133125procedure TRSBank.SetupInterface();
@@ -218,6 +210,19 @@ begin
218210 end;
219211end;
220212
213+ (*
214+ ## Bank.UpdateButtons
215+ ```pascal
216+ procedure TRSBank.UpdateButtons(offset: Integer);
217+ ```
218+ Internal helper method used to update the buttons coordinates.
219+
220+ All the bank's bottom buttons shift slightly on the X axis depending on how many dynamic buttons are visible.
221+
222+ ```{note}
223+ This is automatically called for you with {ref}`Bank.IsOpen()`.
224+ ```
225+ *)
221226procedure TRSBank.UpdateButtons(offset: Integer);
222227var
223228 i: Integer;
@@ -591,20 +596,61 @@ begin
591596end;
592597
593598
599+ (*
600+ ## Bank.HasIncinerator
601+ ```pascal
602+ function TRSBank.HasIncinerator(): Boolean;
603+ ```
604+ Returns true if the bank screen has the incenerator visible.
594605
606+ Example:
607+ ```pascal
608+ if Bank.HasIncenerator() then
609+ ShowOnClient(Self.Incenerator);
610+ ```
611+ *)
595612function TRSBank.HasIncinerator(): Boolean;
596613begin
597614 with Self.Incenerator do
598615 Result := Target.HasColor(ColorTolerance($517F9E, 2.132, EColorSpace.HSV, [2.437, 0.309, 0.256]), 1, [X1, Y1+55, X2, Y2]);
599616end;
600617
618+ (*
619+ ## Bank.InceneratorTooltipVisible
620+ ```pascal
621+ function TRSBank.InceneratorTooltipVisible(): Boolean;
622+ ```
623+ Returns true if the incenerator tooltip is visible.
624+ This is important to check when you want to interact with the bottom buttons of
625+ the bank as the tooltip will cover them.
626+
627+ Example:
628+ ```pascal
629+ WriteLn Bank.InceneratorTooltipVisible();
630+ ```
631+ *)
601632function TRSBank.InceneratorTooltipVisible(): Boolean;
602633begin
603634 with Self.Incenerator do
604635 Result := Target.HasColor($A0FFFF, 0, 1, [X1+6, Y1+76, X2, Y2+35]);
605636end;
606637
607- function TRSBank.UnHoverIncinerator(): Boolean;
638+ (*
639+ ## Bank.CloseInceneratorTooltip
640+ ```pascal
641+ function TRSBank.CloseInceneratorTooltip(): Boolean;
642+ ```
643+ Attempts to close the incenerator tooltip.
644+ This is important to do when you want to interact with the bottom buttons of
645+ the bank as the tooltip will cover them.
646+
647+ Example:
648+ ```pascal
649+ if Bank.InceneratorTooltipVisible() then
650+ WriteLn Bank.CloseInceneratorTooltip();
651+ ```
652+ *)
653+ function TRSBank.CloseInceneratorTooltip(): Boolean;
608654var
609655 boxes: TBoxArray;
610656begin
@@ -618,17 +664,42 @@ begin
618664end;
619665
620666
667+ (*
668+ ## Bank.HasPotionStorage
669+ ```pascal
670+ function TRSBank.HasPotionStorage(): Boolean;
671+ ```
672+ Returns True/False if the bank has the potion storage menu available.
673+
674+ Example:
675+ ```pascal
676+ WriteLn Bank.HasPotionStorage();
677+ ```
678+ *)
621679function TRSBank.HasPotionStorage(): Boolean;
622680begin
623681 Result := Target.HasColor(ColorTolerance($517F9E, 2.132, EColorSpace.HSV, [2.437, 0.309, 0.256]), 1, Self.PotionStorage);
624682end;
625683
684+ (*
685+ ## Bank.PotionStorageIsOpen
686+ ```pascal
687+ function TRSBank.PotionStorageIsOpen(): Boolean;
688+ ```
689+ Returns True if the potion storage is currently open.
690+
691+ Example:
692+ ```pascal
693+ WriteLn Bank.PotionStorageIsOpen();
694+ ```
695+ *)
626696function TRSBank.PotionStorageIsOpen(): Boolean;
627697begin
628698 Result := Target.HasColor($1F98FF, 0, 3000, Self.SlotsArea);
629699end;
630700
631701
702+ {%codetools off}
632703(*
633704## Bank._FindTabText
634705```pascal
@@ -643,7 +714,6 @@ if Bank.Search('logs') then
643714 ShowOnClient(bounds);
644715```
645716*)
646- {%codetools off}
647717function TRSBank._FindTabText(const tpa: TPointArray; out bounds: TBox): Boolean;
648718var
649719 atpa: T2DPointArray;
@@ -854,7 +924,20 @@ begin
854924end;
855925
856926
857- function TRSBank.Withdraw(const item: TRSBankItem;const useQuantityButton: Boolean = True; const useCache: Boolean = True): Boolean;
927+ (*
928+ ## Bank.Withdraw
929+ ```pascal
930+ function TRSBank.Withdraw(const item: TRSBankItem; const useQuantityButton: Boolean = True; const useCache: Boolean = True): Boolean;
931+ function TRSBank.Withdraw(const item: TRSItem; const useQuantityButton: Boolean = True; const useCache: Boolean = True): Boolean; overload;
932+ ```
933+ Attempts to withdraw `item` from the bank.
934+
935+ Example:
936+ ```pascal
937+ WriteLn Bank.Withdraw(item);
938+ ```
939+ *)
940+ function TRSBank.Withdraw(const item: TRSBankItem; const useQuantityButton: Boolean = True; const useCache: Boolean = True): Boolean;
858941var
859942 data: TBankPosition;
860943begin
@@ -869,6 +952,41 @@ begin
869952 Result := Self._InteractionHelper(ERSBankInteraction.WITHDRAW, data.Slot, item.Quantity, useQuantityButton);
870953end;
871954
955+ function TRSBank.Withdraw(const item: TRSItem; const useQuantityButton: Boolean = True; const useCache: Boolean = True): Boolean; overload;
956+ begin
957+ Result := Self.Withdraw(item.ToBankItem(), useQuantityButton, useCache);
958+ end;
959+
960+ (*
961+ ## Bank.Deposit
962+ ```pascal
963+ function TRSBank.Deposit(const item: TRSBankItem; const useQuantityButton: Boolean = True): Boolean;
964+ function TRSBank.Deposit(const item: TRSItem; const useQuantityButton: Boolean = True): Boolean; overload;
965+ ```
966+ Attempts to deposit `item` into the bank.
967+
968+ Example:
969+ ```pascal
970+ WriteLn Bank.Deposit(item);
971+ ```
972+ *)
973+ function TRSBank.Deposit(const item: TRSBankItem; const useQuantityButton: Boolean = True): Boolean;
974+ var
975+ slot: TBox;
976+ begin
977+ if Inventory.Items.Find(item.ToItem(), slot) then
978+ Result := Self._InteractionHelper(ERSBankInteraction.DEPOSIT, slot, item.Quantity, useQuantityButton);
979+ end;
980+
981+ function TRSBank.Deposit(const item: TRSItem; const useQuantityButton: Boolean = True): Boolean; overload;
982+ var
983+ slot: TBox;
984+ begin
985+ if Inventory.Items.Find(item, slot) then
986+ Result := Self._InteractionHelper(ERSBankInteraction.DEPOSIT, slot, 1, useQuantityButton);
987+ end;
988+
989+
872990procedure TRSBank.Draw(img: TImage);
873991var
874992 i: Integer;
0 commit comments