3
3
import org .osbot .rs07 .api .map .Area ;
4
4
import org .osbot .rs07 .api .map .Position ;
5
5
import org .osbot .rs07 .api .model .RS2Object ;
6
+ import org .osbot .rs07 .api .ui .RS2Widget ;
6
7
import utils .Sleep ;
7
8
8
9
import java .util .Arrays ;
9
10
import java .util .List ;
11
+ import java .util .Optional ;
10
12
11
13
public final class BankSection extends TutorialSection {
12
14
@@ -44,7 +46,7 @@ public final class BankSection extends TutorialSection {
44
46
);
45
47
46
48
public BankSection () {
47
- super ("Financial Advisor " );
49
+ super ("Account Guide " );
48
50
}
49
51
50
52
@ Override
@@ -83,6 +85,12 @@ public final void onLoop() throws InterruptedException {
83
85
case 530 :
84
86
talkToInstructor ();
85
87
break ;
88
+ case 531 :
89
+ openAccountManagementTab ();
90
+ break ;
91
+ case 532 :
92
+ talkToInstructor ();
93
+ break ;
86
94
case 540 :
87
95
if (openDoorAtPosition (new Position (3130 , 3124 , 0 ))) {
88
96
Sleep .sleepUntil (() -> getProgress () != 540 , 5000 , 500 );
@@ -95,4 +103,14 @@ private boolean openDoorAtPosition(final Position position) {
95
103
RS2Object door = getObjects ().closest (obj -> obj .getName ().equals ("Door" ) && obj .getPosition ().equals (position ));
96
104
return door != null && door .interact ("Open" );
97
105
}
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
+ }
98
116
}
0 commit comments