Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 14.82 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.awt.Color;
  2.  
  3.  
  4.  
  5.  
  6. import java.awt.Font;
  7. import java.awt.Graphics;
  8. import java.awt.Image;
  9. import java.awt.Point;
  10.  
  11. import java.awt.*;
  12. import java.awt.event.ActionEvent;
  13. import java.awt.event.ActionListener;
  14. import javax.swing.*;
  15.  
  16. import com.quirlion.script.Constants;
  17. import com.quirlion.script.Script;
  18. import com.quirlion.script.types.GroundItem;
  19. import com.quirlion.script.types.Location;
  20. import com.quirlion.script.types.Thing;
  21.  
  22.  
  23. public class AIOIvyChopper extends Script {
  24.        
  25.     public int startingExp;
  26.         public long StartTime;  
  27.         private long RunTime;  
  28.         private long seconds;  
  29.         private long minutes;  
  30.         private long hours;
  31.         int time;
  32.         int progress;
  33.         int currentLevel;
  34.         int levelsGained;
  35.         int lvlUp;
  36.         int expToLevel;
  37.         int xpPerHour;
  38.         int expGained = 0;
  39.         int ivyChopped = 0;
  40.         int ivyPerHour;
  41.         long antiBanCache = -1;
  42.         String place;
  43.         IvyChopperGUI gui;
  44.         public Image pic;
  45.  
  46.         int[] nestIDs = {5070, 5071, 5072, 5073, 5074, 7413};
  47.         int[] ivy = {46320, 46322, 46324};
  48.        
  49.         public void onStart() {
  50.                 gui = new IvyChopperGUI();
  51.                 gui.setVisible(true);
  52.                while(gui.isVisible()){
  53.                    wait(500);
  54.                         log("Initializing AIOIvyChopper, give me a few seconds please! =)");
  55.                         log("Please donate =)");
  56.                         log("newest v. started");
  57.                }
  58.         }
  59.        
  60.         public boolean chop() {
  61.                 input.MOUSE_SPEED = random(4, 6);
  62.                 Thing thing = things.getNearest(ivy);
  63.                 if(thing != null) {
  64.                     Location loc = thing.getAbsLoc();
  65.                     Point p = calculations.worldToScreen(loc.X, loc.Y, 0, 0, (random(-60, -75)));
  66.                     if(!place.equals("Castle Wars - South Wall")) {
  67.                         cam.setAltitude(false);
  68.                     }
  69.                     if(place.equals("Castle Wars - South Wall")) {
  70.                         cam.setAltitude(true);
  71.                     }
  72.                     input.atPoint(p, "Chop Ivy");
  73.                     wait(random(4000, 4550));
  74.                     return true;
  75.                     }
  76.                 if(thing == null) {
  77.                         return false;
  78.                 }
  79.                 return true;
  80.         }
  81.        
  82.         public void handleNest() {
  83.                 GroundItem nest = groundItems.getByID(nestIDs);
  84.                 if (nest != null) {
  85.                         log("Picking up Nest");
  86.                         nest.click();
  87.                 }
  88.         }
  89.                
  90.         /*public int antiban() {
  91.                 if(chop() && place.equals("Varrock Palace - SouthEast Wall")) {
  92.                         cam.rotate(-90 + random(-110, 75));
  93.             return(random(6000, 6500));
  94.          }
  95.                 if(chop() && place.equals("Varrock Palace - North Wall")) {
  96.                         cam.rotate(random(-165, 170));
  97.             return(random(6000, 6500));
  98.          }
  99.                 if(chop() && place.equals("Falador North Wall - North Side")) {
  100.                         cam.rotate(random(-165, 170));
  101.             return(random(6000, 6500));
  102.          }
  103.                 if(chop() && place.equals("Falador North Wall - South Side")) {
  104.                         cam.rotate(random(-15, 15));
  105.             return(random(6000, 6500));
  106.          }
  107.                 if(chop() && place.equals("East Ardougne - East Wall")) {
  108.                         cam.rotate(random(-110, 80));
  109.             return(random(6000, 6500));
  110.          }
  111.                 if(chop() && place.equals("Yanille North Wall - North Side")) {
  112.                         cam.rotate(random(-165, 170));
  113.             return(random(6000, 6500));
  114.          }
  115.                 if(chop() && place.equals("Tavelry - South East")) {
  116.                         cam.rotate(random(-110, 80));
  117.             return(random(6000, 6500));
  118.          }
  119.                 if(chop() && place.equals("Castle Wars - South Wall)")) {
  120.                         cam.rotate(random(-15, 15));
  121.             return(random(6000, 6500));
  122.          }
  123.                 return 500;
  124.         }*/
  125.        
  126.         public int antiban1() {
  127.                 Thing thing = things.getNearest(ivy);
  128.                 Location loc = thing.getAbsLoc();
  129.                 Point p = calculations.worldToScreen(loc.X, loc.Y, 0, 0, (random(-85, -90)));
  130.                 if(random(30, 40) > 35) {
  131.                 tabs.openTab(Constants.TAB_STATS);
  132.                 wait(random(500, 650));
  133.                 input.moveMouse(714, 363 + random(-7, -3));
  134.                 wait(random(7000, 8500));
  135.                 input.moveMouse(p.x, p.y);
  136.                 wait(random(5000, 8500));
  137.                 tabs.openTab(Constants.TAB_INVENTORY);
  138.                 wait(random(6000, 11500));
  139.                 input.moveMouse(p.x, p.y);
  140.                 return(random(1000, 1500));
  141.                 }else {
  142.                         tabs.openTab(Constants.TAB_STATS);
  143.                         wait(random(500, 650));
  144.                         input.moveMouse(694, 410 + random(-7, -3));
  145.                         wait(random(4000, 5550));
  146.                         tabs.openTab(Constants.TAB_INVENTORY);
  147.                         wait(random(1000, 2500));
  148.                         input.moveMouse(p.x, p.y);
  149.                 }
  150.                 return(random(800, 1000));
  151.         }
  152.        
  153.         public int antiban2() {
  154.                 Thing thing = things.getNearest(ivy);
  155.                 Location loc = thing.getAbsLoc();
  156.                 Point p = calculations.worldToScreen(loc.X, loc.Y, 0, 0, (random(-85, -90)));
  157.                 tabs.openTab(Constants.TAB_FRIENDS);
  158.                 input.moveMouse(618, 308 + random(20, 15));
  159.                 wait(random(6500, 8000));
  160.                 tabs.openTab(Constants.TAB_INVENTORY);
  161.                 wait(random(2000, 5500));
  162.                 input.moveMouse(p.x, p.y);
  163.                 return(random(600, 850));
  164.         }
  165.        
  166.         public int loop() {
  167.                 if(players.getCurrent().isMoving()) {
  168.                         return(random(300, 450));
  169.                 }
  170.                 if(antiBanCache<0 || (System.currentTimeMillis()-antiBanCache) > random(180000, 360000)) {
  171.                         if(players.getCurrent().getAnimation() != -1) {
  172.                                 antiBanCache = System.currentTimeMillis();
  173.                                 antiban1();
  174.                         }      
  175.                 }
  176.                
  177.                 if(antiBanCache<0 || (System.currentTimeMillis()-antiBanCache) > random(120000, 480000)) {
  178.                         if(players.getCurrent().getAnimation() != -1) {
  179.                                 antiBanCache = System.currentTimeMillis();
  180.                                 antiban2();
  181.                         }      
  182.                 }
  183.                 //handleNest();
  184.                
  185.  
  186.                 /*if(players.getCurrent().getAnimation() != -1 && place.equals("Varrock Palace - North Wall")) {
  187.                         cam.rotate(180 + random(-15, 15));
  188.             return(random(500, 850));
  189.          }
  190.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Varrock Palace - South East Wall")) {
  191.                         cam.rotate(-90 + random(-15, 15));
  192.             return(random(500, 850));
  193.          }
  194.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Falador North Wall - North Side")) {
  195.                         cam.rotate(180 + random(-15, 15));
  196.             return(random(500, 850));
  197.          }
  198.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Falador North Wall - South Side")) {
  199.                         cam.rotate(0 + random(-15, 15));
  200.             return(random(500, 850));
  201.          }
  202.                 if(players.getCurrent().getAnimation() != -1 && place.equals("East Ardougne - East Wall")) {
  203.                         cam.rotate(90 + random(-15, 15));
  204.             return(random(500, 850));
  205.          }
  206.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Yanille North Wall - North Side")) {
  207.                         cam.rotate(180 + random(-15, 15));
  208.             return(random(500, 850));
  209.          }
  210.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Tavelry - South East")) {
  211.                         cam.rotate(-90 + random(-15, 15));//my biggest script yet.. by far..
  212.             return(random(500, 850));
  213.          }
  214.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Castle Wars - South Wall)")) {
  215.                         cam.rotate(0 + random(-15, 15));
  216.             return(random(500, 850));
  217.          }
  218.                 if(players.getCurrent().getInteracting().equals(ivy)) {
  219.                         wait(random(900, 1200));
  220.                 }*/
  221.                
  222.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Varrock Palace - South East Wall")) {
  223.                         cam.rotate(-90);
  224.             return(random(3000, 3500));
  225.          }
  226.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Varrock Palace - North Wall")) {
  227.                         cam.rotate(random(-165, 170));
  228.             return(random(3000, 3500));
  229.          }
  230.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Falador North Wall - North Side")) {
  231.                         cam.rotate(random(-165, 170));
  232.             return(random(3000, 3500));
  233.          }
  234.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Falador North Wall - South Side")) {
  235.                         cam.rotate(random(-15, 15));
  236.             return(random(3000, 3500));
  237.          }
  238.                 if(players.getCurrent().getAnimation() != -1 && place.equals("East Ardougne - East Wall")) {
  239.                         cam.rotate(random(-110, 80));
  240.             return(random(3000, 3500));
  241.          }
  242.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Yanille North Wall - North Side")) {
  243.                         cam.rotate(random(-165, 170));
  244.             return(random(3000, 3500));
  245.          }
  246.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Tavelry - South East")) {
  247.                         cam.rotate(random(-110, 80));
  248.             return(random(3000, 3500));
  249.          }
  250.                 if(players.getCurrent().getAnimation() != -1 && place.equals("Castle Wars - South Wall)")) {
  251.                         cam.rotate(random(-15, 15));
  252.             return(random(3000, 3500));
  253.          }
  254.                
  255.                 chop();
  256.                
  257.                 return(random(1000, 1200));
  258.         }
  259.                 @Override
  260.                 public void paint(Graphics g) {
  261.                         if(players.getCurrent().isLoggedIn()) {
  262.                          currentLevel = skills.getCurrentSkillLevel(Constants.STAT_WOODCUTTING);
  263.                          progress = (int) skills.getPercentToNextLevel(Constants.STAT_WOODCUTTING);
  264.                          expToLevel = skills.getXPToNextLevel(Constants.STAT_WOODCUTTING);
  265.                          lvlUp = currentLevel + 1;
  266.                          
  267.                          ivyPerHour = (int) (3600000.0 / RunTime * ivyChopped);
  268.                          xpPerHour = (int) (3600000.0 / RunTime * ivyChopped * 352.5);
  269.                          
  270.                          if (StartTime == 0) {        
  271.                                         StartTime = System.currentTimeMillis();      
  272.                                         }      
  273.                                 RunTime = System.currentTimeMillis() - StartTime;    
  274.                                 seconds = RunTime / 1000;    
  275.                                 if (seconds >= 60) {        
  276.                                         minutes = seconds / 60;        
  277.                                         seconds -= minutes * 60;      
  278.                                         }
  279.                                 if (minutes >= 60) {        
  280.                                         hours = minutes / 60;        
  281.                                         minutes -= hours *60;      
  282.                                         }
  283.                                
  284.                                 /*try {
  285.                                       URL imageurl = new URL(
  286.                                           "http://i1039.photobucket.com/albums/a476/powerscript/IvyChoppingpic.png");
  287.                                       pic = Toolkit.getDefaultToolkit().getImage(imageurl);
  288.                                     } catch (Exception e) {
  289.                                       e.printStackTrace();
  290.                                     }      //THIS IS WORKING ONE!!!
  291.                                     g.drawImage(pic, 555, 210, null);*/
  292.                                
  293.                                 /*try {
  294.                                         BufferedImage pic = ImageIO.read(new URL("http://i43.tinypic.com/216jit.png"));
  295.                                 } catch (Exception e) {
  296.                                         e.printStackTrace();
  297.                                         g.drawImage(pic, 558, 457, 175, 250, null);
  298.                        }*/
  299.                                
  300.                                 Point p = input.getBotMousePosition();
  301.                                 g.setColor(Color.RED);
  302.                                 g.drawLine(p.x,1,p.x,1500);
  303.                                 g.drawLine(1,p.y,1500,p.y);
  304.                                
  305.                                 g.setColor(new Color(84, 106, 114, 165));
  306.                         g.fillRoundRect(555, 210, 175, 250, 15, 20);
  307.                         g.setColor(new Color(60, 134, 138, 165));
  308.                         g.drawRoundRect(555, 210, 175, 250, 15, 20);
  309.                
  310.                         g.setColor(new Color(255, 255, 255, 155));
  311.                         g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
  312.                         g.drawString("Ivy Chopper", 610, 236);
  313.                         g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
  314.                         g.drawString("By Powerscript", 604, 255);
  315.                        
  316.                         g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
  317.                         g.setColor(Color.RED);
  318.                         g.drawString("Time Running: " + + hours + ":" + minutes + ":" + seconds, 566, 279);
  319.                         g.drawString("Woodcutting Level: " + currentLevel, 566, 297);
  320.                         g.drawString("Levels Gained: " + levelsGained, 566, 315);
  321.                         g.drawString("Exp Gained: " + expGained, 566, 333);
  322.                         g.drawString("Exp To " + lvlUp + " WC: " + expToLevel, 566, 351);
  323.                         g.drawString("Exp / Hour: " + xpPerHour, 566, 369);
  324.                        
  325.                         g.setColor(Color.LIGHT_GRAY);
  326.                         g.fill3DRect(566, 387, 100, 13, true);
  327.                                
  328.                                 g.setColor(Color.BLACK);
  329.                                 g.fill3DRect(566, 387, progress,13, true);
  330.                                
  331.                                 g.setColor(Color.white);
  332.                                 g.drawString(progress + "% To Level " + lvlUp, 574, 398);
  333.                          
  334.                         }
  335.                 }
  336.                        
  337.                 public void serverMessageReceived(String s) {
  338.                         if (s.contains("chop")) {
  339.                                 ivyChopped++;
  340.                                 expGained += 352.5;
  341.                                 }
  342.                         if (s.contains("advanced")) {
  343.                                 levelsGained++;
  344.                         }
  345.                         }
  346.                 public void chatMessageReceived(String message, String user) {
  347.                         if(message.contains("wc lvl?") || message.contains("Woodcutting Level") || message.contains("wc?")
  348.                                         || message.contains("What is your level in woodcutting")) {
  349.                                 wait(random(3000, 4000));
  350.                                 if(random(0, 10) > 5) {
  351.                                 input.typeString(currentLevel + " wc here");
  352.                                 }else {
  353.                                 input.typeString(currentLevel + " u?");
  354.                         }
  355.                         }
  356.                         if(message.contains("my level") || message.contains("My woodcutting level") || message.contains("wc" + "is")
  357.                                         || message.contains("Woodcutting" + "is")) {
  358.                                 wait(random(3000, 4500));
  359.                                 if(random(0, 10) > 5) {
  360.                                         input.typeString("nice");
  361.                                         }else {
  362.                                         input.typeString("kewliooo");
  363.                                 }
  364.                         }
  365.                 }
  366.  
  367.                 @SuppressWarnings("serial")
  368.                 public class IvyChopperGUI extends JFrame implements ActionListener {
  369.                         public IvyChopperGUI() {
  370.                                 initComponents();
  371.                         }
  372.                         /*public void paint(Graphics g) {
  373.                                 try {
  374.                                         BufferedImage pic = ImageIO.read(new URL("http://i1039.photobucket.com/albums/a476/powerscript/IvyChoppingpic.png"));
  375.                                 } catch (Exception e) {
  376.                                         e.printStackTrace();
  377.                                 }
  378.                                 g.drawImage(pic, 0, 0, getWidth(), getHeight(), null);
  379.                                 super.paint(g);
  380.                        }*/
  381.                        
  382.                        
  383.                        
  384.                        
  385.                         private void initComponents() {
  386.                                 name = new JLabel();
  387.                                 where = new JComboBox();
  388.                                 start = new JButton();
  389.                                 label1 = new JLabel();
  390.                                
  391.  
  392.                                 Container contentPane = getContentPane();
  393.                                 contentPane.setLayout(null);
  394.  
  395.                                 name.setText("Ivy Chopper");
  396.                                 name.setFont(new Font("Verdana", Font.BOLD, 22));
  397.                                 contentPane.add(name);
  398.                                 name.setBounds(new Rectangle(new Point(35, 5), name.getPreferredSize()));
  399.  
  400.                                 where.setModel(new DefaultComboBoxModel(new String[] {
  401.                                         "Varrock Palace - North Wall",
  402.                                         "Varrock Palace - South East Wall",
  403.                                         "Falador North Wall - North Side",
  404.                                         "Falador South Wall - South Side",
  405.                                         "East Ardougne Church - East Wall",
  406.                                         "Yanille North Wall - North Side",
  407.                                         "Tavelry - South East",
  408.                                         "Castle Wars - South Wall"
  409.                                 }));
  410.  
  411.                                 contentPane.add(where);
  412.                                 where.setBounds(5, 55, 225, where.getPreferredSize().height);
  413.  
  414.                                 start.setText("Start");
  415.                                 contentPane.add(start);
  416.                                 start.setBounds(155, 90, 70, start.getPreferredSize().height);
  417.  
  418.                                 label1.setText("By Powerscript");
  419.                                 contentPane.add(label1);
  420.                                 label1.setBounds(new Rectangle(new Point(70, 35), label1.getPreferredSize()));
  421.  
  422.  
  423.                                 {
  424.                                         Dimension preferredSize = new Dimension();
  425.                                         for(int i = 0; i < contentPane.getComponentCount(); i++) {
  426.                                                 Rectangle bounds = contentPane.getComponent(i).getBounds();
  427.                                                 preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  428.                                                 preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  429.                                         }
  430.                                         Insets insets = contentPane.getInsets();
  431.                                         preferredSize.width += insets.right;
  432.                                         preferredSize.height += insets.bottom;
  433.                                         contentPane.setMinimumSize(preferredSize);
  434.                                         contentPane.setPreferredSize(preferredSize);
  435.                                 }
  436.                                 pack();
  437.                                 setVisible(true);
  438.                         start.addActionListener(this);
  439.                         }
  440.                        
  441.                 public void actionPerformed(ActionEvent e) {
  442.                         Object source = e.getSource();
  443.  
  444.                         if(source == start){
  445.                                   place = (String)where.getSelectedItem();
  446.  
  447.                           }
  448.                        
  449.                           this.setVisible(false);
  450.                             this.dispose();
  451.                                         }
  452.  
  453.                         private JLabel name;
  454.                         private JComboBox where;
  455.                         private JButton start;
  456.                         private JLabel label1;
  457.                 }
  458.  
  459.                 }