Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////Please do not use any part of this script and claim it as yours, please give proper credits!
- ////Thanks for using my first script ~ GsysSupa
- ////Special thanks to pinkeltje for the ANTIBAM! and GUI
- import java.awt.*;
- import java.awt.event.*;
- import javax.imageio.ImageIO;
- import javax.swing.*;
- import javax.swing.border.*;
- import java.io.IOException;
- import java.net.URL;
- import java.net.MalformedURLException;
- import java.awt.image.BufferedImage;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.Script;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSPath;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.methods.Camera;
- @ScriptManifest(authors = { "GsysSupa" }, keywords = { "Woodcutting Firemaking" }, name = "SupaChop", version = 1.04, description = "Chops Willows then burns em")
- public class SupaChop extends Script implements PaintListener, MessageListener, MouseListener { //Start
- boolean lights = false;
- boolean antibam2 = true;
- boolean bank = false;
- boolean powerchop = false;
- boolean lightlogs = false;
- boolean showpaint = true;
- boolean showFancy = true;
- public long startTime = System.currentTimeMillis();
- int expGained = 0;
- int expGained2 = 0;
- int startExp = 0;
- int startExp2 = 0;
- int Willowschopped = 0;
- int Logslit = 0;
- int lvlsgained = 0;
- int lvlsgained2 = 0;
- private final Color color2 = new Color(0, 0, 0);
- private final Color color11 = new Color(0, 255, 0);
- private final Color color22 = new Color(0, 0, 0, 70);
- private final Color color33 = new Color(0, 255, 0, 50);
- private final Color color44 = new Color(255, 0, 0, 50);
- private final Color color55 = new Color(255, 0, 0);
- private final Font font11 = new Font("Arial Bold", 0, 20);
- private final Font font22 = new Font("Arial Bold", 0, 15);
- private final Font font33 = new Font("Arial Bold", 0, 12);
- private int dontdrop[] = {1351, 1349, 1353, 1355, 1357, 1359, 1361, 590};
- private int logs[] = {1511, 1519};
- private int tree[] = {5551, 5552, 5553, 1308, 38627, 38616, 38627, 2210, 142, 2372, 139};
- Rectangle closeButton = new Rectangle(547, 452, 95, 15);//
- Point p;
- public boolean onStart(){
- SupaChopGUI gui = new SupaChopGUI();
- gui.setVisible(true);
- while (!gui.isReady) {
- sleep(50);
- }
- log("SupaChop Started...");
- startTime = System.currentTimeMillis();
- return true;
- }
- private boolean lightlane() {
- RSArea lane = new RSArea(new RSTile(3010, 3191), new RSTile(2985, 3191));
- return lane.contains(getMyPlayer().getLocation());
- }
- private boolean lightstart() {
- RSArea lane = new RSArea(new RSTile(3007, 3192), new RSTile(3009, 3189));
- return lane.contains(getMyPlayer().getLocation());
- }
- private boolean lightend() {
- RSArea lane = new RSArea(new RSTile(2987, 3190), new RSTile(2984, 3192));
- return lane.contains(getMyPlayer().getLocation());
- }
- @Override
- public int loop() {
- if(inventory.isFull()) {
- if(lightlogs == true){
- walklane();
- if(lightstart()){
- lights = true;
- }
- }
- if(powerchop == true){
- drop();
- }
- } else {
- if(lightlane()){
- if(lightlogs == true){
- light();
- }
- if(lightend()){
- lights = false;
- }
- } else {
- choplogs();
- }
- }
- if(lights == true){
- light();
- }
- return random(600, 800);
- }
- private void choplogs() {
- if (objects.getNearest(tree) != null & !inventory.isFull()) {
- RSObject object = objects.getNearest(tree);
- if (calc.tileOnScreen(object.getLocation())) {
- if (getMyPlayer().getAnimation() == -1) {
- object.doAction("Chop");
- sleep(2000, 2500);
- }
- } else if (!calc.tileOnScreen(object.getLocation())) {
- camera.turnTo(object.getLocation());
- antiBam();
- walking.walkTileMM(objects.getNearest(tree).getLocation());
- sleep(800, 1000);
- }
- sleep(1800, 2000);
- }
- }
- private void light() {
- if(lightlane()){
- if(inventory.contains(590) == true){
- if(getMyPlayer().getAnimation() != 733){
- mouse.setSpeed(random(8, 12));
- if(inventory.contains(1519) == true){
- inventory.useItem(590, 1519);
- camera.setAngle(random(19, 532));
- }
- sleep(random(10, 13));
- }
- }else {
- log("No Tinderbox found, switching to powerchopping");
- lightlogs = false;
- powerchop = true;
- lights = false;
- sleep(random(50, 200));
- }
- }
- }
- private void drop() {
- inventory.dropAllExcept(dontdrop);
- sleep(random(50, 200));
- }
- private void walklane() {
- camera.turnTo(new RSTile(3009, 3191));
- walking.walkTileOnScreen(new RSTile(3009, 3191));
- sleep(594, 1479);
- }
- public void mouseClicked(MouseEvent e) {
- p = e.getPoint();
- if(closeButton.contains(p)){
- showpaint = !showpaint;
- }
- }
- public void mouseEntered(MouseEvent e){
- }
- public void mouseExited(MouseEvent e){
- }
- public void mouseReleased(MouseEvent e){
- }
- public void mousePressed(MouseEvent e){
- }
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- @Override
- public void onRepaint(Graphics g) {
- 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;
- Graphics2D g1 = (Graphics2D)g;
- if(showpaint != true){
- g.setColor(color2);
- g.setFont(font33);
- g.drawString("Show", 552, 463);
- }else {
- // Mouse
- g.setColor(color11);
- g.drawLine(0, (int) (mouse.getLocation().getY()), 800, (int) (mouse.getLocation().getY()));
- g.setColor(color55);
- g.drawLine((int) (mouse.getLocation().getX()), 0, (int) (mouse.getLocation().getX()), 800);
- if(showFancy == true){
- g.setColor(color22);
- g.fillRect(547, 205, 190, 261);
- g.setFont(font33);
- g.setColor(color11);
- g.drawString("Runtime: "+ hours + ": " + minutes + ": " + seconds, 561, 222);
- g.drawString("Wc exp gained: "+ Willowschopped * 67, 561, 240);
- g.drawString("Willows chopped: "+ Willowschopped, 561, 258);
- g.drawString("Wc level: "+ skills.getCurrentLevel(skills.WOODCUTTING), 561, 276);
- g.drawString("Wc levels gained: "+ lvlsgained, 561, 294);
- g.drawString("Willow logs TNL: "+ skills.getExpToNextLevel(skills.WOODCUTTING) /67, 561, 312);
- g.setFont(font22);
- g.drawRect(547, 205, 190, 261);
- g.setFont(font33);
- g.drawString("Hide", 552, 463);//1
- g.drawRect(547, 451, 95, 15);
- g.fillRect(7, 459, 100, 14);
- g.setColor(Color.black);
- g.drawRect(7, 459, 100, 14);
- g.drawImage(img1, 700, 210, null);
- //Progressbar
- final int percent = skills.getPercentToNextLevel(8);
- g.setColor(color33);
- g.fillRect(3, 3, percent*5, 21);
- g.setColor(color11);
- g.setFont(font11);
- g.drawString("Wc " + percent + "%", 250, 21);
- g.setColor(color11);
- g.drawRect(3, 3, percent*5, 21);
- if(lightlogs == true){
- //Fm Progressbar
- final int percent2 = skills.getPercentToNextLevel(11);
- g.setColor(color44);
- g.fillRect(3, 25, percent2*5, 21);
- g.setColor(color55);
- g.setFont(font11);
- g.drawString("Fm " + percent2 + "%", 250, 43);
- g.setColor(color55);
- g.drawRect(3, 25, percent2*5, 21);
- g.setFont(font33);
- g.setColor(color55);
- g.drawString("Fm exp gained: "+ Logslit * 90, 561, 348);
- g.drawString("Logs burned: "+ Logslit, 561, 366);
- g.drawString("Fm level: "+ skills.getCurrentLevel(skills.FIREMAKING), 561, 384);
- g.drawString("Fm levels gained: "+ lvlsgained2, 561, 402);
- g.drawString("Logs to burn TNL: "+ skills.getExpToNextLevel(skills.FIREMAKING) /67, 561, 420);
- g.drawString("Burning Logs", 647, 463);
- g.drawRect(642, 451, 95, 15);
- }
- if(powerchop == true){
- g.setFont(font33);
- g.setColor(color11);
- g.drawString("Powerchopping", 647, 463);
- g.drawRect(642, 451, 95, 15);
- }
- }
- }
- }
- public void antiBam() { //ANTIBAM! made by pinkeltje
- int b = random(0, 10);
- switch (b) {
- case 1:
- if(antibam2 == true){
- mouse.moveSlightly();
- sleep(500, 800);
- break;
- }
- case 2:
- if(antibam2 == true){
- mouse.moveRandomly(11, 51);
- sleep(2000, 1000);
- break;
- }
- case 3:
- if(antibam2 == true){
- mouse.moveOffScreen();
- sleep(2000, 3000);
- break;
- }
- case 4:
- if(antibam2 == true){
- camera.moveRandomly(random(800, 1300));
- sleep(1500, 1000);
- break;
- }
- case 5:
- if(antibam2 == true){
- camera.moveRandomly(random(700, 1000));
- mouse.moveRandomly(10, 50);
- break;
- }
- case 6:
- if(antibam2 == true){
- game.openTab(1);
- skills.doHover(skills.INTERFACE_WOODCUTTING);
- sleep(random(1000, 1100));
- break;
- }
- case 7:
- if(antibam2 == true){
- skills.doHover(skills.INTERFACE_FIREMAKING);
- camera.moveRandomly(random(100, 999));
- mouse.moveRandomly(40, 60);
- sleep(1000, 1200);
- }
- }
- }
- public void messageReceived(MessageEvent e) {
- String txt = e.getMessage();
- if(txt.contains("You get some willow logs")) {
- Willowschopped++;
- }
- if(txt.contains("The fire catches and the logs begin to burn.")) {
- Logslit++;
- }
- if(txt.contains("Woodcutting level!")) {
- lvlsgained++;
- }
- if(txt.contains("Firemaking level!")) {
- lvlsgained2++;
- }
- }
- public void onFinish(){
- log("Thank you for using my first script");
- }
- @SuppressWarnings("serial")
- public class SupaChopGUI extends JFrame {//GUI made by pinkeltje
- private boolean isReady;
- public SupaChopGUI() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- String chosen = comboBox1.getSelectedItem().toString();
- if(chosen.equals("Powerchop")) {
- powerchop = true;
- }
- if(chosen.equals("Light logs")) {
- lightlogs = true;
- }
- setVisible(false);
- isReady = true;
- }
- private void initComponents() {
- label1 = new JLabel();
- comboBox1 = new JComboBox();
- button1 = new JButton();
- //======== this ========
- setTitle("SupaChop");
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Woodcutting type?");
- label1.setFont(new Font("Georgia Ref", Font.PLAIN, 20));
- //---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Light logs",
- "Powerchop"
- }));
- comboBox1.setFont(new Font("Georgia Ref", Font.PLAIN, 11));
- comboBox1.setBorder(new EtchedBorder());
- //---- button1 ----
- button1.setText("Start SupaChop");
- button1.setFont(new Font("Georgia Ref", Font.PLAIN, 11));
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(30, 30, 30)
- .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, 124, GroupLayout.PREFERRED_SIZE))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(19, 19, 19)
- .addComponent(button1, GroupLayout.PREFERRED_SIZE, 146, GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(4, 4, 4)
- .addComponent(label1)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(button1)
- .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- pack();
- setLocationRelativeTo(getOwner());
- }
- private JLabel label1;
- private JComboBox comboBox1;
- private JButton button1;
- }
- } //End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement