Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Map;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.util.Filter;
- import java.awt.*;
- import javax.swing.JFileChooser;
- import javax.swing.JOptionPane;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.FileWriter;
- import java.io.InputStreamReader;
- import java.net.URLConnection;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- @ScriptManifest(authors = { "Zezerex" }, keywords = { "Draynor Willow Chopper with banking." }, name = "ZezDraynorWillows", version = 1.0, description = "Cuts Willow Trees and banks the logs.")
- public class ZezDraynorWillows extends Script implements PaintListener {
- private int willowlogsID = (1519);
- RSTile[] banktoTrees = { new RSTile(3092, 3243), new RSTile(3086, 3234),};
- private int bankboothID[] = {2213, 9398};
- private int willowID[] = {5551, 5552, 5553};
- public int startExp = 0;
- public int gainedExp = 0;
- public int startLvl = 0;
- RSTile[] Treestobank = { new RSTile(3086, 3234), new RSTile(3092, 3243),};
- private int hatchetsID[] = {1351, 1349, 1353, 1361, 1355, 1357, 1359};
- private String status = "Loading...";
- public long startTime = System.currentTimeMillis();
- public boolean onStart() {
- mouse.setSpeed(6);
- log("Zez draynor willows v1.0!");
- return true;
- }
- private boolean atTrees(){
- RSArea area = new RSArea(new RSTile(3081, 3240), new RSTile(3091, 3225));
- return area.contains(getMyPlayer().getLocation());
- }
- private boolean atBank(){
- RSArea area = new RSArea(new RSTile(3092, 3246), new RSTile(3095, 3240));
- return area.contains(getMyPlayer().getLocation());
- }
- private boolean walkToTreesFromBank(){
- RSTile[] randompath = walking.randomizePath(banktoTrees, 1, 1);
- return walking.walkPathMM(randompath, 15);
- }
- private boolean walkToBankFromTrees(){
- RSTile[] randompath = walking.randomizePath(Treestobank, 1, 1);
- return walking.walkPathMM(randompath, 15);
- }
- //START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(0, 0, 0, 218);
- private final Color color2 = new Color(0, 255, 255);
- private final BasicStroke stroke1 = new BasicStroke(2);
- private final Font font1 = new Font("Comic Sans MS", 0, 12);
- private final Font font2 = new Font("Comic Sans MS", 0, 10);
- public void onRepaint(Graphics g1) {
- 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;
- int gainedExp = 0;
- if (startExp == 0) {
- startExp = skills.getCurrentExp(skills.WOODCUTTING);
- }
- gainedExp = skills.getCurrentExp(skills.WOODCUTTING) - startExp;
- g.setColor(color1);
- g.fillRect(363, 268, 153, 69);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(363, 268, 153, 69);
- g.setFont(font1);
- g.drawString("Zez Draynor Willows", 381, 280);
- g.setFont(font2);
- g.drawString("Levels Gained:" + startLvl, 365, 292);
- g.drawString("Exp Gained:" + gainedExp, 365, 303);
- g.drawString("Time Running:" + hours + ":" + minutes + ":" + seconds, 364, 314);
- g.drawString("Status:" + status, 365, 325);
- g.drawString("v1.0", 494, 333);
- Point tempPoint = mouse.getLocation();
- int tempXCoordinate = (int)tempPoint.getX();
- int tempYCoordinate = (int)tempPoint.getY();
- g.setColor(new Color(0,255,0,100));
- g.drawLine(tempXCoordinate,0,tempXCoordinate,501);
- g.drawLine(0,tempYCoordinate,764,tempYCoordinate);
- }
- //END: Code generated using Enfilade's Easel
- public void antiban(){
- int b = random(0, 10);
- switch (b) {
- case 1:
- if(random (0, 10) == 5) {
- log("Antiban- Moving mouse");
- mouse.moveSlightly();
- sleep(200, 600);
- mouse.moveRandomly(200, 450);
- }
- break;
- case 2:
- if (random (0, 8) == 4) {
- log("Antiban- Turning screen");
- status = "Antiban";
- camera.setAngle (random (30, 70));
- sleep(400, 1200);
- }
- break;
- case 3:
- if (random (0, 12) == 7) {
- log("Antiban- Small AFK");
- status = "Antiban";
- mouse.moveOffScreen();
- sleep(random(5600, random(7200, 9000)));
- }
- break;
- case 4:
- if (random (0, 10) == 3) {
- log("Antiban- Checking experience");
- status = "Antiban";
- game.openTab(1);
- skills.doHover(Skills.INTERFACE_WOODCUTTING);
- sleep(random(3000, 4500));
- }
- break;
- case 5:
- if (random (1, 18) == 15) {
- log("Antiban- Checking experience");
- status = "Antiban";
- game.openTab(1);
- skills.doHover(Skills.INTERFACE_WOODCUTTING);
- sleep(random(3000, 4500));
- }
- break;
- case 6:
- if (random (1, 19) == 5) {
- log("Antiban- Checking experience");
- status = "Antiban";
- game.openTab(1);
- skills.doHover(Skills.INTERFACE_WOODCUTTING);
- sleep(random(3000, 4500));
- }
- break;
- case 7:
- if (random (1, 17) == 15) {
- log("Antiban- Checking experience");
- status = "Antiban";
- game.openTab(1);
- skills.doHover(Skills.INTERFACE_MINING);
- sleep(random(3000, 4500));
- }
- break;
- default:
- break;
- }
- }
- private void useBank(){
- RSObject bankBooth = objects.getNearest(bankboothID);
- if(bankBooth != null && inventory.contains(willowlogsID)){
- bankBooth.doAction("Use-quickly");
- sleep(800, 1000);
- }
- }
- private void depositWillowLogs(){
- if(bank.isOpen()){
- bank.deposit(willowlogsID, 0);
- sleep(300, 600);
- }
- }
- private void closeBank(){
- if(bank.isOpen()){
- mouse.move(490, 36, 3, 3);
- sleep(300, 600);
- mouse.click(true);
- }
- }
- private void Bank(){
- useBank();
- depositWillowLogs();
- closeBank();
- }
- private void Chop(){
- if (getMyPlayer().getAnimation() != 867){
- RSObject tree = objects.getNearest(willowID);
- if(tree != null);
- status = "Chopping Willows!";
- tree.doAction("Chop");}
- antiban();
- sleep(1200, 1500);
- }
- public void onFinish(){
- log("Finished Zez Draynor Abuse!");
- }
- @Override
- public int loop() {
- if(atTrees() && inventory.isFull()){
- status = "Walking to Bank!";
- walkToBankFromTrees();
- }else if(atBank() && inventory.contains(willowlogsID)){
- status = "Banking your logs!";
- Bank();
- }else if(atTrees() && !inventory.isFull()){
- status = "Chopping Willows!";
- Chop();
- }else if(atBank() && !inventory.contains(willowlogsID)){
- status = "Walking to Willows!";
- walkToTreesFromBank();
- }
- return random(500, 1300);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement