Guest User

Untitled

a guest
Dec 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.awt.Graphics2D;
  2.  
  3. import org.osbot.rs07.api.ui.RS2Widget;
  4. import org.osbot.rs07.api.ui.Skill;
  5. import org.osbot.rs07.api.ui.Spells;
  6. import org.osbot.rs07.api.ui.Tab;
  7. import org.osbot.rs07.input.mouse.MouseDestination;
  8. import org.osbot.rs07.script.Script;
  9. import org.osbot.rs07.script.ScriptManifest;
  10. import org.osbot.rs07.utility.ConditionalSleep;
  11. import org.osbot.rs07.api.Mouse;
  12.  
  13.  
  14. @ScriptManifest(author = "ME", info = "Bracelets", name = "AlchBot-1.1", version = 1, logo = "")
  15. public class main extends Script {
  16.  
  17.     @Override
  18.     public void onStart() {
  19.         log("Let's get started!");
  20.     }
  21.  
  22.     @Override
  23.     public int onLoop() throws InterruptedException {
  24.         MouesDestination ==
  25. getMouse().move((MouseDestination)        
  26. getObjects().closest("Grand Exchange booth");
  27.         getBank().open();
  28.         new ConditionalSleep(5000) { public boolean condition() {return getBank().isOpen();}}.sleep();
  29.         getBank().depositAllExcept("Nature rune");
  30.         if (getBank().contains("Yew longbow") || getBank().contains("Yew longbow (u)")) {
  31.             getBank().depositAllExcept("Nature rune");
  32.             if (getBank().contains("Yew longbow")) {
  33.                 getBank().withdrawAll("Yew longbow");
  34.                 getBank().close();
  35.                 new ConditionalSleep(5000) {
  36.                      public boolean condition() {
  37.                                  return getBank().isOpen();}
  38.                 }.sleep();
  39.                 new ConditionalSleep(3000) { public boolean condition() {return !getBank().isOpen();}}.sleep();
  40.             }
  41.             else if (getBank().contains("Bow string") && getBank().contains("Yew longbow (u)")) {
  42.                 getBank().withdraw("Bow string", 1);
  43.                 getBank().withdrawAll("Yew longbow (u)");
  44.                 getBank().close();
  45.                 new ConditionalSleep(3000) {
  46.                      public boolean condition() {
  47.                                  return !getBank().isOpen();}
  48.                 }.sleep();;
  49.         }
  50.         }
  51.         else {
  52.  
  53.             getBot().getScriptExecutor().stop(false);}
  54.            
  55.    
  56.    
  57.    
  58.    
  59.    
  60.     //    }
  61.        
  62.     // add string
  63.         while (getInventory().contains("Nature rune") && getInventory().contains("Yew longbow (u)")) {
  64.             int bracelets = (int) getInventory().getAmount("Yew longbow (u)");
  65.             if (getInventory().contains("Bow string")) {
  66.                 inventory.interact("Use", "Bow string");
  67.                 new ConditionalSleep(1000) {
  68.                      public boolean condition() {
  69.                                  return getInventory().isItemSelected(); }
  70.                 }.sleep();
  71.                
  72.                 inventory.interact("Use", "Yew longbow (u)");
  73.                 new ConditionalSleep(1000) {
  74.                     @Override
  75.                     public boolean condition() throws InterruptedException {
  76.                         long braceletsNew = getInventory().getAmount("Yew longbow (u)");
  77.                         if (bracelets != braceletsNew) {
  78.                             return true;
  79.                         }
  80.                         return false;
  81.                     }
  82.                 }.sleep();
  83.                 }
  84.             else if (!getInventory().contains("Bow string")) {
  85.                 getBank().open();
  86.                
  87.                 new ConditionalSleep(5000) {
  88.                      public boolean condition() {
  89.                                  return getBank().isOpen();}
  90.                 }.sleep();
  91.                
  92.                 if (!getInventory().isFull()) {
  93.                     if (getBank().contains("Bow string")) {
  94.                         getBank().withdraw("Bow string", 1);
  95.                         getBank().close();
  96.                         new ConditionalSleep(5000) {
  97.                              public boolean condition() {
  98.                                          return !getBank().isOpen();}
  99.                         }.sleep();
  100.                     }
  101.                     else {
  102.                         getBot().getScriptExecutor().stop(false);
  103.                     ;
  104.                         }
  105.                     }
  106.                 else {
  107.                     getBank().depositAll();
  108.                     if (getBank().contains("Bow string")) {
  109.                         getBank().withdrawAll("Nature rune");
  110.                         getBank().withdraw("Bow string", 1);
  111.                         getBank().withdrawAll("Yew longbow (u)");
  112.                         getBank().close();
  113.                         new ConditionalSleep(3000) {
  114.                              public boolean condition() {
  115.                                          return !getBank().isOpen();}
  116.                         }.sleep();
  117.                     }
  118.                     else {
  119.                        
  120.                         getBot().getScriptExecutor().stop(false);
  121.                     }
  122.                 }
  123.             }
  124.         }
  125. // alch
  126.         RS2Widget alchWarn = getWidgets().getWidgetContainingText("Click here to continue");
  127.         getTabs().open(Tab.MAGIC);
  128.         while (getInventory().contains("Nature rune") && getInventory().contains("Yew longbow")) {
  129.             skills.getExperience(Skill.MAGIC);
  130.             if (getTabs().getOpen().equals(Tab.MAGIC)) {
  131.                 magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
  132.                 sleep(random(250,750));
  133.             }
  134.             inventory.interact("Cast", "Yew longbow");
  135.             new ConditionalSleep(5000) {
  136.                 @Override
  137.                 public boolean condition() throws InterruptedException {
  138.                     long magicNew = skills.getExperience(Skill.MAGIC);
  139.                     long magicOld = 0;
  140.                     if ((magicNew != magicOld) || (alchWarn != null && alchWarn.isVisible()) && getTabs().getOpen().equals(Tab.MAGIC)) {
  141.                         return true;
  142.                     }
  143.                     return false;
  144.                 }
  145.             }.sleep();
  146.             new ConditionalSleep(5000) {
  147.                 @Override
  148.                 public boolean condition() throws InterruptedException {
  149.                     if (getTabs().getOpen().equals(Tab.MAGIC)) {
  150.                         return true;
  151.                     }
  152.                     return false;
  153.                 }
  154.             }.sleep();
  155.             if (alchWarn != null && alchWarn.isVisible()) {
  156.                 break;
  157.             }
  158.             if(getInventory().contains("Yew longbow") && getInventory().contains("Nature rune")) {
  159.                 sleep(random(250,750));
  160.                 magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
  161.             }
  162.             else {
  163.                 break;
  164.             }
  165.         }
  166.         return 0;
  167.     } // EoL
  168.    
  169.    
  170.        
  171.     @Override
  172.     public void onExit() {
  173.    
  174.     }
  175.  
  176.     @Override
  177.     public void onPaint(Graphics2D g) {
  178.  
  179.     }
  180.  
  181. }
Add Comment
Please, Sign In to add comment