Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Game.Tab;
- import org.rsbot.script.methods.Skills;
- import java.awt.*;
- @ScriptManifest(authors = "Zh3", description = "Cuts Wu", keywords = "woodcutting", name = "ZhChop", version = 1.00)
- public class ZhChop extends Script implements PaintListener {
- @Override
- public boolean onStart() {
- log("Welcome To My First Script! ZhChop");
- return game.isLoggedIn();
- }
- // What it will say when the script is stopped !
- @Override
- public void onFinish() {
- log("Thanks for using my first script! Feedback please(:");
- }
- // What it will be chopping or going to !
- private void Chop() {
- final RSObject Tree = objects.getNearest(38616, 38627, 58006);
- if (Tree.isOnScreen() && Tree != null) {
- if (getMyPlayer().getAnimation() == -1) {
- if (Tree.interact("Chop down")) {
- sleep(random(1500, 2000));
- while (players.getMyPlayer().isMoving()
- && Tree.isOnScreen() && Tree != null) {
- sleep(random(200, 800));
- }
- }
- }
- }
- }
- private void dropAll() {
- inventory.dropAllExcept( 1349, 1351, 1353, 1355, 1357, 1359, 1361, 6739,
- 13470);
- }
- public int loop() {
- if (!inventory.isFull()) {
- Chop();
- } else {
- if (inventory.isFull()){
- dropAll();
- }
- }
- if (getMyPlayer().getAnimation() != -1) {
- antiBan();
- }
- return random(200,800);
- }
- // Antiban methods
- private void antiBan() {
- switch (random(1, 20)) {
- case 1:
- camera.moveRandomly(560);
- break;
- case 3:
- mouse.moveOffScreen();
- sleep(random(1000, 2000));
- break;
- case 4:
- skills.doHover(Skills.INTERFACE_WOODCUTTING);
- sleep(random(100, 700));
- game.openTab(Game.Tab.INVENTORY);
- break;
- case 5:
- skills.doHover(Skills.INTERFACE_MINING);
- sleep(random(200, 500));
- game.openTab(Game.Tab.INVENTORY);
- break;
- case 6:
- camera.moveRandomly(400);
- break;
- case 7:
- skills.doHover(Skills.INTERFACE_FIREMAKING);
- sleep(random(300, 500));
- game.openTab(Game.Tab.INVENTORY);
- break;
- case 8:
- camera.moveRandomly(100);
- break;
- case 9:
- skills.doHover(Skills.INTERFACE_FISHING);
- sleep(random(800, 1000));
- break;
- case 13:
- mouse.moveOffScreen();
- sleep(random(600, 1000));
- break;
- case 17:
- mouse.moveSlightly();
- break;
- case 18:
- mouse.moveRandomly(25, 100);
- sleep(random(1000, 1100));
- break;
- case 19:
- camera.setAngle (random(0, 165));
- camera.setPitch(random(100, 500));
- break;
- case 20:
- mouse.moveSlightly();
- break;
- }
- }
- //START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(51, 255, 255);
- private final Color color2 = new Color(255, 51, 51);
- private final Color color3 = new Color(0, 0, 0);
- private final Color color4 = new Color(0, 204, 51);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 0, 9);
- private final Font font2 = new Font("Arial", 1, 15);
- private final Font font3 = new Font("Arial", 1, 12);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.fillRect(10, 351, 486, 103);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(10, 351, 486, 103);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("Time Running:", 17, 372);
- g.drawString("Time Till Level:", 15, 396);
- g.drawString("Exp Gained:", 17, 418);
- g.drawString("Exp Per Hour:", 13, 440);
- g.drawString("Profit Gained:", 199, 370);
- g.drawString("Profit Per Hour:", 199, 388);
- g.drawString("Logs Cut:", 206, 403);
- g.drawString("Logs Per Hour:", 201, 420);
- g.drawString("Logs Till Next Level:", 186, 439);
- g.setFont(font2);
- g.drawString("ZhChopper by Zh3", 340, 373);
- g.setFont(font3);
- g.drawString("First Script!", 360, 415);
- g.fillRoundRect(17, 320, 489, 12, 16, 16);
- g.setColor(color2);
- g.drawRoundRect(17, 320, 489, 12, 16, 16);
- g.fillRoundRect(323, 321, 178, 9, 16, 16);
- g.drawRoundRect(323, 321, 178, 9, 16, 16);
- g.setColor(color4);
- g.fillRoundRect(22, 322, 319, 9, 16, 16);
- g.drawRoundRect(22, 322, 319, 9, 16, 16);
- }
- //END: Code generated using Enfilade's Easel
- }
Add Comment
Please, Sign In to add comment