Skip to content

Commit 9a5ed5a

Browse files
committed
bankpin buttons
1 parent 670ae9f commit 9a5ed5a

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

osrs/interfaces/mainscreen/bank.simba

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,16 @@ var
300300
tpa: TPointArray;
301301
offset: Integer;
302302
begin
303+
if BankPin.IsOpen() then
304+
begin
305+
//TODO:
306+
//if not SleepUntil(BankPin.ButtonsLoaded(), 100, 3000) then
307+
// Self.Fatal('Bank pin buttons don''t seem to have loaded in 3 seconds.');
308+
309+
//if not BankPin.Enter(Login.GetPlayerPin()) then
310+
// Self.Fatal('Failed to enter bank pin');
311+
end;
312+
303313
count := Target.CountColor($0, 0, Self._IsOpenHelperBox);
304314
tpa := Target.FindColor(RSColors.TEXT_ORANGE, 0, Self._IsOpenHelperBox);
305315
Result := ((count = 94) and (Length(tpa) = 116)) or Self.Title.IsTitle('Bank') or Self.Title.IsTitle('Equip');

osrs/interfaces/mainscreen/bankpin.simba

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,39 @@ Methods to interact with the bank pin interface.
88

99

1010
type
11-
TRSBankPin = type TRSInterface;
11+
TRSBankPin = record
12+
Bounds: TBox;
13+
Buttons: TRSButtonArray;
14+
end;
1215

1316
procedure TRSBankPin.SetupInterface();
17+
var
18+
boxes: TBoxArray;
19+
i: Integer;
1420
begin
1521
with InterfaceArea do
1622
begin
1723
Self.Bounds.X1 := Max(Floor(Center.X-(Width-1)/2), Floor(Center.X-487/2));
24+
Self.Bounds.Y1 := Max(Floor(Center.Y-(Height-3)/2), Center.Y-148);
1825
Self.Bounds.X2 := Min(Floor(Center.X+(Width-1)/2), Floor(Center.X +487/2));
19-
Self.Bounds.Y1 := Max(Floor(Center.Y-(Height-3)/2), Floor(Center.Y-799/2));
20-
Self.Bounds.Y2 := Min(Floor(Center.Y+(Height-3)/2), Floor(Center.Y+799/2));
26+
Self.Bounds.Y2 := Min(Floor(Center.Y+(Height-3)/2), Center.Y+157);
27+
end;
28+
29+
boxes := TBoxArray.Create(Self.Bounds.TopLeft.Offset(25,88), 3, 3, 55, 55, [39, 17]);
30+
boxes.Insert(boxes[2].Offset([84, 0]), 3);
31+
32+
SetLength(Self.Buttons, 10);
33+
for i := 0 to High(boxes) do
34+
begin
35+
Self.Buttons[i].Bounds := boxes[i];
36+
Self.Buttons[i].EnabledColors := [];
2137
end;
38+
end;
2239

40+
function TRSBankPin.IsOpen(): Boolean;
41+
begin //TODO:
42+
Result := Target.HasColor($060D56, 10, 30000, Self.Bounds);
2343
end;
2444

45+
var
46+
BankPin: TRSBankPin;

osrs/interfaces/setup.simba

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ begin
2222
XPBar.SetupInterface();
2323
Prayer.SetupInterface();
2424
Stats.SetupInterface();
25+
BankPin.SetupInterface();
2526
Bank.SetupInterface();
2627
end;
2728

osrs/walker.simba

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ begin
11511151

11521152
if path = [] then Continue;
11531153

1154-
dist := Floor(path.TotalDistance());
1154+
dist := Floor(path.PolylineLength());
11551155
if dist < shortest then
11561156
begin
11571157
shortPaths := [path];

0 commit comments

Comments
 (0)