Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import java.awt.*;
- import org.rsbot.event.listeners.PaintListener;
- @ScriptManifest(authors = "Zh3", description = "First Script! Cuts Willows!", keywords = "woodcutting", name = "ZhChop", version = 1.00)
- public class ZhChopper 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 script");
- }
- // 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));
- }
- }
- }
- }
- //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}
- @Override
- public int loop() {
- antiBan();
- if (inventory.isFull()) {
- inventory.dropAllExcept(1359);
- } else {
- Chop();
- }
- return random(200, 800);
- }
- // Antiban methods
- private void antiBan() {
- switch (random(1, 20)) {
- case 1:
- camera.moveRandomly(560);
- break;
- case 6:
- camera.moveRandomly(400);
- break;
- case 13:
- camera.moveRandomly(100);
- break;
- case 8:
- mouse.moveOffScreen();
- break;
- case 17:
- mouse.moveSlightly();
- }
- }
- }
Add Comment
Please, Sign In to add comment