Skip to content

Commit

Permalink
fix: compatibility with latest SRL-T
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Jun 20, 2024
1 parent 492427a commit 63df907
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
2 changes: 1 addition & 1 deletion osr/basescript.simba
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ function TBaseBankScript.HoverBank(): Boolean;
begin
if ScriptWalker = nil then
begin
Self.HoveringBank := Bank.HoverV2();
Self.HoveringBank := Banks.Hover();
Exit(Self.HoveringBank);
end;

Expand Down
53 changes: 16 additions & 37 deletions osr/interfaces/mainscreen/collectbox.simba
Original file line number Diff line number Diff line change
Expand Up @@ -404,80 +404,59 @@ begin
Result := WaitUntil(Self.IsOpen(), SRL.TruncatedGauss(50, 1500), 3000);
end;

var
(*
(CollectBox)=
## var CollectBox
Global CollectBox variable.
*)
CollectBox: TRSCollectBox;

function TRSCollectBox.HoverV2(mapObj: PRSMapObject = nil): Boolean;
begin
Result := Bank.HoverV2(mapObj);
end;
type
TRSCollectBoxes = type TRSBanks;

function TRSCollectBox.OpenV2(mapObj: PRSMapObject = nil): Boolean;
function TRSCollectBoxes.Open(mapObj: PRSMapObject = nil): Boolean; override;
begin
if RSInterface.IsOpen() then
begin
if Self.IsOpen() or BankPin.IsOpen() then
if CollectBox.IsOpen() or BankPin.IsOpen() then
Exit(True);
RSInterface.Close(True);
end;

if mapObj = nil then
begin
if Banks = [] then
Bank._SetupMapObjects();
if Banks = [] then
Exit;

mapObj := Banks.GetClosest();
end;

Result := mapObj^.SelectOption(['Collect']) or (MainScreen.IsUpText('Bank') and ChooseOption.Select(['Collect']));
if not Result then
Exit;

Minimap.WaitMoving();
Result := WaitUntil(Self.IsOpen() or BankPin.IsOpen(), SRL.TruncatedGauss(50, 1500), 3000);
Result := WaitUntil(CollectBox.IsOpen() or BankPin.IsOpen(), SRL.TruncatedGauss(50, 1500), 3000);
end;

function TRSCollectBox.WalkHoverV2(mapObj: PRSMapObject = nil): Boolean;
begin
Result := Bank.WalkHoverV2(mapObj);
end;

function TRSCollectBox.WalkOpenV2(mapObj: PRSMapObject = nil): Boolean;
function TRSCollectBoxes.WalkOpen(mapObj: PRSMapObject = nil): Boolean; override;
begin
if RSInterface.IsOpen() then
begin
if Self.IsOpen() or BankPin.IsOpen() then
if CollectBox.IsOpen() or BankPin.IsOpen() then
Exit(True);
RSInterface.Close(True);
end;

if mapObj = nil then
begin
if Banks = [] then
Bank._SetupMapObjects();
if Banks = [] then
Exit;

mapObj := Banks.GetClosest();
end;

Result := mapObj^.WalkSelectOption(['Collect']) or (MainScreen.IsUpText('Bank') and ChooseOption.Select(['Collect']));
if not Result then
Exit;

Minimap.WaitMoving();
Result := WaitUntil(Self.IsOpen(), SRL.TruncatedGauss(50, 1500), 3000);
Result := WaitUntil(CollectBox.IsOpen(), SRL.TruncatedGauss(50, 1500), 3000);
end;



(*
(CollectBox)=
## var CollectBox
Global CollectBox variable.
*)
var
CollectBox: TRSCollectBox;
CollectBoxes: TRSCollectBoxes;

procedure TRSClient.ClientModeChanged(); override;
begin
Expand Down

0 comments on commit 63df907

Please sign in to comment.