Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics2D;
- import org.osbot.rs07.api.ui.RS2Widget;
- import org.osbot.rs07.api.ui.Skill;
- import org.osbot.rs07.api.ui.Spells;
- import org.osbot.rs07.api.ui.Tab;
- import org.osbot.rs07.input.mouse.MouseDestination;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import org.osbot.rs07.utility.ConditionalSleep;
- import org.osbot.rs07.api.Mouse;
- @ScriptManifest(author = "ME", info = "Bracelets", name = "AlchBot-1.1", version = 1, logo = "")
- public class main extends Script {
- @Override
- public void onStart() {
- log("Let's get started!");
- }
- @Override
- public int onLoop() throws InterruptedException {
- MouesDestination ==
- getMouse().move((MouseDestination)
- getObjects().closest("Grand Exchange booth");
- getBank().open();
- new ConditionalSleep(5000) { public boolean condition() {return getBank().isOpen();}}.sleep();
- getBank().depositAllExcept("Nature rune");
- if (getBank().contains("Yew longbow") || getBank().contains("Yew longbow (u)")) {
- getBank().depositAllExcept("Nature rune");
- if (getBank().contains("Yew longbow")) {
- getBank().withdrawAll("Yew longbow");
- getBank().close();
- new ConditionalSleep(5000) {
- public boolean condition() {
- return getBank().isOpen();}
- }.sleep();
- new ConditionalSleep(3000) { public boolean condition() {return !getBank().isOpen();}}.sleep();
- }
- else if (getBank().contains("Bow string") && getBank().contains("Yew longbow (u)")) {
- getBank().withdraw("Bow string", 1);
- getBank().withdrawAll("Yew longbow (u)");
- getBank().close();
- new ConditionalSleep(3000) {
- public boolean condition() {
- return !getBank().isOpen();}
- }.sleep();;
- }
- }
- else {
- getBot().getScriptExecutor().stop(false);}
- // }
- // add string
- while (getInventory().contains("Nature rune") && getInventory().contains("Yew longbow (u)")) {
- int bracelets = (int) getInventory().getAmount("Yew longbow (u)");
- if (getInventory().contains("Bow string")) {
- inventory.interact("Use", "Bow string");
- new ConditionalSleep(1000) {
- public boolean condition() {
- return getInventory().isItemSelected(); }
- }.sleep();
- inventory.interact("Use", "Yew longbow (u)");
- new ConditionalSleep(1000) {
- @Override
- public boolean condition() throws InterruptedException {
- long braceletsNew = getInventory().getAmount("Yew longbow (u)");
- if (bracelets != braceletsNew) {
- return true;
- }
- return false;
- }
- }.sleep();
- }
- else if (!getInventory().contains("Bow string")) {
- getBank().open();
- new ConditionalSleep(5000) {
- public boolean condition() {
- return getBank().isOpen();}
- }.sleep();
- if (!getInventory().isFull()) {
- if (getBank().contains("Bow string")) {
- getBank().withdraw("Bow string", 1);
- getBank().close();
- new ConditionalSleep(5000) {
- public boolean condition() {
- return !getBank().isOpen();}
- }.sleep();
- }
- else {
- getBot().getScriptExecutor().stop(false);
- ;
- }
- }
- else {
- getBank().depositAll();
- if (getBank().contains("Bow string")) {
- getBank().withdrawAll("Nature rune");
- getBank().withdraw("Bow string", 1);
- getBank().withdrawAll("Yew longbow (u)");
- getBank().close();
- new ConditionalSleep(3000) {
- public boolean condition() {
- return !getBank().isOpen();}
- }.sleep();
- }
- else {
- getBot().getScriptExecutor().stop(false);
- }
- }
- }
- }
- // alch
- RS2Widget alchWarn = getWidgets().getWidgetContainingText("Click here to continue");
- getTabs().open(Tab.MAGIC);
- while (getInventory().contains("Nature rune") && getInventory().contains("Yew longbow")) {
- skills.getExperience(Skill.MAGIC);
- if (getTabs().getOpen().equals(Tab.MAGIC)) {
- magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
- sleep(random(250,750));
- }
- inventory.interact("Cast", "Yew longbow");
- new ConditionalSleep(5000) {
- @Override
- public boolean condition() throws InterruptedException {
- long magicNew = skills.getExperience(Skill.MAGIC);
- long magicOld = 0;
- if ((magicNew != magicOld) || (alchWarn != null && alchWarn.isVisible()) && getTabs().getOpen().equals(Tab.MAGIC)) {
- return true;
- }
- return false;
- }
- }.sleep();
- new ConditionalSleep(5000) {
- @Override
- public boolean condition() throws InterruptedException {
- if (getTabs().getOpen().equals(Tab.MAGIC)) {
- return true;
- }
- return false;
- }
- }.sleep();
- if (alchWarn != null && alchWarn.isVisible()) {
- break;
- }
- if(getInventory().contains("Yew longbow") && getInventory().contains("Nature rune")) {
- sleep(random(250,750));
- magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
- }
- else {
- break;
- }
- }
- return 0;
- } // EoL
- @Override
- public void onExit() {
- }
- @Override
- public void onPaint(Graphics2D g) {
- }
- }
Add Comment
Please, Sign In to add comment