33import org .osbot .rs07 .api .map .Area ;
44import org .osbot .rs07 .api .map .Position ;
55import org .osbot .rs07 .api .model .RS2Object ;
6+ import org .osbot .rs07 .api .ui .RS2Widget ;
67import utils .Sleep ;
78
89import java .util .Arrays ;
910import java .util .List ;
11+ import java .util .Optional ;
1012
1113public final class BankSection extends TutorialSection {
1214
@@ -44,7 +46,7 @@ public final class BankSection extends TutorialSection {
4446 );
4547
4648 public BankSection () {
47- super ("Financial Advisor " );
49+ super ("Account Guide " );
4850 }
4951
5052 @ Override
@@ -83,6 +85,12 @@ public final void onLoop() throws InterruptedException {
8385 case 530 :
8486 talkToInstructor ();
8587 break ;
88+ case 531 :
89+ openAccountManagementTab ();
90+ break ;
91+ case 532 :
92+ talkToInstructor ();
93+ break ;
8694 case 540 :
8795 if (openDoorAtPosition (new Position (3130 , 3124 , 0 ))) {
8896 Sleep .sleepUntil (() -> getProgress () != 540 , 5000 , 500 );
@@ -95,4 +103,14 @@ private boolean openDoorAtPosition(final Position position) {
95103 RS2Object door = getObjects ().closest (obj -> obj .getName ().equals ("Door" ) && obj .getPosition ().equals (position ));
96104 return door != null && door .interact ("Open" );
97105 }
106+
107+ private void openAccountManagementTab () {
108+ if (accountManagementWidget ().isPresent () && accountManagementWidget ().get ().interact ()) {
109+ Sleep .sleepUntil (() -> getProgress () == 532 , 5000 , 500 );
110+ }
111+ }
112+
113+ private Optional <RS2Widget > accountManagementWidget () {
114+ return getWidgets ().containingActions (548 , "Account Management" ).stream ().findFirst ();
115+ }
98116}
0 commit comments