Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import org.rsbot.script.ScriptManifest;
  2. import org.rsbot.script.Script;
  3.  
  4. import org.rsbot.script.wrappers.RSObject;
  5. import org.rsbot.script.wrappers.RSTile;
  6. import org.rsbot.script.wrappers.RSArea;
  7. import org.rsbot.script.wrappers.RSTilePath;
  8.  
  9. @ScriptManifest(authors = { "Boterz" }, keywords = { "Auto Yew Chopper Cutter Banking " }, name = "Xx~Yew Cutter~xX", version = 1.0, description = "CATHERBY ONLY! Yew Cutter goes to bank.")
  10. public class XxyewcutterxX extends Script {
  11.  
  12.     private int Yew = 1309;
  13.     private int Hatchet = 1359;
  14.    
  15.     private RSTile[] walkingPath = {
  16.     new RSTile(2770, 3432), new RSTile(2785, 3433),
  17.     new RSTile(2800, 3433), new RSTile(2808, 3441)
  18.     };
  19.     //^yew to bank
  20.     private RSArea bankArea = new RSArea(new RSTile(2807, 3439),new RSTile(2812, 3441));
  21.     private RSArea yewArea = new RSArea(new RSTile(2754, 3423),new RSTile(2774, 3440));
  22.    
  23.     public boolean onStart(){
  24.     mouse.setSpeed(random(4, 7));
  25.    
  26.         return true;
  27.     }
  28.  
  29.     public int loop(){
  30.         if(inventory.isFull()){
  31.             if(bankArea.contains(getMyPlayer().getLoaction())){
  32.             if(!bank.isOpen()){
  33.                 bank.Open();
  34.                     return random(500, 700);
  35.                 }
  36.                 bank.depositAllExept(Hatchet);
  37.                 if(!bank.isOpen()){
  38.                     bank.close();
  39.                     return random (500, 700);
  40.             }
  41.             }else{
  42.                 if(walking.getDestination == null || calc.distanceTo(walking.getDestination()) < random(4, 6)){
  43.                     walking.walkPathMM(walkingPath);
  44.                     return random(500, 700);
  45.                 }
  46.             }
  47.         }else{
  48.             if(yewArea.contains(getMyPlayer().getLocation())){
  49.                 if(getMyPlayer().getAnimation() != 867){
  50.                     RSObject tree = objects.getNearest(Yew);
  51.                     if(tree != null){
  52.                         tree.doAction("Chop");
  53.                         sleep(500, 800);
  54.                     }
  55.                 }
  56.             }else{
  57.                 if(walking.getDestination == null || calc.distanceTo(walking.getDestination()) < random(4, 6)){
  58.                     walking.walkPathMM(walking.reversePath(walkingPath));
  59.                     return random(500, 700);
  60.                 }
  61.             }
  62.         }  
  63.         return random(100, 200);
  64.     }
  65.    
  66.     public void onFinish(){
  67.        
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement