Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit 3d33b11

Browse files
phantaaaExplv
authored andcommitted
Banking section fixes (#4)
* Fixed instructor name and minor bug fixes * Fixed bank section * "Fixed bank section
1 parent f28e8f1 commit 3d33b11

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/script/TutorialIsland.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.osbot.rs07.script.Script;
44
import org.osbot.rs07.script.ScriptManifest;
55
import sections.*;
6+
import utils.Sleep;
67

78
@ScriptManifest(author = "Explv", name = "Explv's Tutorial Island", info = "Completes Tutorial Island", version = 5.2, logo = "")
89
public final class TutorialIsland extends Script {
@@ -30,7 +31,7 @@ public void onStart() throws InterruptedException {
3031
wizardSection.exchangeContext(getBot());
3132

3233
// prevents script from skipping character customization
33-
sleep(4000);
34+
Sleep.sleepUntil(() -> getClient().isLoggedIn() && myPlayer().isVisible() && myPlayer().isOnScreen(), 6000, 500);
3435
}
3536

3637
@Override

src/sections/BankSection.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import org.osbot.rs07.api.map.Area;
44
import org.osbot.rs07.api.map.Position;
55
import org.osbot.rs07.api.model.RS2Object;
6+
import org.osbot.rs07.api.ui.RS2Widget;
67
import utils.Sleep;
78

89
import java.util.Arrays;
910
import java.util.List;
11+
import java.util.Optional;
1012

1113
public 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

Comments
 (0)