Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.*;
- import java.io.IOException;
- import java.net.URL;
- import java.util.LinkedList;
- import javax.imageio.ImageIO;
- import javax.swing.*;
- import com.rarebot.event.events.MessageEvent;
- import com.rarebot.event.listeners.MessageListener;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.methods.Game.Tab;
- import com.rarebot.script.methods.Skills;
- import com.rarebot.script.wrappers.RSComponent;
- import com.rarebot.script.wrappers.RSNPC;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- import com.rarebot.script.wrappers.RSWeb;
- @ScriptManifest(
- authors = {"Rudie"},
- version = 1.0,
- keywords = ("chopper, woodcutting, wc, worldchopper, rudie"),
- description = "Chops and banks logs at different locations more info is in the thread",
- name = "MultiChopper"
- )
- public class MultiChopper extends Script implements PaintListener, MessageListener, MouseListener {
- RSTile Fallytile = new RSTile(3013, 3356, 0);
- RSTile Draynortile = new RSTile(3092, 3243, 0);
- RSTile DraynorChoptile = new RSTile(3086, 3233, 0);
- RSTile GEtile = new RSTile(3180, 3501, 0);
- RSTile GEChoptile = new RSTile(3215, 3502, 0);
- RSTile Camtile = new RSTile(2726, 3491, 0);
- RSTile CamChoptile = new RSTile(2727, 3500, 0);
- RSTile Cattile = new RSTile(2808, 3440, 0);
- RSTile CatChoptile = new RSTile(2767, 3430, 0);
- RSTile FallyChoptile = new RSTile(3045, 3322, 0);
- RSTile RimmyChoptile = new RSTile(2970, 3193, 0);
- private final static int[] yew_ID = {38755, 1309};
- private final static int[] maple_ID = {1307};
- private final static int[] oak_ID = {38731};
- private final static int[] regular_ID = {38784, 38785, 38786, 38787, 1278, 1276};
- private final static int[] ivy_ID = {46324, 46322, 46318, 46322, 46320};
- private final static int[] willow_ID = {38616, 38627, 58006, 2210};
- private final static int[] hatchetID = {1349, 1351, 1353, 1355, 1357, 1359, 1361, 6739};
- private final static int[] boothID = {11758, 2012, 2019, 25808, 2213};
- private final static int[] bnpcID = {3293};
- private static final int yew_LOG = 1515;
- private static final int maple_LOG = 1517;
- private static final int oak_LOG = 1521;
- private static final int regular_LOG = 1511;
- private static final int willow_LOG = 1519;
- private int[] logsToChop;
- public int logID = 0;
- long startTime;
- private String Status = "Loading...";
- private static final Color MOUSE_COLOR = new Color(255, 0, 0),
- MOUSE_BORDER_COLOR = new Color(255, 0, 0),
- MOUSE_CENTER_COLOR = new Color(0, 0, 0);
- private boolean pressed = false;
- int expGained = 0;
- int startExp = 0;
- int logsChopped = 0;
- int nestsFound = 0;
- int gainedLvl = 0;
- public boolean showPaint = true ;
- Point p;
- Point p2;
- private final LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>();
- MultiChopperGUI g;
- private boolean guiWait = true;
- public boolean powerchop = false;
- public boolean fallytile = false;
- public boolean fallybanktile = false;
- public boolean rimmytile = false;
- public boolean draynortile = false;
- public boolean getile = false;
- public boolean camtile = false;
- public boolean cattile = false;
- public boolean onStart() {
- startTime = System.currentTimeMillis();
- mouse.setSpeed(random(3, 5));
- startExp = skills.getCurrentExp(Skills.WOODCUTTING);
- log(new Color (30, 144, 255), "Welcome to MultiChopper V 1.0!");
- log(Color.RED, "PLEASE READ:");
- log(new Color (30, 144, 255), "Please check the thread every day for new updates.");
- log(new Color (30, 144, 255), "V 1.0 has been released 17-3-2012.");
- log(new Color (30, 144, 255), "MultiChopper ® © 2012 ");
- log(Color.RED, "Happy botting!");
- try {
- SwingUtilities.invokeAndWait(new Runnable() {
- public void run() {
- g = new MultiChopperGUI();
- g.setVisible(true);
- }
- });
- } catch (Throwable e) {
- log("Fail.");
- }
- while(guiWait) sleep(500);
- return true;
- }
- @Override
- public int loop() {
- if(inventory.isFull() && powerchop == true) {
- inventory.dropAllExcept(hatchetID);
- Status = "Dropping logs.";
- } else if(inventory.isFull() && powerchop == false) {
- if(atBank() || atNPCBank()) {
- doBank();
- doNPCBank();
- } else {
- toFally();
- toDraynor();
- toGE();
- toCam();
- toCat();
- AntiBanCamera();
- }
- } else if(atTree()) {
- chopLogs();
- AntiBan();
- AntiBanCamera();
- } else {
- toFallyChop();
- toRimmyChop();
- toDraynorChop();
- toGEChop();
- toCamChop();
- toCatChop();
- AntiBanCamera();
- }
- return random(600, 800);
- }
- private boolean atTree() {
- RSObject tree = objects.getNearest(logsToChop);
- if(tree != null) {
- if(tree.isOnScreen()) {
- return true;
- }
- }
- return false;
- }
- private void chopLogs() {
- RSObject tree = objects.getNearest(logsToChop);
- if (tree != null && getMyPlayer().getAnimation() == -1) {
- tree.interact("Chop");
- Status = "Cutting tree.";
- }
- }
- private void toFally() {
- if (inventory.isFull() && fallybanktile == true) {
- RSWeb walkWeb = web.getWeb(Fallytile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to bank.";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(Fallytile);
- }} }
- private void toFallyChop() {
- if (!inventory.isFull() && fallytile == true) {
- RSWeb walkWeb = web.getWeb(FallyChoptile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to tree(s).";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(FallyChoptile);
- }} }
- private void toDraynor() {
- if (inventory.isFull() && draynortile == true) {
- RSWeb walkWeb = web.getWeb(Draynortile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to bank.";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(Draynortile);
- }} }
- private void toDraynorChop() {
- if (!inventory.isFull() && draynortile == true) {
- RSWeb walkWeb = web.getWeb(DraynorChoptile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to tree(s).";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(DraynorChoptile);
- }} }
- private void toGE() {
- if (inventory.isFull() && getile == true) {
- RSWeb walkWeb = web.getWeb(GEtile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to bank.";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(GEtile);
- }} }
- private void toGEChop() {
- if (!inventory.isFull() && getile == true) {
- RSWeb walkWeb = web.getWeb(GEChoptile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to tree(s).";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(GEChoptile);
- }} }
- private void toCam() {
- if (inventory.isFull() && camtile == true) {
- RSWeb walkWeb = web.getWeb(Camtile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to bank.";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(Camtile);
- }} }
- private void toCamChop() {
- if (!inventory.isFull() && camtile == true) {
- RSWeb walkWeb = web.getWeb(CamChoptile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to tree(s).";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(CamChoptile);
- }} }
- private void toCat() {
- if (inventory.isFull() && cattile == true) {
- RSWeb walkWeb = web.getWeb(Cattile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to bank.";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(Cattile);
- }} }
- private void toCatChop() {
- if (!inventory.isFull() && cattile == true) {
- RSWeb walkWeb = web.getWeb(CatChoptile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to tree(s).";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(CatChoptile);
- }} }
- private void toRimmyChop() {
- if (!inventory.isFull() && rimmytile == true) {
- RSWeb walkWeb = web.getWeb(RimmyChoptile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- Status = "Walking to tree(s).";
- } else if (walkWeb == null) {
- walkWeb = web.getWeb(RimmyChoptile);
- }} }
- private void doBank() {
- if(bank.isOpen()) {
- bank.depositAllExcept(hatchetID);
- Status = "Banking.";
- sleep(800, 1200);
- } else {
- bank.open();
- Status = "Banking.";
- sleep(1800, 2200);
- }
- }
- private boolean atBank() {
- RSObject bank = objects.getNearest(boothID);
- if(bank != null) {
- if(bank.isOnScreen()) {
- return true;
- }
- }
- return false;
- }
- private void doNPCBank() {
- if(bank.isOpen()) {
- bank.depositAllExcept(hatchetID);
- Status = "Banking.";
- sleep(800, 1200);
- } else {
- bank.open();
- Status = "Banking.";
- sleep(1800, 2200);
- }
- }
- private boolean atNPCBank() {
- RSNPC bank = npcs.getNearest(bnpcID);
- if(bank != null) {
- if(bank.isOnScreen()) {
- return true;
- }
- }
- return false;
- }
- public void onFinish() {
- log(new Color (30, 144, 255), "Ty for using MultiChopper by Rudie.");
- env.saveScreenshot(true);
- }
- public void mouseClicked(MouseEvent e) {
- RSComponent inter = interfaces.get(137).getComponent(176);
- if (inter.getArea().contains(e.getPoint())) {
- showPaint = !showPaint;
- }
- }
- private void drawMouse(Graphics g) {
- ((Graphics2D) g).setRenderingHints(new RenderingHints(
- RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON));
- Point p = mouse.getLocation();
- Graphics2D spinG = (Graphics2D) g.create();
- Graphics2D spinGRev = (Graphics2D) g.create();
- Graphics2D spinG2 = (Graphics2D) g.create();
- spinG.setColor(MOUSE_BORDER_COLOR);
- spinGRev.setColor(MOUSE_COLOR);
- spinG.rotate(System.currentTimeMillis() % 2000d / 2000d * (360d) * 2
- * Math.PI / 180.0, p.x, p.y);
- spinGRev.rotate(System.currentTimeMillis() % 2000d / 2000d * (-360d)
- * 2 * Math.PI / 180.0, p.x, p.y);
- final int outerSize = 20;
- final int innerSize = 12;
- spinG.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
- BasicStroke.JOIN_ROUND));
- spinGRev.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
- BasicStroke.JOIN_ROUND));
- spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
- outerSize, 100, 75);
- spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
- outerSize, -100, 75);
- spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
- innerSize, innerSize, 100, 75);
- spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
- innerSize, innerSize, -100, 75);
- g.setColor(MOUSE_CENTER_COLOR);
- g.fillOval(p.x, p.y, 2, 2);
- spinG2.setColor(MOUSE_CENTER_COLOR);
- spinG2.rotate(System.currentTimeMillis() % 2000d / 2000d * 360d
- * Math.PI / 180.0, p.x, p.y);
- spinG2.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
- BasicStroke.JOIN_ROUND));
- spinG2.drawLine(p.x - 5, p.y, p.x + 5, p.y);
- spinG2.drawLine(p.x, p.y - 5, p.x, p.y + 5);
- }
- @SuppressWarnings("serial")
- private class MousePathPoint extends Point { // credits to Enfilade
- private int toColor(double d) {
- return Math.min(255, Math.max(0, (int) d));
- }
- private long finishTime;
- private double lastingTime;
- public MousePathPoint(int x, int y, int lastingTime) {
- super(x, y);
- this.lastingTime = lastingTime;
- finishTime = System.currentTimeMillis() + lastingTime;
- }
- public boolean isUp() {
- return System.currentTimeMillis() > finishTime;
- }
- public Color getColor() {
- return new Color(
- 0,
- 0,
- 0,
- toColor(256 * ((finishTime - System.currentTimeMillis()) / lastingTime)));
- }
- }
- private final RenderingHints antialiasing = new RenderingHints(
- RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- ////////////
- ///Paint///
- //////////
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- private final Color color1 = new Color(51, 51, 51);
- private final Color color2 = new Color(255, 0, 0);
- private final Color color3 = new Color(255, 255, 255);
- private final Color color4 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Comic Sans MS", 2, 15);
- private final Font font2 = new Font("Comic Sans MS", 0, 32);
- private final Font font3 = new Font("Arial", 3, 15);
- private final Font font4 = new Font("Arial", 0, 13);
- 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");
- private final Image logo = getImage("http://i43.tinypic.com/1zcfoy1.png");
- @Override
- public void onRepaint(Graphics g) {
- drawModel(g, objects.getNearest(logsToChop), Color.RED, "Tree", Color.WHITE);
- drawModel(g, objects.getNearest(boothID), Color.BLUE, "Bank Booth", Color.WHITE);
- expGained = skills.getCurrentExp(Skills.WOODCUTTING) - startExp;
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- float xpsec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0)&& expGained > 0) {
- xpsec = ((float) expGained)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float xpmin = xpsec * 60;
- float xphour = xpmin * 60;
- float oresec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0)&& logsChopped > 0) {
- oresec = ((float) logsChopped)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float oremin = oresec * 60;
- float orehour = oremin * 60;
- Graphics2D g1 = (Graphics2D)g;
- g1.setColor(color4);
- g1.fillRect(396, 459, 98, 12);
- g1.setColor(color2);
- g1.drawRect(396, 459, 98, 12);
- g1.setColor(color3);
- g1.setFont(font4);
- g1.drawString("Hide/Show Paint.", 396, 470);
- drawMouse(g1);
- Point p = mouse.getLocation();
- while (!mousePath.isEmpty() && mousePath.peek().isUp())
- mousePath.remove();
- Point clientCursor = mouse.getLocation();
- MousePathPoint mpp = new MousePathPoint(clientCursor.x,
- clientCursor.y, 3000);
- if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
- mousePath.add(mpp);
- MousePathPoint lastPoint = null;
- for (MousePathPoint a : mousePath) {
- if (lastPoint != null) {
- g1.setColor(a.getColor());
- g1.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
- }
- lastPoint = a;
- }
- g1.fillRect(p.x - 5, p.y, 12, 2);
- g1.fillRect(p.x, p.y - 5, 2, 12);
- if(showPaint){
- g1.setColor(color1);
- g1.fillRoundRect(8, 345, 488, 112, 16, 16);
- g1.setColor(color2);
- g1.setStroke(stroke1);
- g1.drawRoundRect(8, 345, 488, 112, 16, 16);
- g1.drawLine(7, 362, 494, 362);
- g1.drawImage(img1, 375, 360, null);
- g1.setFont(font1);
- g1.setColor(color3);
- g1.setFont(font2);
- g1.setColor(color2);
- g1.drawImage(logo, -60, 210, null);
- g1.setFont(font3);
- g1.setColor(color3);
- g1.drawString("Status: " + Status, 12, 361);
- g1.drawString("RunTime: " + hours + ":" + minutes + ":" + seconds, 17, 390);
- g1.drawString("Current Lvl: " + skills.getCurrentLevel(Skills.WOODCUTTING), 17, 405);
- g1.drawString("Lvl's Gained: " + gainedLvl, 17, 420);
- g1.drawString("XP/TNL: " + skills.getExpToNextLevel(Skills.WOODCUTTING), 17, 435);
- g1.drawString("Logs Chopped: " + logsChopped, 250, 390);
- g1.drawString("Logs/H: " + (int) orehour, 250, 405);
- g1.setColor(color4);
- g1.fillRect(8, 459, 98, 12);
- g1.setColor(color2);
- g1.drawRect(8, 459, 98, 12);
- g1.setColor(color4);
- g1.fillRect(396, 459, 98, 12);
- g1.setColor(color2);
- g1.drawRect(396, 459, 98, 12);
- g1.setColor(color3);
- g1.drawString("XP/H: " + (int) xphour, 250, 435);
- g1.drawString("By: Rudie!", 250, 450);
- g1.drawString("%/TNL: " + skills.getPercentToNextLevel(Skills.WOODCUTTING) + "%", 17, 450);
- g1.drawString("XP Gained: " + expGained, 250, 420);
- g1.setFont(font4);
- g1.drawString("Hide/Show Paint.", 396, 470);
- }
- }
- public void drawModel(Graphics g, RSObject o, Color c, String s, Color tc) {
- if(o != null) {
- Polygon[] model = o.getModel().getTriangles();
- Point point = calc.tileToScreen(o.getLocation());
- for(Polygon p : model) {
- g.setColor(c);
- g.fillPolygon(p);
- g.setColor(c.darker());
- g.drawPolygon(p);
- }
- g.setColor(tc);
- g.drawString(s, point.x - 75, point.y - 35);
- }
- }
- public RSTile[] reversePath(RSTile[] other) {
- RSTile[] t = new RSTile[other.length];
- for (int i = 0; i < t.length; i++) {
- t[i] = other[other.length - i - 1];
- }
- return t;
- }
- @Override
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void messageReceived(MessageEvent e) {
- String txt = e.getMessage().toLowerCase();
- if(txt.contains("get some") || txt.contains("chop away some")) {
- logsChopped++;
- }
- if(txt.contains("nest falls")) {
- nestsFound++;
- }
- if(txt.contains("woodcutting level")) {
- gainedLvl++;
- }
- }
- //////////////
- ///AntiBan///
- ////////////
- @SuppressWarnings("deprecation")
- private void AntiBan() {
- int randomProd = random(1, 60);
- if (randomProd == 1) {
- int randomMore = random(1, 5);
- if (randomMore == 1) {
- if (game.getCurrentTab() != 2) {
- game.openTab(Tab.STATS);
- Status = "Checking WC XP + Level.";
- sleep(350, 500);
- skills.doHover(Skills.WOODCUTTING);
- sleep(2000, 3500);
- } else {
- mouse.move(random(678, 728), random(213, 232));
- sleep(2000, 3500);
- }
- } else {
- sleep(1200, 2500);
- }
- }
- if (randomProd == 2 || randomProd == 3 || randomProd == 4) {
- sleep(1000, 2500);
- }
- if (randomProd >= 52) {
- mouse.moveRandomly(65, 350);
- } else
- sleep(10, 30);
- }
- private void AntiBanCamera() {
- int randomNum = random(1, 50);
- if (randomNum == 1 || randomNum == 2 || randomNum == 3) {
- camera.moveRandomly(random(2000, 3300));
- }
- if (randomNum == 4 || randomNum == 5) {
- camera.setAngle(random(10, 40));
- }
- if (randomNum == 6) {
- camera.setPitch(random(40, 68));
- }
- if (randomNum == 7) {
- camera.setPitch(random(20, 45));
- }
- if (randomNum == 8) {
- camera.setPitch(random(68, 90));
- } else
- sleep(50, 70);
- }
- class MultiChopperGUI extends JFrame {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- public MultiChopperGUI() {
- initComponents();
- }
- private void StartActionPerformed(ActionEvent e) {
- String chosen = Tree.getSelectedItem().toString();
- if(chosen.equals("Yew")) {
- logID = yew_LOG;
- logsToChop = yew_ID;
- } else if(chosen.equals("Oak")) {
- logID = oak_LOG;
- logsToChop = oak_ID;
- } else if(chosen.equals("Regular")) {
- logID = regular_LOG;
- logsToChop = regular_ID;
- } else if(chosen.equals("Ivy")) {
- logsToChop = ivy_ID;
- } else if(chosen.equals("Willow")) {
- logID = willow_LOG;
- logsToChop = willow_ID;
- } else if(chosen.equals("Maple")) {
- logID = maple_LOG;
- logsToChop = maple_ID;
- }
- guiWait = false;
- g.dispose();
- }
- private void ExitActionPerformed(ActionEvent e) {
- stopScript(true);
- }
- private void checkBox1ActionPerformed(ActionEvent e) {
- powerchop = true;
- }
- private void LocationActionPerformed(ActionEvent e) {
- String chosen = Location.getSelectedItem().toString();
- if(chosen.equals("Falador. S")) {
- fallytile = true;
- fallybanktile = true;
- } else if(chosen.equals("Rimmington")) {
- rimmytile = true;
- fallybanktile = true;
- } else if(chosen.equals("Draynor Village")) {
- draynortile = true;
- } else if(chosen.equals("Varrock Palace. N")) {
- getile = true;
- } else if(chosen.equals("Varrock Palace N")) {
- Tree.setSelectedItem("Ivy");
- Tree.disable();
- getile = true;
- } else if(chosen.equals("Varrock Palace W")) {
- Tree.setSelectedItem("Ivy");
- Tree.disable();
- } else if(chosen.equals("Camelot")) {
- camtile = true;
- Tree.setSelectedItem("Maple");
- Tree.disable();
- } else if(chosen.equals("Catherby")) {
- cattile = true;
- } else if(chosen.equals("Falador S")) {
- fallytile = true;
- Tree.setSelectedItem("Ivy");
- Tree.disable();
- } else if(chosen.equals("Yanille")) {
- Tree.setSelectedItem("Ivy");
- Tree.disable();
- }
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - Rudie Visser
- Location = new JComboBox();
- label1 = new JLabel();
- label2 = new JLabel();
- Tree = new JComboBox();
- Start = new JButton();
- Exit = new JButton();
- label3 = new JLabel();
- label4 = new JLabel();
- checkBox1 = new JCheckBox();
- //======== this ========
- setTitle("MultiChopper GUI");
- Container contentPane = getContentPane();
- //---- Location ----
- Location.setModel(new DefaultComboBoxModel(new String[] {
- "Falador. S",
- "Rimmington",
- "Varrock Palace. N",
- "Draynor Village",
- "Catherby",
- "Camelot",
- "Ivy:",
- "Yanille",
- "Falador S",
- "Varrock Palace N",
- "Varrock Palace W",
- }));
- Location.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- LocationActionPerformed(e);
- }
- });
- //---- label1 ----
- label1.setText("Choose Location:");
- //---- label2 ----
- label2.setText("Choose Tree:");
- //---- Tree ----
- Tree.setModel(new DefaultComboBoxModel(new String[] {
- "Ivy",
- "Yew",
- "Maple",
- "Willow",
- "Oak",
- "Regular"
- }));
- //---- Start ----
- Start.setText("Start");
- Start.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- StartActionPerformed(e);
- }
- });
- //---- Exit ----
- Exit.setText("Exit");
- Exit.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- ExitActionPerformed(e);
- }
- });
- //---- label3 ----
- label3.setText("Or");
- //---- label4 ----
- label4.setText("MultiChopper");
- label4.setFont(new Font("Tekton Pro Ext", Font.PLAIN, 36));
- label4.setForeground(Color.red);
- //---- checkBox1 ----
- checkBox1.setText("Powerchop?");
- checkBox1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- checkBox1ActionPerformed(e);
- }
- });
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(132, Short.MAX_VALUE)
- .addComponent(label1)
- .addGap(129, 129, 129))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addGap(87, 87, 87)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(Tree, GroupLayout.Alignment.LEADING, 0, 175, Short.MAX_VALUE)
- .addComponent(Location, GroupLayout.Alignment.LEADING, 0, 175, Short.MAX_VALUE))
- .addGap(82, 82, 82))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(148, Short.MAX_VALUE)
- .addComponent(label2)
- .addGap(131, 131, 131))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(Start, GroupLayout.PREFERRED_SIZE, 145, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
- .addComponent(label3)
- .addGap(18, 18, 18)
- .addComponent(Exit, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(49, Short.MAX_VALUE)
- .addComponent(label4)
- .addGap(37, 37, 37))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(131, 131, 131)
- .addComponent(checkBox1)
- .addContainerGap(130, Short.MAX_VALUE))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label4)
- .addGap(18, 18, 18)
- .addComponent(label1)
- .addGap(18, 18, 18)
- .addComponent(Location, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
- .addGap(18, 18, 18)
- .addComponent(label2)
- .addGap(18, 18, 18)
- .addComponent(Tree, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addGap(18, 18, 18)
- .addComponent(checkBox1)
- .addGap(7, 7, 7)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(Exit, GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
- .addComponent(label3))
- .addGap(33, 33, 33))
- .addComponent(Start, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE))
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - Rudie Visser
- private JComboBox Location;
- private JLabel label1;
- private JLabel label2;
- private JComboBox Tree;
- private JButton Start;
- private JButton Exit;
- private JLabel label3;
- private JLabel label4;
- private JCheckBox checkBox1;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement