Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.awt.Graphics;
  2. import java.util.Map;
  3. import java.util.Random;
  4.  
  5. import org.rsbot.event.listeners.PaintListener;
  6.  
  7. import org.rsbot.script.ScriptManifest;
  8. import org.rsbot.script.Script;
  9. import org.rsbot.script.methods.Game;
  10.  
  11. import org.rsbot.script.wrappers.RSObject;
  12. import org.rsbot.script.wrappers.RSTile;
  13. import org.rsbot.script.wrappers.RSArea;
  14.  
  15. @ScriptManifest(authors = { "Juuna_" }, keywords = { "chopper" }, name = "VarrockWestOakChopper", version = 1.0, description = "Chops and banks oak logs at Varrock west")
  16. public class VWOakChopper extends Script implements PaintListener {
  17.  
  18.     private AntiBan antiBan;
  19.     private boolean isActive;
  20.     private boolean isPaused;
  21.         class AntiBan extends Thread {
  22.                   private VWOakChopper parent;
  23.         private Random randomGenerator;
  24.    
  25.     private int[] tabs = {Game.TAB_ATTACK, Game.TAB_CLAN, Game.TAB_EQUIPMENT, Game.TAB_MAGIC};
  26.  
  27.                   AntiBan(VWOakChopper parent) {
  28.              this.parent = parent;
  29.         this.randomGenerator = new Random();
  30.          }
  31.                   @Override
  32.          public void run() {
  33.              try {
  34.                  while(parent.isActive) {
  35.                     if(!parent.isPaused) {
  36.             int rand = randomGenerator.nextInt(6);
  37.                         switch(rand) {
  38.                              case 0:
  39.                                   parent.game.openTab(Game.TAB_INVENTORY);
  40.                                  break;
  41.                              case 1:
  42.                                   parent.mouse.moveSlightly();
  43.                                  parent.game.openTab(tabs[randomGenerator.nextInt(tabs.length)]);
  44.                                  break;
  45.                              case 2:
  46.                                  parent.mouse.moveSlightly();
  47.                                  break;
  48.                              case 3:
  49.                                   parent.camera.moveRandomly(800);
  50.                                  break;
  51.                              case 4:
  52.                                  // do something
  53.                                  break;
  54.                              case 5:
  55.                                  // do something
  56.                                  break;
  57.                              default:
  58.                                  break;
  59.                          }
  60.                      }
  61.  
  62.                                     sleep(parent.random(2000, 5000));
  63.  
  64.                  }
  65.              }        
  66.              catch(InterruptedException e) {
  67.                   log(e.getMessage());
  68.              }
  69.          }
  70.      }
  71.  
  72.     private int oakTree = 1281;
  73.     private int[] hatchet = {1351, 1349, 1361, 1355, 1357, 1359};
  74.    
  75.     private RSTile[] walkingPath = {new RSTile(3166, 3420), new RSTile(3178, 3429), new RSTile(3184, 3436)};
  76.    
  77.     private RSArea bankArea = new RSArea (new RSTile(3182, 3436), new RSTile(3189, 3438));
  78.     private RSArea oakArea = new RSArea (new RSTile(3170, 3423), new RSTile(3162, 3412));
  79.    
  80.    
  81.  
  82.    
  83.     @Override
  84.     public boolean onStart(Map<String, String> map){
  85.         this.antiBan.start();
  86.     log("This is my first script");
  87.         mouse.setSpeed(random(5, 7));
  88.                 return true;
  89.     }
  90.  
  91.     @Override
  92.  
  93.     public int loop(){
  94.         if(inventory.isFull()){
  95.             if(bankArea.contains(getMyPlayer().getLocation())){
  96.                 if(!bank.isOpen()){
  97.                     bank.open();
  98.                     return random(500, 700);
  99.                 }
  100.                 bank.depositAllExcept(hatchet);
  101.                 if(bank.isOpen()){
  102.                     bank.close();
  103.                     return random(500, 700);
  104.             }
  105.             }else{
  106.                 if(walking.getDestination() == null || calc.distanceTo(walking.getDestination()) < random(4, 6)){
  107.                     walking.walkPathMM(walkingPath);
  108.                     return random(300, 600);
  109.                 }
  110.             }    
  111.         }else{
  112.             if(oakArea.contains(getMyPlayer().getLocation())){
  113.                 if(getMyPlayer().getAnimation() != 867)
  114.         if(getMyPlayer().getAnimation() != 877)
  115.         if(getMyPlayer().getAnimation() != 879)
  116.         if(getMyPlayer().getAnimation() != 875)
  117.         if(getMyPlayer().getAnimation() != 871)
  118.         if(getMyPlayer().getAnimation() != 877){
  119.                     RSObject tree= objects.getNearest(oakTree);
  120.                     if(tree != null){
  121.                         tree.doAction("Chop");
  122.                         sleep(500, 800);
  123.                     }
  124.                 }
  125.             }else{
  126.                 if(walking.getDestination() == null || calc.distanceTo(walking.getDestination()) < random(4, 6)){
  127.                     walking.walkPathMM(walking.reversePath(walkingPath));
  128.                     return random(300, 600);
  129.                 }
  130.             }
  131.  
  132.         }
  133.         return random(100, 200);
  134.  
  135.     }   @Override
  136.     public void onRepaint(Graphics render) {
  137.               }
  138.  } 
  139.  
  140.     public void onFinish(){
  141.         log("Thanks for testing! TacticalNuke is happy :D");
  142.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement