Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
REG 5.35 KB | None | 0 0
  1. import org.rsbot.script.ScriptManifest;
  2. import org.rsbot.script.Script;
  3. import org.rsbot.script.wrappers.RSObject;
  4. import org.rsbot.event.listeners.PaintListener;
  5. import org.rsbot.script.methods.Skills;
  6. import java.awt.*;
  7. import org.rsbot.script.util.Timer;
  8. import javax.imageio.ImageIO;
  9. import java.io.IOException;
  10. import java.net.URL;
  11.  
  12. @ScriptManifest(authors = {"TacticalNuke"}, keywords = {"cutter"}, name = "TacticalNuke Cutter", version = 1.2, description = "Willow Cutter.")
  13. public class TacticalCutter extends Script implements PaintListener {
  14.  
  15.     private int[] willowTree = {5551, 5552, 5553};
  16.     private int runeHatchet = 1359, startLevel, startEXP;
  17.     private long runTime, startTime;
  18.  
  19.     public boolean onStart(){
  20.         log("1 second...");
  21.         if(!game.isLoggedIn()){
  22.             log("Login before starting the script");
  23.             return false;
  24.         }
  25.         if(game.isLoggedIn()){
  26.             startLevel = skills.getCurrentLevel(Skills.getIndex("mining"));
  27.             startEXP = skills.getCurrentExp(Skills.getIndex("mining"));
  28.         }
  29.         mouse.setSpeed(random(4, 7));
  30.         startTime = System.currentTimeMillis();
  31.         return true;
  32.     }
  33. public void antiban() {
  34.         int randomNum = random(1, 40);
  35.         int r = random(1, 45);
  36.         if (randomNum == 3 || randomNum == 6 || randomNum == 9 || randomNum == 23) {
  37.             if (r == 2) {
  38.                 log("ANTIBAN Opening random tab.");
  39.                 game.openTab(random(1, 14));
  40.             }
  41.             if (r == 3) {
  42.                 log("ANTIBAN Moving mouse.");
  43.                 mouse.moveRandomly(50, 300);
  44.             }
  45.             if (r == 4) {
  46.                 log("ANTIBAN Moving mouse.");
  47.                 mouse.moveRandomly(70, 380);
  48.             }
  49.             if (r == 5) {
  50.                 log("ANTIBAN Moving mouse off screen");
  51.                 mouse.moveOffScreen();
  52.             }
  53.             if (r == 6) {
  54.                 log("ANTIBAN Moving mouse off screen");
  55.                 mouse.moveOffScreen();
  56.             }
  57.             if (r == 7) {
  58.                 log("ANTIBAN Turning camera");
  59.                 camera.setAngle(random(100, 120));
  60.             }
  61.             if (r == 8) {
  62.                 log("ANTIBAN Turning camera ");
  63.                 camera.setAngle(random(190, 230));
  64.             }
  65.             if (r == 9) {
  66.                 log("ANTIBAN Turning camera");
  67.                 camera.setAngle(random(150, 180));
  68.             }
  69.             if (r == 10) {
  70.                 log("ANTIBAN Turning camera ");
  71.                 camera.setAngle(random(250, 260));
  72.             }
  73.             if (r == 11) {
  74.                 log("ANTIBAN Checking inventory.");
  75.                 if (game.getCurrentTab() != 4) {
  76.                     game.openTab(4);
  77.                 } else return;
  78.             }
  79.             if (r == 35) {
  80.                 log("ANTIBAN Checking Woodcutting XP.");
  81.                 if (game.getCurrentTab() != 1) {
  82.                     game.openTab(1);
  83.                     sleep(random(500, 700));
  84.                     mouse.move(random(680, 730), random(355, 370));
  85.                     sleep(random(1500, 5000));
  86.                 }
  87.             }
  88.         }
  89.     }
  90.  
  91.     public int loop(){
  92.           antiban();
  93.         if(inventory.isFull()){
  94.             inventory.dropAllExcept(runeHatchet);
  95.         }else{
  96.             if(getMyPlayer().getAnimation() != 867){
  97.                 RSObject tree = objects.getNearest(willowTree);
  98.                 if(tree != null){
  99.                     tree.doAction("Chop");
  100.                     sleep(500, 800);
  101.                    
  102.                 }
  103.             }
  104.         }
  105.         return random(100, 200);
  106.     }
  107.  
  108.     public void onFinish(){
  109.         log("Thanks for testing! TacticalNuke is happy :D");
  110.     }
  111.  
  112.         //START: Code generated using Enfilade's Easel
  113.     private final Color color1 = new Color(0, 153, 153, 163);
  114.     private final Color color2 = new Color(0, 0, 0);
  115.     private final Color color3 = new Color(0, 204, 204, 159);
  116.  
  117.     private final BasicStroke stroke1 = new BasicStroke(1);
  118.  
  119.     private final Font font1 = new Font("Arial", 1, 20);
  120.     private final Font font2 = new Font("Arial", 1, 15);
  121.     private final Font font3 = new Font("Arial", 1, 10);
  122.  
  123.     public void onRepaint(Graphics g1) {
  124.         Graphics2D g = (Graphics2D)g1;
  125.         runTime = System.currentTimeMillis() - startTime;
  126.         g.setColor(color1);
  127.         g.fillRoundRect(550, 210, 183, 111, 16, 16);
  128.         g.setColor(color2);
  129.         g.setStroke(stroke1);
  130.         g.drawRoundRect(550, 210, 183, 111, 16, 16);
  131.         g.setFont(font1);
  132.         g.drawString("TacticalCutter", 575, 230);
  133.         g.setFont(font2);
  134.         g.drawString("Run Time: " + Timer.format(runTime), 556, 258);
  135.         int START_XP = 0;
  136.         int GAINED_XP = skills.getCurrentExp(Skills.WOODCUTTING) - START_XP;
  137.         int WC_LEVEL = skills.getCurrentLevel(Skills.WOODCUTTING);
  138.         int START_LVL = 0;
  139.        if (START_LVL == 0) {
  140.            START_LVL = skills.getRealLevel(Skills.WOODCUTTING);
  141.         g.drawString("Exp Gained:" + GAINED_XP, 555, 278);
  142.         g.setFont(font3);
  143.         g.drawString("v1.2", 699, 313);
  144.         g.drawString("By TacticalNuke", 556, 314);
  145.         g.setColor(color3);
  146.         g.fillOval(552, 11, 153, 148);
  147.         g.setColor(color2);
  148.         g.drawOval(552, 11, 153, 148);
  149.  
  150.         }
  151.     }
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement