- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.Point;
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.*;
- import com.quirlion.script.Constants;
- import com.quirlion.script.Script;
- import com.quirlion.script.types.GroundItem;
- import com.quirlion.script.types.Location;
- import com.quirlion.script.types.Thing;
- public class AIOIvyChopper extends Script {
- public int startingExp;
- public long StartTime;
- private long RunTime;
- private long seconds;
- private long minutes;
- private long hours;
- int time;
- int progress;
- int currentLevel;
- int levelsGained;
- int lvlUp;
- int expToLevel;
- int xpPerHour;
- int expGained = 0;
- int ivyChopped = 0;
- int ivyPerHour;
- long antiBanCache = -1;
- String place;
- IvyChopperGUI gui;
- public Image pic;
- int[] nestIDs = {5070, 5071, 5072, 5073, 5074, 7413};
- int[] ivy = {46320, 46322, 46324};
- public void onStart() {
- gui = new IvyChopperGUI();
- gui.setVisible(true);
- while(gui.isVisible()){
- wait(500);
- log("Initializing AIOIvyChopper, give me a few seconds please! =)");
- log("Please donate =)");
- log("newest v. started");
- }
- }
- public boolean chop() {
- input.MOUSE_SPEED = random(4, 6);
- Thing thing = things.getNearest(ivy);
- if(thing != null) {
- Location loc = thing.getAbsLoc();
- Point p = calculations.worldToScreen(loc.X, loc.Y, 0, 0, (random(-60, -75)));
- if(!place.equals("Castle Wars - South Wall")) {
- cam.setAltitude(false);
- }
- if(place.equals("Castle Wars - South Wall")) {
- cam.setAltitude(true);
- }
- input.atPoint(p, "Chop Ivy");
- wait(random(4000, 4550));
- return true;
- }
- if(thing == null) {
- return false;
- }
- return true;
- }
- public void handleNest() {
- GroundItem nest = groundItems.getByID(nestIDs);
- if (nest != null) {
- log("Picking up Nest");
- nest.click();
- }
- }
- /*public int antiban() {
- if(chop() && place.equals("Varrock Palace - SouthEast Wall")) {
- cam.rotate(-90 + random(-110, 75));
- return(random(6000, 6500));
- }
- if(chop() && place.equals("Varrock Palace - North Wall")) {
- cam.rotate(random(-165, 170));
- return(random(6000, 6500));
- }
- if(chop() && place.equals("Falador North Wall - North Side")) {
- cam.rotate(random(-165, 170));
- return(random(6000, 6500));
- }
- if(chop() && place.equals("Falador North Wall - South Side")) {
- cam.rotate(random(-15, 15));
- return(random(6000, 6500));
- }
- if(chop() && place.equals("East Ardougne - East Wall")) {
- cam.rotate(random(-110, 80));
- return(random(6000, 6500));
- }
- if(chop() && place.equals("Yanille North Wall - North Side")) {
- cam.rotate(random(-165, 170));
- return(random(6000, 6500));
- }
- if(chop() && place.equals("Tavelry - South East")) {
- cam.rotate(random(-110, 80));
- return(random(6000, 6500));
- }
- if(chop() && place.equals("Castle Wars - South Wall)")) {
- cam.rotate(random(-15, 15));
- return(random(6000, 6500));
- }
- return 500;
- }*/
- public int antiban1() {
- Thing thing = things.getNearest(ivy);
- Location loc = thing.getAbsLoc();
- Point p = calculations.worldToScreen(loc.X, loc.Y, 0, 0, (random(-85, -90)));
- if(random(30, 40) > 35) {
- tabs.openTab(Constants.TAB_STATS);
- wait(random(500, 650));
- input.moveMouse(714, 363 + random(-7, -3));
- wait(random(7000, 8500));
- input.moveMouse(p.x, p.y);
- wait(random(5000, 8500));
- tabs.openTab(Constants.TAB_INVENTORY);
- wait(random(6000, 11500));
- input.moveMouse(p.x, p.y);
- return(random(1000, 1500));
- }else {
- tabs.openTab(Constants.TAB_STATS);
- wait(random(500, 650));
- input.moveMouse(694, 410 + random(-7, -3));
- wait(random(4000, 5550));
- tabs.openTab(Constants.TAB_INVENTORY);
- wait(random(1000, 2500));
- input.moveMouse(p.x, p.y);
- }
- return(random(800, 1000));
- }
- public int antiban2() {
- Thing thing = things.getNearest(ivy);
- Location loc = thing.getAbsLoc();
- Point p = calculations.worldToScreen(loc.X, loc.Y, 0, 0, (random(-85, -90)));
- tabs.openTab(Constants.TAB_FRIENDS);
- input.moveMouse(618, 308 + random(20, 15));
- wait(random(6500, 8000));
- tabs.openTab(Constants.TAB_INVENTORY);
- wait(random(2000, 5500));
- input.moveMouse(p.x, p.y);
- return(random(600, 850));
- }
- public int loop() {
- if(players.getCurrent().isMoving()) {
- return(random(300, 450));
- }
- if(antiBanCache<0 || (System.currentTimeMillis()-antiBanCache) > random(180000, 360000)) {
- if(players.getCurrent().getAnimation() != -1) {
- antiBanCache = System.currentTimeMillis();
- antiban1();
- }
- }
- if(antiBanCache<0 || (System.currentTimeMillis()-antiBanCache) > random(120000, 480000)) {
- if(players.getCurrent().getAnimation() != -1) {
- antiBanCache = System.currentTimeMillis();
- antiban2();
- }
- }
- //handleNest();
- /*if(players.getCurrent().getAnimation() != -1 && place.equals("Varrock Palace - North Wall")) {
- cam.rotate(180 + random(-15, 15));
- return(random(500, 850));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Varrock Palace - South East Wall")) {
- cam.rotate(-90 + random(-15, 15));
- return(random(500, 850));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Falador North Wall - North Side")) {
- cam.rotate(180 + random(-15, 15));
- return(random(500, 850));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Falador North Wall - South Side")) {
- cam.rotate(0 + random(-15, 15));
- return(random(500, 850));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("East Ardougne - East Wall")) {
- cam.rotate(90 + random(-15, 15));
- return(random(500, 850));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Yanille North Wall - North Side")) {
- cam.rotate(180 + random(-15, 15));
- return(random(500, 850));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Tavelry - South East")) {
- cam.rotate(-90 + random(-15, 15));//my biggest script yet.. by far..
- return(random(500, 850));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Castle Wars - South Wall)")) {
- cam.rotate(0 + random(-15, 15));
- return(random(500, 850));
- }
- if(players.getCurrent().getInteracting().equals(ivy)) {
- wait(random(900, 1200));
- }*/
- if(players.getCurrent().getAnimation() != -1 && place.equals("Varrock Palace - South East Wall")) {
- cam.rotate(-90);
- return(random(3000, 3500));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Varrock Palace - North Wall")) {
- cam.rotate(random(-165, 170));
- return(random(3000, 3500));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Falador North Wall - North Side")) {
- cam.rotate(random(-165, 170));
- return(random(3000, 3500));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Falador North Wall - South Side")) {
- cam.rotate(random(-15, 15));
- return(random(3000, 3500));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("East Ardougne - East Wall")) {
- cam.rotate(random(-110, 80));
- return(random(3000, 3500));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Yanille North Wall - North Side")) {
- cam.rotate(random(-165, 170));
- return(random(3000, 3500));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Tavelry - South East")) {
- cam.rotate(random(-110, 80));
- return(random(3000, 3500));
- }
- if(players.getCurrent().getAnimation() != -1 && place.equals("Castle Wars - South Wall)")) {
- cam.rotate(random(-15, 15));
- return(random(3000, 3500));
- }
- chop();
- return(random(1000, 1200));
- }
- @Override
- public void paint(Graphics g) {
- if(players.getCurrent().isLoggedIn()) {
- currentLevel = skills.getCurrentSkillLevel(Constants.STAT_WOODCUTTING);
- progress = (int) skills.getPercentToNextLevel(Constants.STAT_WOODCUTTING);
- expToLevel = skills.getXPToNextLevel(Constants.STAT_WOODCUTTING);
- lvlUp = currentLevel + 1;
- ivyPerHour = (int) (3600000.0 / RunTime * ivyChopped);
- xpPerHour = (int) (3600000.0 / RunTime * ivyChopped * 352.5);
- if (StartTime == 0) {
- StartTime = System.currentTimeMillis();
- }
- RunTime = System.currentTimeMillis() - StartTime;
- seconds = RunTime / 1000;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= minutes * 60;
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= hours *60;
- }
- /*try {
- URL imageurl = new URL(
- "http://i1039.photobucket.com/albums/a476/powerscript/IvyChoppingpic.png");
- pic = Toolkit.getDefaultToolkit().getImage(imageurl);
- } catch (Exception e) {
- e.printStackTrace();
- } //THIS IS WORKING ONE!!!
- g.drawImage(pic, 555, 210, null);*/
- /*try {
- BufferedImage pic = ImageIO.read(new URL("http://i43.tinypic.com/216jit.png"));
- } catch (Exception e) {
- e.printStackTrace();
- g.drawImage(pic, 558, 457, 175, 250, null);
- }*/
- Point p = input.getBotMousePosition();
- g.setColor(Color.RED);
- g.drawLine(p.x,1,p.x,1500);
- g.drawLine(1,p.y,1500,p.y);
- g.setColor(new Color(84, 106, 114, 165));
- g.fillRoundRect(555, 210, 175, 250, 15, 20);
- g.setColor(new Color(60, 134, 138, 165));
- g.drawRoundRect(555, 210, 175, 250, 15, 20);
- g.setColor(new Color(255, 255, 255, 155));
- g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
- g.drawString("Ivy Chopper", 610, 236);
- g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
- g.drawString("By Powerscript", 604, 255);
- g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
- g.setColor(Color.RED);
- g.drawString("Time Running: " + + hours + ":" + minutes + ":" + seconds, 566, 279);
- g.drawString("Woodcutting Level: " + currentLevel, 566, 297);
- g.drawString("Levels Gained: " + levelsGained, 566, 315);
- g.drawString("Exp Gained: " + expGained, 566, 333);
- g.drawString("Exp To " + lvlUp + " WC: " + expToLevel, 566, 351);
- g.drawString("Exp / Hour: " + xpPerHour, 566, 369);
- g.setColor(Color.LIGHT_GRAY);
- g.fill3DRect(566, 387, 100, 13, true);
- g.setColor(Color.BLACK);
- g.fill3DRect(566, 387, progress,13, true);
- g.setColor(Color.white);
- g.drawString(progress + "% To Level " + lvlUp, 574, 398);
- }
- }
- public void serverMessageReceived(String s) {
- if (s.contains("chop")) {
- ivyChopped++;
- expGained += 352.5;
- }
- if (s.contains("advanced")) {
- levelsGained++;
- }
- }
- public void chatMessageReceived(String message, String user) {
- if(message.contains("wc lvl?") || message.contains("Woodcutting Level") || message.contains("wc?")
- || message.contains("What is your level in woodcutting")) {
- wait(random(3000, 4000));
- if(random(0, 10) > 5) {
- input.typeString(currentLevel + " wc here");
- }else {
- input.typeString(currentLevel + " u?");
- }
- }
- if(message.contains("my level") || message.contains("My woodcutting level") || message.contains("wc" + "is")
- || message.contains("Woodcutting" + "is")) {
- wait(random(3000, 4500));
- if(random(0, 10) > 5) {
- input.typeString("nice");
- }else {
- input.typeString("kewliooo");
- }
- }
- }
- @SuppressWarnings("serial")
- public class IvyChopperGUI extends JFrame implements ActionListener {
- public IvyChopperGUI() {
- initComponents();
- }
- /*public void paint(Graphics g) {
- try {
- BufferedImage pic = ImageIO.read(new URL("http://i1039.photobucket.com/albums/a476/powerscript/IvyChoppingpic.png"));
- } catch (Exception e) {
- e.printStackTrace();
- }
- g.drawImage(pic, 0, 0, getWidth(), getHeight(), null);
- super.paint(g);
- }*/
- private void initComponents() {
- name = new JLabel();
- where = new JComboBox();
- start = new JButton();
- label1 = new JLabel();
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- name.setText("Ivy Chopper");
- name.setFont(new Font("Verdana", Font.BOLD, 22));
- contentPane.add(name);
- name.setBounds(new Rectangle(new Point(35, 5), name.getPreferredSize()));
- where.setModel(new DefaultComboBoxModel(new String[] {
- "Varrock Palace - North Wall",
- "Varrock Palace - South East Wall",
- "Falador North Wall - North Side",
- "Falador South Wall - South Side",
- "East Ardougne Church - East Wall",
- "Yanille North Wall - North Side",
- "Tavelry - South East",
- "Castle Wars - South Wall"
- }));
- contentPane.add(where);
- where.setBounds(5, 55, 225, where.getPreferredSize().height);
- start.setText("Start");
- contentPane.add(start);
- start.setBounds(155, 90, 70, start.getPreferredSize().height);
- label1.setText("By Powerscript");
- contentPane.add(label1);
- label1.setBounds(new Rectangle(new Point(70, 35), label1.getPreferredSize()));
- {
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- pack();
- setVisible(true);
- start.addActionListener(this);
- }
- public void actionPerformed(ActionEvent e) {
- Object source = e.getSource();
- if(source == start){
- place = (String)where.getSelectedItem();
- }
- this.setVisible(false);
- this.dispose();
- }
- private JLabel name;
- private JComboBox where;
- private JButton start;
- private JLabel label1;
- }
- }