Advertisement
Rudie221

MultiChopper V1.2!

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