Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Stroke;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.RSObject;
- import java.awt.*;
- @ScriptManifest(authors = { "akanerei" }, keywords = { "Willow Chopper" }, name = "AKWillowchopper", version = 1.0, description = "Powerchops willows.")
- public class AKWillowChopper extends Script implements PaintListener {
- private static final int ARK_HEIGHT = 3;
- private static final int ARK_WIDTH = 3;
- int startexp;
- int xpGained = 0;
- int willowID[] = { 5551, 5552, 5553,};
- int hatchetID[] = { 1359,1351, 1349, 1355, 1359, 1353, 6739, 1361, 1357, 13661};
- String status = "Loading...";
- long startTime;
- int percent;
- public Point mousePoint;
- float expHour;
- int noDrop[] = { 1351, 1349, 1361, 1355, 1357, 1359, 1353, 6739, 5070,
- 5071, 5072, 5073, 5074, 5075, 5076, 7413, 11966 };
- public boolean onStart() {
- startexp = skills.getCurrentExp(Skills.WOODCUTTING);
- percent = skills.getPercentToNextLevel(Skills.WOODCUTTING);
- startTime = System.currentTimeMillis();
- log("Script Started...");
- mouse.setSpeed(9);
- return true;
- }
- public void antiban() {
- int b = random(0, 10);
- switch (b) {
- case 1:
- if (random(0, 10) == 5) {
- log("Antiban- move mouse");
- status = "Antiban";
- mouse.moveSlightly();
- sleep(200, 600);
- mouse.moveRandomly(150, 350);
- }
- break;
- case 2:
- if (random(0, 13) == 2) {
- log("Antiban- Turn screen");
- status = "Antiban";
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- }
- break;
- case 3:
- if (random(0, 24) == 6) {
- log("Antiban- mouse off screen");
- mouse.moveOffScreen();
- status = "Antiban";
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 4:
- if (random(0, 18) == 3) {
- log("Antiban- Checking Xp.");
- game.openTab(1);
- status = "Antiban";
- skills.doHover(Skills.INTERFACE_WOODCUTTING);
- sleep(random(2100, 3400));
- }
- break;
- default:
- break;
- }
- }
- // START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(0, 204, 0);
- private final Color color2 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(5);
- private final Font font1 = new Font("Comic Sans MS", 1, 20);
- private final Font font2 = new Font("Comic Sans MS", 1, 10);
- public void onRepaint(Graphics g1) {
- int x = 8;
- int y = 458;
- int h = 15;
- int w = 507;
- if (game.isLoggedIn())
- xpGained = 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;
- Graphics2D g = (Graphics2D) g1;
- g.setColor(color1);
- g.fillRoundRect(287, 344, 206, 111, 16, 16);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRoundRect(287, 344, 206, 111, 16, 16);
- g.setFont(font1);
- g.drawString("AKWillowChopper", 308, 366);
- g.setFont(font2);
- g.drawString("EXP Gained:" + xpGained, 310, 384);
- g.drawString(
- "Percent till next level:%"
- + skills.getPercentToNextLevel(Skills.WOODCUTTING),
- 310, 397);
- g.drawString(
- "Current level:" + skills.getCurrentLevel(Skills.WOODCUTTING),
- 310, 431);
- g.drawString("Status: " + status, 310, 411);
- g.drawString("Time running: " + hours + ":" + minutes + ":"
- + seconds + "." ,310,422);
- g.setColor(new Color(255-(int)(255*((double)percent/100)),(int)(255*((double)percent/100)),0));
- g.fillRoundRect(x,y,w,h,3,3);
- g.setColor(new Color(0,0,0));
- g.drawRoundRect(x,y,w,h,3,3);
- percent=skills.getPercentToNextLevel(Skills.WOODCUTTING);
- }
- public int loop() {
- if (inventory.isFull()) {
- status = "Dropping Willow!";
- inventory.dropAllExcept(hatchetID);
- } else {
- if (getMyPlayer().getAnimation() != 867) {
- RSObject tree = objects.getNearest(willowID);
- if (tree != null) {
- tree.doAction("Chop");
- status = "Chopping Willow!";
- antiban();
- sleep(600, 800);
- }
- }
- }
- return random(100, 200);
- }
- public void onFinish() {
- log("Thank you for using this Script :)");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement