Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.event.KeyEvent;
- import java.util.Random;
- import org.osbot.rs07.api.map.Position;
- import org.osbot.rs07.api.model.NPC;
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.api.ui.EquipmentSlot;
- import org.osbot.rs07.api.ui.RS2Widget;
- import org.osbot.rs07.api.ui.Spells;
- import org.osbot.rs07.api.ui.Tab;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import org.osbot.rs07.utility.ConditionalSleep;
- @ScriptManifest(author = "", info = "", logo = "", name = "AutoFarm", version = 0)
- public class AutoFarm extends Script {
- String[] options = {"I've played in the past, but not recently.", "Nothing, thanks.", "Nope, I'm ready to move on!", "Yes."};
- @Override
- public int onLoop() throws InterruptedException {
- if (getConfigs().get(281) == 1000) {
- } else {
- if (inDialogue()) {
- if (isPendingClickContinue()) {
- clickContinue();
- } else {
- if (isPendingContinue()) {
- pressContinue();
- } else {
- if (isPendingOption()) {
- selectOptions(options);
- sleep(loopTime());
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 0) {
- RS2Widget characterScreen = getWidgets().get(269, 96);
- RS2Widget characterScreenAccept = getWidgets().get(269, 99);
- if (characterScreen != null && characterScreen.isVisible()) {
- if (characterScreenAccept != null && characterScreenAccept.isVisible()) {
- if (characterScreenAccept.interact()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- RS2Widget characterScreen = getWidgets().get(269, 96);
- return characterScreen == null;
- }
- }.sleep();
- }
- }
- } else {
- NPC guide = getNpcs().getAll().stream().filter(o -> o.getName().equals("RuneScape Guide") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (guide != null && !myPlayer().isMoving()) {
- if (guide.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 3) {
- if (getTabs().open(Tab.SETTINGS)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.SETTINGS;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 7) {
- NPC guide = getNpcs().getAll().stream().filter(o -> o.getName().equals("RuneScape Guide") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (guide != null && !myPlayer().isMoving()) {
- if (guide.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 10) {
- RS2Object guideDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3098 && o.getPosition().getY() == 3107).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (guideDoor != null && !myPlayer().isMoving()) {
- if (guideDoor.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 20) {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 30) {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 40) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze axe") && getInventory().contains("Tinderbox")) {
- RS2Object tree = getObjects().getAll().stream().filter(o -> o.getName().equals("Tree") && o.hasAction("Chop down")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tree != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (tree.interact("Chop down")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 50) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Logs")) {
- if (getInventory().contains("Tinderbox")) {
- if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Logs")) {
- if (getInventory().interact("Use", "Tinderbox")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Logs")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getInventory().contains("Bronze axe")) {
- RS2Object tree = getObjects().getAll().stream().filter(o -> o.getName().equals("Tree") && o.hasAction("Chop down")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tree != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (tree.interact("Chop down")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 60) {
- if (getTabs().open(Tab.SKILLS)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.SKILLS;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 70) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 80) {
- NPC fish = getNpcs().getAll().stream().filter(o -> o.getName().equals("Fishing spot") && o.hasAction("Net")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Small fishing net")) {
- if (fish != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (fish.interact("Net")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 90) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Raw shrimps") && getInventory().getAmount("Raw shrimps") >= 2) {
- RS2Object fire = getObjects().getAll().stream().filter(o -> o.getName().equals("Fire")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (fire == null) {
- if (getInventory().contains("Logs")) {
- if (getInventory().contains("Tinderbox")) {
- if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Logs")) {
- if (getInventory().interact("Use", "Tinderbox")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Logs")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getInventory().contains("Bronze axe")) {
- RS2Object tree = getObjects().getAll().stream().filter(o -> o.getName().equals("Tree") && o.hasAction("Chop down")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tree != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (tree.interact("Chop down")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Raw shrimps")) {
- if (fire.interact("Use")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Raw shrimps")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- NPC fish = getNpcs().getAll().stream().filter(o -> o.getName().equals("Fishing spot") && o.hasAction("Net")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (getInventory().contains("Small fishing net")) {
- if (fish != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (fish.interact("Net")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 110) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Raw shrimps") && getInventory().getAmount("Raw shrimps") >= 1) {
- RS2Object fire = getObjects().getAll().stream().filter(o -> o.getName().equals("Fire")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (fire == null) {
- if (getInventory().contains("Logs")) {
- if (getInventory().contains("Tinderbox")) {
- if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Logs")) {
- if (getInventory().interact("Use", "Tinderbox")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Logs")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getInventory().contains("Bronze axe")) {
- RS2Object tree = getObjects().getAll().stream().filter(o -> o.getName().equals("Tree") && o.hasAction("Chop down")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tree != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (tree.interact("Chop down")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (fire != null && getInventory().getSelectedItemName().equals("Raw shrimps")) {
- if (fire.interact("Use")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Raw shrimps")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- NPC fish = getNpcs().getAll().stream().filter(o -> o.getName().equals("Fishing spot") && o.hasAction("Net")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (getInventory().contains("Small fishing net")) {
- if (fish != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (fish.interact("Net")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (expert != null && !myPlayer().isMoving()) {
- if (expert.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 120) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- RS2Object gate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3089 && (o.getPosition().getY() == 3091 || o.getPosition().getY() == 3092)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (gate != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (gate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 130) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- RS2Object chefDoor_0 = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3079 && o.getPosition().getY() == 3084).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (chefDoor_0 != null && !myPlayer().isMoving()) {
- if (chefDoor_0.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 140) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- NPC chef = getNpcs().getAll().stream().filter(o -> o.getName().equals("Master Chef") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (chef != null && !myPlayer().isMoving()) {
- if (chef.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 150) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Pot of flour") && getInventory().contains("Bucket of water")) {
- if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Pot of flour")) {
- if (getInventory().interact("Use", "Bucket of water")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().contains("Bread dough");
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Pot of flour")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- NPC chef = getNpcs().getAll().stream().filter(o -> o.getName().equals("Master Chef") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (chef != null && !myPlayer().isMoving()) {
- if (chef.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 160) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bread dough")) {
- RS2Object range = getObjects().getAll().stream().filter(o -> o.getName().equals("Range") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (range != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Bread dough")) {
- if (range.interact("Use")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Bread dough")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getInventory().contains("Pot of flour") && getInventory().contains("Bucket of water")) {
- if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Pot of flour")) {
- if (getInventory().interact("Use", "Bucket of water")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().contains("Bread dough");
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Pot of flour")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- NPC chef = getNpcs().getAll().stream().filter(o -> o.getName().equals("Master Chef") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (chef != null && !myPlayer().isMoving()) {
- if (chef.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 170) {
- if (getTabs().open(Tab.MUSIC)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.MUSIC;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 180) {
- RS2Object chefDoor_1 = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3072 && o.getPosition().getY() == 3090).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (chefDoor_1 != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (chefDoor_1.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 183) {
- if (getTabs().open(Tab.EMOTES)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.EMOTES;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 187) {
- if (getTabs().getOpen() == Tab.EMOTES) {
- if (!myPlayer().isAnimating() && getWidgets().getAll().stream().filter(w -> w.getSpriteIndex1() >= 700 && w.getSpriteIndex1() <= 717 && w.isVisible()).findAny().orElse(null).interact()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getTabs().open(Tab.EMOTES)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.EMOTES;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 190) {
- if (getTabs().open(Tab.SETTINGS)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.SETTINGS;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 200) {
- if (getSettings().setRunning(true)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getSettings().isRunning();
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 210) {
- RS2Object questDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3086 && o.getPosition().getY() == 3126).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (questDoor != null && questDoor.getPosition().isOnMiniMap(getBot()) && !myPlayer().isMoving()) {
- if (questDoor.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- } else {
- getWalking().walk(questDoor);
- }
- } else {
- if (getConfigs().get(281) == 220) {
- NPC quest = getNpcs().getAll().stream().filter(o -> o.getName().equals("Quest Guide") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (quest != null && !myPlayer().isMoving()) {
- if (quest.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 230) {
- if (getTabs().open(Tab.QUEST)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.QUEST;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 240) {
- NPC quest = getNpcs().getAll().stream().filter(o -> o.getName().equals("Quest Guide") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (quest != null && !myPlayer().isMoving()) {
- if (quest.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 250) {
- RS2Object questLadder = getObjects().getAll().stream().filter(o -> o.getName().equals("Ladder") && o.hasAction("Climb-down") && o.getPosition().getX() == 3088 && o.getPosition().getY() == 3119).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (questLadder != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (questLadder.interact("Climb-down")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 260) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 270) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tin != null && !myPlayer().isMoving()) {
- if (tin.interact("Prospect")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getConfigs().get(281) != 270;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 280) {
- RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (copper != null && !myPlayer().isMoving()) {
- if (copper.interact("Prospect")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getConfigs().get(281) != 280;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 290) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 300) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze pickaxe")) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tin != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (tin.interact("Mine")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 310) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze pickaxe")) {
- RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (copper != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (copper.interact("Mine")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 320) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Copper ore") && getInventory().contains("Tin ore")) {
- RS2Object furnace = getObjects().getAll().stream().filter(o -> o.getName().equals("Furnace") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (furnace != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Copper ore")) {
- if (furnace.interact("Use")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Copper ore")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getInventory().contains("Bronze pickaxe")) {
- if (getInventory().contains("Copper ore")) {
- if (!getInventory().contains("Tin ore")) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tin != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (tin.interact("Mine")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- }
- } else {
- RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (copper != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (copper.interact("Mine")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- }
- } else {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 330) {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 340) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Hammer") && getInventory().contains("Bronze bar")) {
- RS2Object anvil = getObjects().getAll().stream().filter(o -> o.getName().equals("Anvil") && o.hasAction("Smith")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (anvil != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (anvil.interact("Smith")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- RS2Widget smith = getWidgets().get(312, 2);
- return smith != null && smith.isVisible();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().contains("Hammer")) {
- if (!getInventory().contains("Bronze bar")) {
- if (getInventory().contains("Copper ore") && getInventory().contains("Tin ore")) {
- RS2Object furnace = getObjects().getAll().stream().filter(o -> o.getName().equals("Furnace") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (furnace != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Copper ore")) {
- if (furnace.interact("Use")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Copper ore")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getInventory().contains("Bronze pickaxe")) {
- if (getInventory().contains("Copper ore")) {
- if (!getInventory().contains("Tin ore")) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tin != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (tin.interact("Mine")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- }
- } else {
- RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (copper != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (copper.interact("Mine")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- }
- } else {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- }
- }
- } else {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 350) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Hammer") && getInventory().contains("Bronze bar")) {
- RS2Widget smith = getWidgets().get(312, 2);
- if (smith != null && smith.isVisible()) {
- if (smith.interact()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- RS2Object anvil = getObjects().getAll().stream().filter(o -> o.getName().equals("Anvil") && o.hasAction("Smith")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (anvil != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (anvil.interact("Smith")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- RS2Widget smith = getWidgets().get(312, 2);
- return smith != null && smith.isVisible();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getInventory().contains("Hammer")) {
- if (!getInventory().contains("Bronze bar")) {
- if (getInventory().contains("Copper ore") && getInventory().contains("Tin ore")) {
- RS2Object furnace = getObjects().getAll().stream().filter(o -> o.getName().equals("Furnace") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (furnace != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getInventory().isItemSelected()) {
- if (getInventory().getSelectedItemName().equals("Copper ore")) {
- if (furnace.interact("Use")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- if (getInventory().deselectItem()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- } else {
- if (getInventory().interact("Use", "Copper ore")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getInventory().contains("Bronze pickaxe")) {
- if (getInventory().contains("Copper ore")) {
- if (!getInventory().contains("Tin ore")) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (tin != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (tin.interact("Mine")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- }
- } else {
- RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (copper != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (copper.interact("Mine")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- }
- } else {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- }
- }
- } else {
- NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (mining == null) {
- RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (!myPlayer().isMoving()) {
- getWalking().walk(tin);
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (mining.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 360) {
- RS2Object miningGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3094 && (o.getPosition().getY() == 9503 || o.getPosition().getY() == 9502)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (miningGate != null && miningGate.getPosition().isOnMiniMap(getBot())) {
- if (!myPlayer().isMoving()) {
- if (miningGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- } else {
- getWalking().walk(miningGate);
- }
- } else {
- if (getConfigs().get(281) == 370) {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 390) {
- if (getTabs().open(Tab.EQUIPMENT)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.EQUIPMENT;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 400) {
- RS2Widget equipmentScreen = getWidgets().get(84, 1);
- if (equipmentScreen != null && equipmentScreen.isVisible()) {
- } else {
- if (getTabs().getOpen() == Tab.EQUIPMENT) {
- RS2Widget equipmentButton = getWidgets().get(387, 17, 7);
- if (equipmentButton != null && equipmentButton.isVisible()) {
- if (equipmentButton.interact()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- RS2Widget equipmentScreen = getWidgets().get(84, 1);
- return equipmentScreen != null && equipmentScreen.isVisible();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().open(Tab.EQUIPMENT)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.EQUIPMENT;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 405) {
- if (getInventory().contains("Bronze dagger")) {
- if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze dagger")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze dagger");
- }
- }.sleep();
- }
- } else {
- RS2Widget equipmentScreen = getWidgets().get(84, 1);
- if (equipmentScreen != null && equipmentScreen.isVisible()) {
- RS2Widget equipmentScreenClose = getWidgets().get(84, 4);
- if (equipmentScreenClose != null && equipmentScreenClose.isVisible()) {
- if (equipmentScreenClose.interact()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- RS2Widget equipmentScreen = getWidgets().get(84, 1);
- return equipmentScreen == null;
- }
- }.sleep();
- }
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 410) {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 420) {
- if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword")) {
- if (getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield")) {
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Wooden shield")) {
- if (getEquipment().equip(EquipmentSlot.SHIELD, "Wooden shield")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze sword")) {
- if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze sword")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 430) {
- if (getTabs().open(Tab.ATTACK)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.ATTACK;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 440) {
- if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword")) {
- if (getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield")) {
- NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (rat == null) {
- } else {
- if (getMap().canReach(rat)) {
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Wooden shield")) {
- if (getEquipment().equip(EquipmentSlot.SHIELD, "Wooden shield")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze sword")) {
- if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze sword")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 450) {
- if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword")) {
- if (getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield")) {
- NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (rat == null) {
- } else {
- if (getMap().canReach(rat)) {
- if (!myPlayer().isMoving() && !myPlayer().isUnderAttack()) {
- if (rat.interact("Attack")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isUnderAttack();
- }
- }.sleep();
- }
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Wooden shield")) {
- if (getEquipment().equip(EquipmentSlot.SHIELD, "Wooden shield")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze sword")) {
- if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze sword")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 460) {
- if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword")) {
- if (getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield")) {
- NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (rat == null) {
- } else {
- if (getMap().canReach(rat)) {
- if (!myPlayer().isMoving() && !myPlayer().isUnderAttack()) {
- if (rat.interact("Attack")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isUnderAttack();
- }
- }.sleep();
- }
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Wooden shield")) {
- if (getEquipment().equip(EquipmentSlot.SHIELD, "Wooden shield")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze sword")) {
- if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze sword")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 470) {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 480) {
- if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Shortbow")) {
- if (getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow")) {
- NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (rat != null && myPlayer().getInteracting() == null && !myPlayer().isMoving()) {
- if (rat.interact("Attack")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isUnderAttack();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze arrow")) {
- if (getEquipment().equip(EquipmentSlot.ARROWS, "Bronze arrow")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Shortbow")) {
- if (getEquipment().equip(EquipmentSlot.WEAPON, "Shortbow")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Shortbow");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 490) {
- if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Shortbow")) {
- if (getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow")) {
- NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (rat != null && myPlayer().getInteracting() == null && !myPlayer().isMoving()) {
- if (rat.interact("Attack")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isUnderAttack();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Bronze arrow")) {
- if (getEquipment().equip(EquipmentSlot.ARROWS, "Bronze arrow")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- if (getInventory().contains("Shortbow")) {
- if (getEquipment().equip(EquipmentSlot.WEAPON, "Shortbow")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Shortbow");
- }
- }.sleep();
- }
- } else {
- NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
- if (combat.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- } else {
- RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratGate != null && !myPlayer().isMoving()) {
- if (ratGate.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 500) {
- RS2Object ratLadder = getObjects().getAll().stream().filter(o -> o.getName().equals("Ladder") && o.hasAction("Climb-up") && o.getPosition().getX() == 3111 && o.getPosition().getY() == 9526).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (ratLadder != null && ratLadder.getPosition().isOnMiniMap(getBot()) && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (ratLadder.interact("Climb-up")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- } else {
- getWalking().walk(ratLadder);
- }
- } else {
- if (getConfigs().get(281) == 510) {
- RS2Object booth = getObjects().getAll().stream().filter(o -> o.getName().equals("Bank booth") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (booth != null && !myPlayer().isMoving()) {
- if (booth.interact("Use")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 520) {
- if (getBank().isOpen()) {
- if (getBank().close()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getBank().isOpen();
- }
- }.sleep();
- }
- } else {
- RS2Object pollBooth = getObjects().getAll().stream().filter(o -> o.getName().equals("Poll booth") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (pollBooth != null && !myPlayer().isMoving()) {
- if (pollBooth.interact("Use")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 525) {
- RS2Widget pollScreen = getWidgets().get(310, 2);
- RS2Widget pollScreenClose = getWidgets().get(310, 2, 11);
- if (pollScreen != null && pollScreen.isVisible()) {
- if (pollScreenClose != null && pollScreenClose.isVisible()) {
- if (pollScreenClose.interact()) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- RS2Widget pollScreen = getWidgets().get(310, 2);
- return pollScreen == null;
- }
- }.sleep();
- }
- }
- } else {
- RS2Object financialdoor_0 = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3125 && o.getPosition().getY() == 3124).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (financialdoor_0 != null && !myPlayer().isMoving()) {
- if (financialdoor_0.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 530) {
- NPC financial = getNpcs().getAll().stream().filter(o -> o.getName().equals("Financial Advisor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (financial != null && !myPlayer().isMoving()) {
- if (financial.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 540) {
- RS2Object financialdoor_1 = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3130 && o.getPosition().getY() == 3124).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (financialdoor_1 != null && !myPlayer().isMoving()) {
- if (financialdoor_1.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 550) {
- NPC monk = getNpcs().getAll().stream().filter(o -> o.getName().equals("Brother Brace") && o.hasAction("Talk-to") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (monk == null) {
- RS2Object brotherPlant = getObjects().getAll().stream().filter(o -> o.getName().equals("Plant") && o.getX() == 3131 && o.getPosition().getY() == 3108).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (brotherPlant != null && !myPlayer().isMoving()) {
- getWalking().walk(brotherPlant);
- }
- } else {
- if (getMap().canReach(monk)) {
- if (!myPlayer().isMoving()) {
- if (monk.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- RS2Object largeDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Large door") && o.hasAction("Open")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (largeDoor != null && !myPlayer().isMoving()) {
- if (largeDoor.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getMap().canReach(monk);
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 560) {
- if (getTabs().open(Tab.PRAYER)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.PRAYER;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 570) {
- NPC monk = getNpcs().getAll().stream().filter(o -> o.getName().equals("Brother Brace") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (monk == null) {
- RS2Object brotherPlant = getObjects().getAll().stream().filter(o -> o.getName().equals("Plant") && o.getX() == 3131 && o.getPosition().getY() == 3108).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (brotherPlant != null && !myPlayer().isMoving()) {
- getWalking().walk(brotherPlant);
- }
- } else {
- if (getMap().canReach(monk)) {
- if (!myPlayer().isMoving()) {
- if (monk.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- RS2Object largeDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Large door") && o.hasAction("Open")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (largeDoor != null && !myPlayer().isMoving()) {
- if (largeDoor.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getMap().canReach(monk);
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 580) {
- if (getTabs().open(Tab.FRIENDS)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.FRIENDS;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 590) {
- if (getTabs().open(Tab.IGNORES)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.IGNORES;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 600) {
- NPC monk = getNpcs().getAll().stream().filter(o -> o.getName().equals("Brother Brace") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (monk == null) {
- RS2Object brotherPlant = getObjects().getAll().stream().filter(o -> o.getName().equals("Plant") && o.getX() == 3131 && o.getPosition().getY() == 3108).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (brotherPlant != null && !myPlayer().isMoving()) {
- getWalking().walk(brotherPlant);
- }
- } else {
- if (getMap().canReach(monk)) {
- if (!myPlayer().isMoving()) {
- if (monk.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- RS2Object largeDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Large door") && o.hasAction("Open")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (largeDoor != null && !myPlayer().isMoving()) {
- if (largeDoor.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getMap().canReach(monk);
- }
- }.sleep();
- }
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 610) {
- RS2Object brotherDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3122 && o.getPosition().getY() == 3102).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (brotherDoor != null && !myPlayer().isMoving()) {
- if (brotherDoor.interact("Open")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 620) {
- NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (magic == null) {
- RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (charms != null && !myPlayer().isMoving()) {
- getWalking().walk(charms);
- }
- } else {
- if (magic.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 630) {
- if (getTabs().open(Tab.MAGIC)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.MAGIC;
- }
- }.sleep();
- }
- } else {
- if (getConfigs().get(281) == 640) {
- NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (magic == null) {
- RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (charms != null && !myPlayer().isMoving()) {
- getWalking().walk(charms);
- }
- } else {
- if (magic.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getConfigs().get(281) == 650) {
- if (getInventory().contains("Air rune")) {
- if (getInventory().contains("Mind rune")) {
- if (myPlayer().getPosition().equals(new Position(3139, 3091, 0))) {
- NPC chicken = getNpcs().getAll().stream().filter(o -> o.getName().equals("Chicken") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (chicken != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
- if (getMagic().castSpellOnEntity(Spells.NormalSpells.WIND_STRIKE, chicken)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- if (!myPlayer().isMoving()) {
- if (new Position(3139, 3091, 0).interact(getBot(), "Walk here")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isMoving();
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (magic == null) {
- RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (charms != null && !myPlayer().isMoving()) {
- getWalking().walk(charms);
- }
- } else {
- if (magic.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getTabs().getOpen() == Tab.INVENTORY) {
- NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (magic == null) {
- RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (charms != null && !myPlayer().isMoving()) {
- getWalking().walk(charms);
- }
- } else {
- if (magic.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- } else {
- if (getTabs().open(Tab.INVENTORY)) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return getTabs().getOpen() == Tab.INVENTORY;
- }
- }.sleep();
- }
- }
- }
- } else {
- if (getConfigs().get(281) == 670) {
- NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
- if (magic == null) {
- RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
- if (charms != null && !myPlayer().isMoving()) {
- getWalking().walk(charms);
- }
- } else {
- if (magic.interact("Talk-to")) {
- new ConditionalSleep(random(3600, 6300)) {
- @Override
- public boolean condition() throws InterruptedException {
- return inDialogue();
- }
- }.sleep();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return loopTime();
- }
- public void selectOptions(String... options) throws InterruptedException {
- for (String option : options) {
- RS2Widget widget = getWidgets().getAll().stream().filter(w -> w.getMessage().equals(option) && w.isVisible()).findAny().orElse(null);
- if (widget == null) {
- } else {
- getKeyboard().typeString("" + widget.getThirdLevelId());
- sleep(loopTime());
- }
- }
- }
- public boolean inDialogue() {
- return (getWidgets().get(162, 546) != null && getWidgets().get(162, 546).isVisible()) || (getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Select an Option") && w.isVisible()).findAny().orElse(null) != null) || (getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click here to continue") && w.isVisible()).findAny().orElse(null) != null) || (getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click to continue") && w.isVisible()).findAny().orElse(null) != null);
- }
- public boolean isPendingOption() {
- return getWidgets().getAll().stream().filter(w -> w.getSpriteIndex1() == 301 && w.isVisible()).findAny().orElse(null) != null;
- }
- public boolean isPendingClickContinue() {
- return getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click to continue") && w.isVisible()).findAny().orElse(null) != null;
- }
- public boolean isPendingContinue() {
- return getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click here to continue") && w.isVisible()).findAny().orElse(null) != null;
- }
- public void clickContinue() {
- getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click to continue") && w.isVisible()).findAny().orElse(null).interact();
- }
- public void pressContinue() {
- getKeyboard().pressKey(KeyEvent.VK_SPACE);
- }
- public int loopTime() {
- int delay = 0;
- Random r = new Random();
- while (delay <= 0) {
- delay = (int) Math.round(r.nextGaussian() * 100 + 250);
- }
- return delay;
- }
Advertisement
Add Comment
Please, Sign In to add comment