Advertisement
Rudie221

MultiChopper V1.0!

Mar 17th, 2012
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 27.61 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import java.io.IOException;
  4. import java.net.URL;
  5. import java.util.LinkedList;
  6.  
  7. import javax.imageio.ImageIO;
  8. import javax.swing.*;
  9.  
  10. import com.rarebot.event.events.MessageEvent;
  11. import com.rarebot.event.listeners.MessageListener;
  12. import com.rarebot.event.listeners.PaintListener;
  13. import com.rarebot.script.Script;
  14. import com.rarebot.script.ScriptManifest;
  15. import com.rarebot.script.methods.Game.Tab;
  16. import com.rarebot.script.methods.Skills;
  17. import com.rarebot.script.wrappers.RSComponent;
  18. import com.rarebot.script.wrappers.RSNPC;
  19. import com.rarebot.script.wrappers.RSObject;
  20. import com.rarebot.script.wrappers.RSTile;
  21. import com.rarebot.script.wrappers.RSWeb;
  22.  
  23. @ScriptManifest(
  24.         authors = {"Rudie"},
  25.         version = 1.0,
  26.         keywords = ("chopper, woodcutting, wc, worldchopper, rudie"),
  27.         description = "Chops and banks logs at different locations more info is in the thread",
  28.         name = "MultiChopper"
  29. )
  30. public class MultiChopper extends Script implements PaintListener, MessageListener, MouseListener {
  31.    
  32.     RSTile Fallytile = new RSTile(3013, 3356, 0);
  33.     RSTile Draynortile = new RSTile(3092, 3243, 0);
  34.     RSTile DraynorChoptile = new RSTile(3086, 3233, 0);
  35.     RSTile GEtile = new RSTile(3180, 3501, 0);
  36.     RSTile GEChoptile = new RSTile(3215, 3502, 0);
  37.     RSTile Camtile = new RSTile(2726, 3491, 0);
  38.     RSTile CamChoptile = new RSTile(2727, 3500, 0);
  39.     RSTile Cattile = new RSTile(2808, 3440, 0);
  40.     RSTile CatChoptile = new RSTile(2767, 3430, 0);
  41.     RSTile FallyChoptile = new RSTile(3045, 3322, 0);
  42.     RSTile RimmyChoptile = new RSTile(2970, 3193, 0);
  43.    
  44.     private final static int[] yew_ID = {38755, 1309};
  45.     private final static int[] maple_ID = {1307};
  46.     private final static int[] oak_ID = {38731};
  47.     private final static int[] regular_ID = {38784, 38785, 38786, 38787, 1278, 1276};
  48.     private final static int[] ivy_ID = {46324, 46322, 46318, 46322, 46320};
  49.     private final static int[] willow_ID = {38616, 38627, 58006, 2210};
  50.     private final static int[] hatchetID = {1349, 1351, 1353, 1355, 1357, 1359, 1361, 6739};
  51.     private final static int[] boothID = {11758, 2012, 2019, 25808, 2213};
  52.     private final static int[] bnpcID = {3293};
  53.    
  54.     private static final int yew_LOG = 1515;
  55.     private static final int maple_LOG = 1517;
  56.     private static final int oak_LOG = 1521;
  57.     private static final int regular_LOG = 1511;
  58.     private static final int willow_LOG = 1519;
  59.    
  60.     private int[] logsToChop;
  61.     public int logID = 0;
  62.    
  63.     long startTime;
  64.     private String Status = "Loading...";
  65.    
  66.    private static final Color MOUSE_COLOR = new Color(255, 0, 0),
  67.     MOUSE_BORDER_COLOR = new Color(255, 0, 0),
  68.     MOUSE_CENTER_COLOR = new Color(0, 0, 0);
  69.     private boolean pressed = false;
  70.          
  71.    int expGained = 0;
  72.    int startExp = 0;
  73.    int logsChopped = 0;
  74.    int nestsFound = 0;
  75.    int gainedLvl = 0;
  76.    public boolean showPaint = true ;
  77.    Point p;
  78.    Point p2;
  79.    private final LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>();
  80.    
  81.     MultiChopperGUI g;
  82.    
  83.     private boolean guiWait = true;
  84.     public boolean powerchop = false;
  85.     public boolean fallytile = false;
  86.     public boolean fallybanktile = false;
  87.     public boolean rimmytile = false;
  88.     public boolean draynortile = false;
  89.     public boolean getile = false;
  90.     public boolean camtile = false;
  91.     public boolean cattile = false;
  92.    
  93.     public boolean onStart() {
  94.         startTime = System.currentTimeMillis();
  95.         mouse.setSpeed(random(3, 5));
  96.         startExp = skills.getCurrentExp(Skills.WOODCUTTING);
  97.         log(new Color (30, 144, 255), "Welcome to MultiChopper V 1.0!");
  98.         log(Color.RED, "PLEASE READ:");
  99.         log(new Color (30, 144, 255), "Please check the thread every day for new updates.");
  100.         log(new Color (30, 144, 255), "V 1.0 has been released 17-3-2012.");
  101.         log(new Color (30, 144, 255), "MultiChopper ®   © 2012 ");
  102.         log(Color.RED, "Happy botting!");
  103.        
  104.         try {
  105.             SwingUtilities.invokeAndWait(new Runnable() {
  106.  
  107.                 public void run() {
  108.                     g = new MultiChopperGUI();
  109.                     g.setVisible(true);
  110.                 }
  111.             });
  112.         } catch (Throwable e) {
  113.             log("Fail.");
  114.         }
  115.        
  116.         while(guiWait) sleep(500);
  117.        
  118.         return true;
  119.     }
  120.  
  121.     @Override
  122.     public int loop() {
  123.         if(inventory.isFull() && powerchop == true) {
  124.             inventory.dropAllExcept(hatchetID);
  125.             Status = "Dropping logs.";
  126.         } else if(inventory.isFull() && powerchop == false) {
  127.             if(atBank() || atNPCBank()) {
  128.                 doBank();
  129.                 doNPCBank();
  130.                 } else {
  131.                 toFally();
  132.                 toDraynor();
  133.                 toGE();
  134.                 toCam();
  135.                 toCat();
  136.                 AntiBanCamera();
  137.             }
  138.     } else if(atTree()) {
  139.             chopLogs();
  140.             AntiBan();
  141.             AntiBanCamera();
  142.         } else {
  143.             toFallyChop();
  144.             toRimmyChop();
  145.             toDraynorChop();
  146.             toGEChop();
  147.             toCamChop();
  148.             toCatChop();
  149.             AntiBanCamera();
  150.         }
  151.         return random(600, 800);
  152.     }
  153.    
  154.    
  155.     private boolean atTree() {
  156.         RSObject tree = objects.getNearest(logsToChop);
  157.         if(tree != null) {
  158.             if(tree.isOnScreen()) {
  159.                 return true;
  160.             }
  161.         }
  162.         return false;
  163. }
  164.    
  165.     private void chopLogs() {
  166.         RSObject tree = objects.getNearest(logsToChop);
  167.         if (tree != null && getMyPlayer().getAnimation() == -1) {
  168.             tree.interact("Chop");
  169.             Status = "Cutting tree.";
  170.         }
  171.     }
  172.    
  173.     private void toFally() {
  174.         if (inventory.isFull() && fallybanktile == true) {
  175.             RSWeb walkWeb = web.getWeb(Fallytile);
  176.             if (walkWeb != null && !walkWeb.finished()) {
  177.                 walkWeb.step();
  178.                 Status = "Walking to bank.";
  179.             } else if (walkWeb == null) {
  180.                 walkWeb = web.getWeb(Fallytile);
  181.             }} }  
  182.    
  183.     private void toFallyChop() {
  184.         if (!inventory.isFull() && fallytile == true) {
  185.             RSWeb walkWeb = web.getWeb(FallyChoptile);
  186.             if (walkWeb != null && !walkWeb.finished()) {
  187.                 walkWeb.step();
  188.                 Status = "Walking to tree(s).";
  189.             } else if (walkWeb == null) {
  190.                 walkWeb = web.getWeb(FallyChoptile);
  191.             }} }  
  192.    
  193.     private void toDraynor() {
  194.         if (inventory.isFull() && draynortile == true) {
  195.             RSWeb walkWeb = web.getWeb(Draynortile);
  196.             if (walkWeb != null && !walkWeb.finished()) {
  197.                 walkWeb.step();
  198.                 Status = "Walking to bank.";
  199.             } else if (walkWeb == null) {
  200.                 walkWeb = web.getWeb(Draynortile);
  201.             }} }  
  202.    
  203.     private void toDraynorChop() {
  204.         if (!inventory.isFull() && draynortile == true) {
  205.             RSWeb walkWeb = web.getWeb(DraynorChoptile);
  206.             if (walkWeb != null && !walkWeb.finished()) {
  207.                 walkWeb.step();
  208.                 Status = "Walking to tree(s).";
  209.             } else if (walkWeb == null) {
  210.                 walkWeb = web.getWeb(DraynorChoptile);
  211.             }} }  
  212.    
  213.     private void toGE() {
  214.         if (inventory.isFull() && getile == true) {
  215.             RSWeb walkWeb = web.getWeb(GEtile);
  216.             if (walkWeb != null && !walkWeb.finished()) {
  217.                 walkWeb.step();
  218.                 Status = "Walking to bank.";
  219.             } else if (walkWeb == null) {
  220.                 walkWeb = web.getWeb(GEtile);
  221.             }} }  
  222.    
  223.     private void toGEChop() {
  224.         if (!inventory.isFull() && getile == true) {
  225.             RSWeb walkWeb = web.getWeb(GEChoptile);
  226.             if (walkWeb != null && !walkWeb.finished()) {
  227.                 walkWeb.step();
  228.                 Status = "Walking to tree(s).";
  229.             } else if (walkWeb == null) {
  230.                 walkWeb = web.getWeb(GEChoptile);
  231.             }} }
  232.    
  233.     private void toCam() {
  234.         if (inventory.isFull() && camtile == true) {
  235.             RSWeb walkWeb = web.getWeb(Camtile);
  236.             if (walkWeb != null && !walkWeb.finished()) {
  237.                 walkWeb.step();
  238.                 Status = "Walking to bank.";
  239.             } else if (walkWeb == null) {
  240.                 walkWeb = web.getWeb(Camtile);
  241.             }} }  
  242.    
  243.     private void toCamChop() {
  244.         if (!inventory.isFull() && camtile == true) {
  245.             RSWeb walkWeb = web.getWeb(CamChoptile);
  246.             if (walkWeb != null && !walkWeb.finished()) {
  247.                 walkWeb.step();
  248.                 Status = "Walking to tree(s).";
  249.             } else if (walkWeb == null) {
  250.                 walkWeb = web.getWeb(CamChoptile);
  251.             }} }
  252.    
  253.     private void toCat() {
  254.         if (inventory.isFull() && cattile == true) {
  255.             RSWeb walkWeb = web.getWeb(Cattile);
  256.             if (walkWeb != null && !walkWeb.finished()) {
  257.                 walkWeb.step();
  258.                 Status = "Walking to bank.";
  259.             } else if (walkWeb == null) {
  260.                 walkWeb = web.getWeb(Cattile);
  261.             }} }  
  262.    
  263.     private void toCatChop() {
  264.         if (!inventory.isFull() && cattile == true) {
  265.             RSWeb walkWeb = web.getWeb(CatChoptile);
  266.             if (walkWeb != null && !walkWeb.finished()) {
  267.                 walkWeb.step();
  268.                 Status = "Walking to tree(s).";
  269.             } else if (walkWeb == null) {
  270.                 walkWeb = web.getWeb(CatChoptile);
  271.             }} }
  272.    
  273.     private void toRimmyChop() {
  274.         if (!inventory.isFull() && rimmytile == true) {
  275.             RSWeb walkWeb = web.getWeb(RimmyChoptile);
  276.             if (walkWeb != null && !walkWeb.finished()) {
  277.                 walkWeb.step();
  278.                 Status = "Walking to tree(s).";
  279.             } else if (walkWeb == null) {
  280.                 walkWeb = web.getWeb(RimmyChoptile);
  281.             }} }
  282.    
  283.     private void doBank() {
  284.         if(bank.isOpen()) {
  285.             bank.depositAllExcept(hatchetID);
  286.             Status = "Banking.";
  287.             sleep(800, 1200);
  288.         } else {
  289.             bank.open();
  290.             Status = "Banking.";
  291.             sleep(1800, 2200);
  292.         }
  293.     }
  294.    
  295.     private boolean atBank() {
  296.         RSObject bank = objects.getNearest(boothID);
  297.         if(bank != null) {
  298.             if(bank.isOnScreen()) {
  299.                 return true;
  300.             }
  301.         }
  302.         return false;
  303.     }
  304.    
  305.     private void doNPCBank() {
  306.         if(bank.isOpen()) {
  307.             bank.depositAllExcept(hatchetID);
  308.             Status = "Banking.";
  309.             sleep(800, 1200);
  310.         } else {
  311.             bank.open();
  312.             Status = "Banking.";
  313.             sleep(1800, 2200);
  314.         }
  315.     }
  316.    
  317.     private boolean atNPCBank() {
  318.         RSNPC bank = npcs.getNearest(bnpcID);
  319.         if(bank != null) {
  320.             if(bank.isOnScreen()) {
  321.                 return true;
  322.             }
  323.         }
  324.         return false;
  325.     }
  326.    
  327.    
  328.    
  329.     public void onFinish() {
  330.         log(new Color (30, 144, 255), "Ty for using MultiChopper by Rudie.");
  331.         env.saveScreenshot(true);
  332.     }
  333.    
  334.     public void mouseClicked(MouseEvent e) {
  335.         RSComponent inter = interfaces.get(137).getComponent(176);
  336.         if (inter.getArea().contains(e.getPoint())) {
  337.             showPaint = !showPaint;
  338.         }
  339.     }
  340.    
  341.     private void drawMouse(Graphics g) {
  342.         ((Graphics2D) g).setRenderingHints(new RenderingHints(
  343.                 RenderingHints.KEY_ANTIALIASING,
  344.                 RenderingHints.VALUE_ANTIALIAS_ON));
  345.         Point p = mouse.getLocation();
  346.         Graphics2D spinG = (Graphics2D) g.create();
  347.         Graphics2D spinGRev = (Graphics2D) g.create();
  348.         Graphics2D spinG2 = (Graphics2D) g.create();
  349.         spinG.setColor(MOUSE_BORDER_COLOR);
  350.         spinGRev.setColor(MOUSE_COLOR);
  351.         spinG.rotate(System.currentTimeMillis() % 2000d / 2000d * (360d) * 2
  352.                 * Math.PI / 180.0, p.x, p.y);
  353.         spinGRev.rotate(System.currentTimeMillis() % 2000d / 2000d * (-360d)
  354.                 * 2 * Math.PI / 180.0, p.x, p.y);
  355.         final int outerSize = 20;
  356.         final int innerSize = 12;
  357.         spinG.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
  358.                 BasicStroke.JOIN_ROUND));
  359.         spinGRev.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
  360.                 BasicStroke.JOIN_ROUND));
  361.         spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
  362.                 outerSize, 100, 75);
  363.         spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
  364.                 outerSize, -100, 75);
  365.         spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
  366.                 innerSize, innerSize, 100, 75);
  367.         spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
  368.                 innerSize, innerSize, -100, 75);
  369.         g.setColor(MOUSE_CENTER_COLOR);
  370.         g.fillOval(p.x, p.y, 2, 2);
  371.         spinG2.setColor(MOUSE_CENTER_COLOR);
  372.         spinG2.rotate(System.currentTimeMillis() % 2000d / 2000d * 360d
  373.                 * Math.PI / 180.0, p.x, p.y);
  374.         spinG2.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
  375.                 BasicStroke.JOIN_ROUND));
  376.         spinG2.drawLine(p.x - 5, p.y, p.x + 5, p.y);
  377.         spinG2.drawLine(p.x, p.y - 5, p.x, p.y + 5);
  378.     }
  379.    
  380.     @SuppressWarnings("serial")
  381.     private class MousePathPoint extends Point { // credits to Enfilade
  382.         private int toColor(double d) {
  383.             return Math.min(255, Math.max(0, (int) d));
  384.         }
  385.  
  386.         private long finishTime;
  387.         private double lastingTime;
  388.  
  389.         public MousePathPoint(int x, int y, int lastingTime) {
  390.             super(x, y);
  391.             this.lastingTime = lastingTime;
  392.             finishTime = System.currentTimeMillis() + lastingTime;
  393.         }
  394.  
  395.         public boolean isUp() {
  396.             return System.currentTimeMillis() > finishTime;
  397.         }
  398.  
  399.         public Color getColor() {
  400.             return new Color(
  401.                     0,
  402.                     0,
  403.                     0,
  404.                     toColor(256 * ((finishTime - System.currentTimeMillis()) / lastingTime)));
  405.         }
  406.     }
  407.  
  408. private final RenderingHints antialiasing = new RenderingHints(
  409.             RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  410.    
  411.    
  412.     ////////////
  413.     ///Paint///
  414.     //////////
  415.     private Image getImage(String url) {
  416.         try {
  417.             return ImageIO.read(new URL(url));
  418.         } catch(IOException e) {
  419.             return null;
  420.         }
  421.     }
  422.  
  423.     private final Color color1 = new Color(51, 51, 51);
  424.     private final Color color2 = new Color(255, 0, 0);
  425.     private final Color color3 = new Color(255, 255, 255);
  426.     private final Color color4 = new Color(0, 0, 0);
  427.  
  428.     private final BasicStroke stroke1 = new BasicStroke(1);
  429.  
  430.     private final Font font1 = new Font("Comic Sans MS", 2, 15);
  431.     private final Font font2 = new Font("Comic Sans MS", 0, 32);
  432.     private final Font font3 = new Font("Arial", 3, 15);
  433.     private final Font font4 = new Font("Arial", 0, 13);
  434.  
  435.     private final Image img1 = getImage("http://images1.wikia.nocookie.net/__cb20111205044534/runescape/images/thumb/e/e9/Willow_pyre_logs_detail.png/100px-Willow_pyre_logs_detail.png");
  436.     private final Image logo = getImage("http://i43.tinypic.com/1zcfoy1.png");
  437.    
  438.     @Override
  439.     public void onRepaint(Graphics g) {
  440.         drawModel(g, objects.getNearest(logsToChop), Color.RED, "Tree", Color.WHITE);
  441.         drawModel(g, objects.getNearest(boothID), Color.BLUE, "Bank Booth", Color.WHITE);
  442.        
  443.        
  444.  
  445.        
  446. expGained = skills.getCurrentExp(Skills.WOODCUTTING) - startExp;
  447.        
  448.         long millis = System.currentTimeMillis() - startTime;
  449.         long hours = millis / (1000 * 60 * 60);
  450.         millis -= hours * (1000 * 60 * 60);
  451.         long minutes = millis / (1000 * 60);
  452.         millis -= minutes * (1000 * 60);
  453.         long seconds = millis / 1000;
  454.        
  455.         float xpsec = 0;
  456.         if((minutes > 0 || hours > 0 || seconds > 0)&& expGained > 0) {
  457.             xpsec = ((float) expGained)/(float)(seconds + (minutes*60) + (hours*60*60));
  458.         }
  459.         float xpmin = xpsec * 60;
  460.         float xphour = xpmin * 60;
  461.        
  462.         float oresec = 0;
  463.         if((minutes > 0 || hours > 0 || seconds > 0)&& logsChopped > 0) {
  464.             oresec = ((float) logsChopped)/(float)(seconds + (minutes*60) + (hours*60*60));
  465.         }
  466.         float oremin = oresec * 60;
  467.         float orehour = oremin * 60;
  468.            
  469.         Graphics2D g1 = (Graphics2D)g;
  470.         g1.setColor(color4);
  471.         g1.fillRect(396, 459, 98, 12);
  472.         g1.setColor(color2);
  473.         g1.drawRect(396, 459, 98, 12);
  474.         g1.setColor(color3);
  475.         g1.setFont(font4);
  476.         g1.drawString("Hide/Show Paint.", 396, 470);
  477.         drawMouse(g1);
  478.        
  479.         Point p = mouse.getLocation();
  480.         while (!mousePath.isEmpty() && mousePath.peek().isUp())
  481.             mousePath.remove();
  482.         Point clientCursor = mouse.getLocation();
  483.         MousePathPoint mpp = new MousePathPoint(clientCursor.x,
  484.                 clientCursor.y, 3000);
  485.         if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
  486.             mousePath.add(mpp);
  487.         MousePathPoint lastPoint = null;
  488.         for (MousePathPoint a : mousePath) {
  489.             if (lastPoint != null) {
  490.                 g1.setColor(a.getColor());
  491.                 g1.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
  492.             }
  493.             lastPoint = a;
  494.         }
  495.     g1.fillRect(p.x - 5, p.y, 12, 2);
  496.     g1.fillRect(p.x, p.y - 5, 2, 12);
  497.         if(showPaint){
  498.         g1.setColor(color1);
  499.         g1.fillRoundRect(8, 345, 488, 112, 16, 16);
  500.         g1.setColor(color2);
  501.         g1.setStroke(stroke1);
  502.         g1.drawRoundRect(8, 345, 488, 112, 16, 16);
  503.         g1.drawLine(7, 362, 494, 362);
  504.         g1.drawImage(img1, 375, 360, null);
  505.         g1.setFont(font1);
  506.         g1.setColor(color3);
  507.         g1.setFont(font2);
  508.         g1.setColor(color2);
  509.         g1.drawImage(logo, -60, 210, null);
  510.         g1.setFont(font3);
  511.         g1.setColor(color3);
  512.         g1.drawString("Status: " + Status, 12, 361);
  513.         g1.drawString("RunTime: "  + hours + ":" + minutes + ":" + seconds, 17, 390);
  514.         g1.drawString("Current Lvl: " + skills.getCurrentLevel(Skills.WOODCUTTING), 17, 405);
  515.         g1.drawString("Lvl's Gained: " + gainedLvl, 17, 420);
  516.         g1.drawString("XP/TNL: " + skills.getExpToNextLevel(Skills.WOODCUTTING), 17, 435);
  517.         g1.drawString("Logs Chopped: " + logsChopped, 250, 390);
  518.         g1.drawString("Logs/H: " + (int) orehour, 250, 405);
  519.         g1.setColor(color4);
  520.         g1.fillRect(8, 459, 98, 12);
  521.         g1.setColor(color2);
  522.         g1.drawRect(8, 459, 98, 12);
  523.         g1.setColor(color4);
  524.         g1.fillRect(396, 459, 98, 12);
  525.         g1.setColor(color2);
  526.         g1.drawRect(396, 459, 98, 12);
  527.         g1.setColor(color3);
  528.         g1.drawString("XP/H: " + (int) xphour, 250, 435);
  529.         g1.drawString("By: Rudie!", 250, 450);
  530.         g1.drawString("%/TNL: " + skills.getPercentToNextLevel(Skills.WOODCUTTING) + "%", 17, 450);
  531.         g1.drawString("XP Gained: " + expGained, 250, 420);
  532.         g1.setFont(font4);
  533.         g1.drawString("Hide/Show Paint.", 396, 470);
  534.     }
  535.     }
  536.  
  537.     public void drawModel(Graphics g, RSObject o, Color c, String s, Color tc)  {
  538.         if(o != null) {
  539.             Polygon[] model = o.getModel().getTriangles();
  540.                     Point point = calc.tileToScreen(o.getLocation());
  541.             for(Polygon p : model)  {
  542.                 g.setColor(c);
  543.                 g.fillPolygon(p);
  544.                             g.setColor(c.darker());
  545.                 g.drawPolygon(p);
  546.             }
  547.  
  548.             g.setColor(tc);
  549.             g.drawString(s, point.x - 75, point.y - 35);
  550.             }
  551.             }
  552.             public RSTile[] reversePath(RSTile[] other) {
  553.                     RSTile[] t = new RSTile[other.length];
  554.                     for (int i = 0; i < t.length; i++) {
  555.                             t[i] = other[other.length - i - 1];
  556.                     }
  557.                     return t;
  558.             }
  559.            
  560.             @Override
  561.             public void mouseEntered(MouseEvent e) {
  562.                 // TODO Auto-generated method stub
  563.                
  564.             }
  565.  
  566.             @Override
  567.             public void mouseExited(MouseEvent e) {
  568.                 // TODO Auto-generated method stub
  569.                
  570.             }
  571.  
  572.             @Override
  573.             public void mousePressed(MouseEvent e) {
  574.                 // TODO Auto-generated method stub
  575.                
  576.             }
  577.  
  578.             @Override
  579.             public void mouseReleased(MouseEvent e) {
  580.                 // TODO Auto-generated method stub
  581.                
  582.             }
  583.  
  584.  
  585.         @Override
  586.     public void messageReceived(MessageEvent e) {
  587.         String txt = e.getMessage().toLowerCase();
  588.         if(txt.contains("get some") || txt.contains("chop away some"))  {
  589.             logsChopped++;
  590.         }
  591.         if(txt.contains("nest falls")) {
  592.             nestsFound++;
  593.         }
  594.         if(txt.contains("woodcutting level")) {
  595.             gainedLvl++;
  596.         }
  597.     }
  598.        
  599.         //////////////
  600.         ///AntiBan///
  601.         ////////////
  602.       @SuppressWarnings("deprecation")
  603.     private void AntiBan() {
  604.             int randomProd = random(1, 60);
  605.             if (randomProd == 1) {
  606.               int randomMore = random(1, 5);
  607.               if (randomMore == 1) {
  608.                 if (game.getCurrentTab() != 2) {
  609.                   game.openTab(Tab.STATS);
  610.                   Status = "Checking WC XP + Level.";
  611.                   sleep(350, 500);
  612.                   skills.doHover(Skills.WOODCUTTING);
  613.                   sleep(2000, 3500);
  614.                 } else {
  615.                   mouse.move(random(678, 728), random(213, 232));
  616.                   sleep(2000, 3500);
  617.                 }
  618.               } else {
  619.                 sleep(1200, 2500);
  620.               }
  621.             }
  622.             if (randomProd == 2 || randomProd == 3 || randomProd == 4) {
  623.               sleep(1000, 2500);
  624.             }
  625.             if (randomProd >= 52) {
  626.               mouse.moveRandomly(65, 350);
  627.             } else
  628.               sleep(10, 30);
  629.           }
  630.  
  631.           private void AntiBanCamera() {
  632.             int randomNum = random(1, 50);
  633.             if (randomNum == 1 || randomNum == 2 || randomNum == 3) {
  634.               camera.moveRandomly(random(2000, 3300));
  635.             }
  636.             if (randomNum == 4 || randomNum == 5) {
  637.               camera.setAngle(random(10, 40));
  638.             }
  639.             if (randomNum == 6) {
  640.               camera.setPitch(random(40, 68));
  641.             }
  642.             if (randomNum == 7) {
  643.               camera.setPitch(random(20, 45));
  644.             }
  645.             if (randomNum == 8) {
  646.               camera.setPitch(random(68, 90));
  647.             } else
  648.               sleep(50, 70);
  649.           }
  650.    
  651.       class MultiChopperGUI extends JFrame {
  652.             /**
  653.          *
  654.          */
  655.         private static final long serialVersionUID = 1L;
  656.             public MultiChopperGUI() {
  657.                 initComponents();
  658.             }
  659.            
  660.         private void StartActionPerformed(ActionEvent e) {
  661.             String chosen = Tree.getSelectedItem().toString();
  662.             if(chosen.equals("Yew")) {
  663.                 logID = yew_LOG;
  664.                 logsToChop = yew_ID;
  665.             } else if(chosen.equals("Oak")) {
  666.                 logID = oak_LOG;
  667.                 logsToChop = oak_ID;
  668.             } else if(chosen.equals("Regular")) {
  669.                 logID = regular_LOG;
  670.                 logsToChop = regular_ID;
  671.             } else if(chosen.equals("Ivy")) {
  672.                 logsToChop = ivy_ID;
  673.             } else if(chosen.equals("Willow")) {
  674.                 logID = willow_LOG;
  675.                 logsToChop = willow_ID;
  676.             } else if(chosen.equals("Maple")) {
  677.                 logID = maple_LOG;
  678.                 logsToChop = maple_ID;
  679.                 }
  680.             guiWait = false;
  681.             g.dispose();
  682.         }
  683.  
  684.         private void ExitActionPerformed(ActionEvent e) {
  685.             stopScript(true);
  686.         }
  687.  
  688.         private void checkBox1ActionPerformed(ActionEvent e) {
  689.             powerchop = true;
  690.         }
  691.        
  692.  
  693.         private void LocationActionPerformed(ActionEvent e) {
  694.             String chosen = Location.getSelectedItem().toString();
  695.             if(chosen.equals("Falador. S")) {
  696.                 fallytile = true;
  697.                 fallybanktile = true;
  698.             } else if(chosen.equals("Rimmington")) {
  699.                 rimmytile = true;
  700.                 fallybanktile = true;
  701.             } else if(chosen.equals("Draynor Village")) {
  702.                 draynortile = true;
  703.             } else if(chosen.equals("Varrock Palace. N")) {
  704.                 getile = true;
  705.             } else if(chosen.equals("Varrock Palace N")) {
  706.                 Tree.setSelectedItem("Ivy");
  707.                 Tree.disable();
  708.                 getile = true;
  709.             } else if(chosen.equals("Varrock Palace W")) {
  710.                 Tree.setSelectedItem("Ivy");
  711.                 Tree.disable();
  712.             } else if(chosen.equals("Camelot")) {
  713.                 camtile = true;
  714.                 Tree.setSelectedItem("Maple");
  715.                 Tree.disable();
  716.             } else if(chosen.equals("Catherby")) {
  717.                 cattile = true;
  718.             } else if(chosen.equals("Falador S")) {
  719.                 fallytile = true;
  720.                 Tree.setSelectedItem("Ivy");
  721.                 Tree.disable();
  722.             } else if(chosen.equals("Yanille")) {
  723.                 Tree.setSelectedItem("Ivy");
  724.                 Tree.disable();
  725.             }
  726.         }
  727.  
  728.         private void initComponents() {
  729.             // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
  730.             // Generated using JFormDesigner Evaluation license - Rudie Visser
  731.             Location = new JComboBox();
  732.             label1 = new JLabel();
  733.             label2 = new JLabel();
  734.             Tree = new JComboBox();
  735.             Start = new JButton();
  736.             Exit = new JButton();
  737.             label3 = new JLabel();
  738.             label4 = new JLabel();
  739.             checkBox1 = new JCheckBox();
  740.  
  741.             //======== this ========
  742.             setTitle("MultiChopper GUI");
  743.             Container contentPane = getContentPane();
  744.  
  745.             //---- Location ----
  746.             Location.setModel(new DefaultComboBoxModel(new String[] {
  747.                 "Falador. S",
  748.                 "Rimmington",
  749.                 "Varrock Palace. N",
  750.                 "Draynor Village",
  751.                 "Catherby",
  752.                 "Camelot",
  753.                 "Ivy:",
  754.                 "Yanille",
  755.                 "Falador S",
  756.                 "Varrock Palace N",
  757.                 "Varrock Palace W",
  758.             }));
  759.             Location.addActionListener(new ActionListener() {
  760.                 @Override
  761.                 public void actionPerformed(ActionEvent e) {
  762.                     LocationActionPerformed(e);
  763.                 }
  764.             });
  765.  
  766.             //---- label1 ----
  767.             label1.setText("Choose Location:");
  768.  
  769.             //---- label2 ----
  770.             label2.setText("Choose Tree:");
  771.  
  772.             //---- Tree ----
  773.             Tree.setModel(new DefaultComboBoxModel(new String[] {
  774.                 "Ivy",
  775.                 "Yew",
  776.                 "Maple",
  777.                 "Willow",
  778.                 "Oak",
  779.                 "Regular"
  780.             }));
  781.  
  782.             //---- Start ----
  783.             Start.setText("Start");
  784.             Start.addActionListener(new ActionListener() {
  785.                 @Override
  786.                 public void actionPerformed(ActionEvent e) {
  787.                     StartActionPerformed(e);
  788.                 }
  789.             });
  790.  
  791.             //---- Exit ----
  792.             Exit.setText("Exit");
  793.             Exit.addActionListener(new ActionListener() {
  794.                 @Override
  795.                 public void actionPerformed(ActionEvent e) {
  796.                     ExitActionPerformed(e);
  797.                 }
  798.             });
  799.  
  800.             //---- label3 ----
  801.             label3.setText("Or");
  802.  
  803.             //---- label4 ----
  804.             label4.setText("MultiChopper");
  805.             label4.setFont(new Font("Tekton Pro Ext", Font.PLAIN, 36));
  806.             label4.setForeground(Color.red);
  807.  
  808.             //---- checkBox1 ----
  809.             checkBox1.setText("Powerchop?");
  810.             checkBox1.addActionListener(new ActionListener() {
  811.                 @Override
  812.                 public void actionPerformed(ActionEvent e) {
  813.                     checkBox1ActionPerformed(e);
  814.                 }
  815.             });
  816.  
  817.             GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  818.             contentPane.setLayout(contentPaneLayout);
  819.             contentPaneLayout.setHorizontalGroup(
  820.                 contentPaneLayout.createParallelGroup()
  821.                     .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  822.                         .addContainerGap(132, Short.MAX_VALUE)
  823.                         .addComponent(label1)
  824.                         .addGap(129, 129, 129))
  825.                     .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  826.                         .addGap(87, 87, 87)
  827.                         .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  828.                             .addComponent(Tree, GroupLayout.Alignment.LEADING, 0, 175, Short.MAX_VALUE)
  829.                             .addComponent(Location, GroupLayout.Alignment.LEADING, 0, 175, Short.MAX_VALUE))
  830.                         .addGap(82, 82, 82))
  831.                     .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  832.                         .addContainerGap(148, Short.MAX_VALUE)
  833.                         .addComponent(label2)
  834.                         .addGap(131, 131, 131))
  835.                     .addGroup(contentPaneLayout.createSequentialGroup()
  836.                         .addContainerGap()
  837.                         .addComponent(Start, GroupLayout.PREFERRED_SIZE, 145, GroupLayout.PREFERRED_SIZE)
  838.                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
  839.                         .addComponent(label3)
  840.                         .addGap(18, 18, 18)
  841.                         .addComponent(Exit, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE)
  842.                         .addContainerGap())
  843.                     .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  844.                         .addContainerGap(49, Short.MAX_VALUE)
  845.                         .addComponent(label4)
  846.                         .addGap(37, 37, 37))
  847.                     .addGroup(contentPaneLayout.createSequentialGroup()
  848.                         .addGap(131, 131, 131)
  849.                         .addComponent(checkBox1)
  850.                         .addContainerGap(130, Short.MAX_VALUE))
  851.             );
  852.             contentPaneLayout.setVerticalGroup(
  853.                 contentPaneLayout.createParallelGroup()
  854.                     .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  855.                         .addContainerGap()
  856.                         .addComponent(label4)
  857.                         .addGap(18, 18, 18)
  858.                         .addComponent(label1)
  859.                         .addGap(18, 18, 18)
  860.                         .addComponent(Location, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
  861.                         .addGap(18, 18, 18)
  862.                         .addComponent(label2)
  863.                         .addGap(18, 18, 18)
  864.                         .addComponent(Tree, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  865.                         .addGap(18, 18, 18)
  866.                         .addComponent(checkBox1)
  867.                         .addGap(7, 7, 7)
  868.                         .addGroup(contentPaneLayout.createParallelGroup()
  869.                             .addGroup(contentPaneLayout.createSequentialGroup()
  870.                                 .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  871.                                     .addComponent(Exit, GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
  872.                                     .addComponent(label3))
  873.                                 .addGap(33, 33, 33))
  874.                             .addComponent(Start, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE))
  875.                         .addContainerGap())
  876.             );
  877.             pack();
  878.             setLocationRelativeTo(getOwner());
  879.             // JFormDesigner - End of component initialization  //GEN-END:initComponents
  880.         }
  881.  
  882.         // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
  883.         // Generated using JFormDesigner Evaluation license - Rudie Visser
  884.         private JComboBox Location;
  885.         private JLabel label1;
  886.         private JLabel label2;
  887.         private JComboBox Tree;
  888.         private JButton Start;
  889.         private JButton Exit;
  890.         private JLabel label3;
  891.         private JLabel label4;
  892.         private JCheckBox checkBox1;
  893.         // JFormDesigner - End of variables declaration  //GEN-END:variables
  894.     }
  895. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement