|
| 1 | +package script; |
| 2 | + |
| 3 | +import org.osbot.rs07.script.Script; |
| 4 | +import org.osbot.rs07.script.ScriptManifest; |
| 5 | +import sections.*; |
| 6 | + |
| 7 | +@ScriptManifest(author = "Explv", name = "Explv's Tutorial Island", info = "Completes Tutorial Island", version = 5.2, logo = "") |
| 8 | +public final class TutorialIsland extends Script { |
| 9 | + |
| 10 | + private final TutorialSection rsGuideSection = new RuneScapeGuideSection(); |
| 11 | + private final TutorialSection survivalSection = new SurvivalSection(); |
| 12 | + private final TutorialSection cookingSection = new CookingSection(); |
| 13 | + private final TutorialSection questSection = new QuestSection(); |
| 14 | + private final TutorialSection miningSection = new MiningSection(); |
| 15 | + private final TutorialSection fightingSection = new FightingSection(); |
| 16 | + private final TutorialSection bankSection = new BankSection(); |
| 17 | + private final TutorialSection priestSection = new PriestSection(); |
| 18 | + private final TutorialSection wizardSection = new WizardSection(); |
| 19 | + |
| 20 | + @Override |
| 21 | + public void onStart() throws InterruptedException { |
| 22 | + rsGuideSection.exchangeContext(getBot()); |
| 23 | + survivalSection.exchangeContext(getBot()); |
| 24 | + cookingSection.exchangeContext(getBot()); |
| 25 | + questSection.exchangeContext(getBot()); |
| 26 | + miningSection.exchangeContext(getBot()); |
| 27 | + fightingSection.exchangeContext(getBot()); |
| 28 | + bankSection.exchangeContext(getBot()); |
| 29 | + priestSection.exchangeContext(getBot()); |
| 30 | + wizardSection.exchangeContext(getBot()); |
| 31 | + } |
| 32 | + |
| 33 | + @Override |
| 34 | + public final int onLoop() throws InterruptedException { |
| 35 | + if (isTutorialIslandCompleted()) { |
| 36 | + stop(true); |
| 37 | + return 0; |
| 38 | + } |
| 39 | + |
| 40 | + switch (getTutorialSection()) { |
| 41 | + case 0: |
| 42 | + case 1: |
| 43 | + rsGuideSection.onLoop(); |
| 44 | + break; |
| 45 | + case 2: |
| 46 | + case 3: |
| 47 | + survivalSection.onLoop(); |
| 48 | + break; |
| 49 | + case 4: |
| 50 | + case 5: |
| 51 | + cookingSection.onLoop(); |
| 52 | + break; |
| 53 | + case 6: |
| 54 | + case 7: |
| 55 | + questSection.onLoop(); |
| 56 | + break; |
| 57 | + case 8: |
| 58 | + case 9: |
| 59 | + miningSection.onLoop(); |
| 60 | + break; |
| 61 | + case 10: |
| 62 | + case 11: |
| 63 | + case 12: |
| 64 | + fightingSection.onLoop(); |
| 65 | + break; |
| 66 | + case 14: |
| 67 | + case 15: |
| 68 | + bankSection.onLoop(); |
| 69 | + break; |
| 70 | + case 16: |
| 71 | + case 17: |
| 72 | + priestSection.onLoop(); |
| 73 | + break; |
| 74 | + case 18: |
| 75 | + case 19: |
| 76 | + case 20: |
| 77 | + wizardSection.onLoop(); |
| 78 | + break; |
| 79 | + } |
| 80 | + return 200; |
| 81 | + } |
| 82 | + |
| 83 | + private int getTutorialSection() { |
| 84 | + return getConfigs().get(406); |
| 85 | + } |
| 86 | + |
| 87 | + private boolean isTutorialIslandCompleted() { |
| 88 | + return getWidgets().getWidgetContainingText("Tutorial Island Progress") == null; |
| 89 | + } |
| 90 | +} |
0 commit comments