@Override public int loop() { System.out.println("Inside loop"); scriptState = getState(); currentXp = Skills.getXp(Skill.RUNECRAFT); switch (scriptState) { case BANKING: banking.depositRunes(); banking.withdrawEss(usingPouches); break; case CRAFT_RUNES: runecraft.craftRunes(usingPouches); break; case ENTER_RUINS: runecraft.enterRuins(); break; case EXIT_ALTAR: runecraft.exitPortal(); break; case OPEN_BANK: if (!banking.openBank()) { walk.toBankFailsafe(); } break; case WALK_TO_ALTAR: path.toAltar(); // walk.toAltar(); break; case WALK_TO_PORTAL: path.toPortal(); // walk.toPortal(); break; case WALK_TO_BANK: path.toBank(); // walk.toBank(); break; case WALK_TO_RUINS: path.toRuins(); // walk.toMysteriousRuins(); break; case GUI: System.out.println("Waiting for GUI"); break; } return Random.nextInt(50, 150); }
@Override public boolean onStart() { System.out.println("JJ's RuneCrafter started"); startTime = System.currentTimeMillis(); // Setting up GUI gui = new GUI(); gui.setVisible(true); while (gui.isVisible()) { sleep(100, 200); } chosenAltar = gui.getChosenAltar(); chosenBank = gui.getChosenBank(); chosenPouches = gui.getChosenPouches(); chosenEssence = gui.getChosenEssence(); usingTiara = gui.usingTiara(); if (chosenPouches != null && chosenPouches.length > 0) { usingPouches = true; } // Setting up instance variables startXp = Skills.getXp(Skill.RUNECRAFT); currentXp = startXp; startTime = System.currentTimeMillis(); // Creating objects containing methods banking = new Banking(chosenAltar, chosenEssence, chosenPouches); runecraft = new RuneCraft(chosenAltar, chosenPouches, usingTiara); walk = new Walk(chosenAltar, chosenBank); switch (chosenAltar) { case AIR: path = new AirPath(); break; case BODY: path = new BodyPath(); break; case EARTH: path = new EarthPath(); break; case FIRE: path = new FirePath(); break; case LAW: System.out.println("UNSUPPORTED!"); this.stop(); break; case MIND: if (chosenBank.equals(BankLoc.EDGEVILLE)) { path = new MindPathEdge(); } else { path = new MindPathFally(); } break; case WATER: path = new WaterPath(); break; } return true; }