Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.Script;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.event.events.ServerMessageEvent;
- import java.awt.*;
- import javax.imageio.ImageIO;
- import java.io.IOException;
- import java.net.URL;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSCharacter;
- import org.rsbot.script.methods.Mouse;
- @ScriptManifest(authors = { "Neverbeen" }, keywords = { "woodcut firemaking" }, name = "Slash N' Burn", version = 2.00, description = "Cuts willows, then burns them!")
- public class SlashNBurn extends Script implements PaintListener {
- RSTile[] SlashToBurn = { new RSTile(2990,3187), new RSTile(2997,3191), new RSTile(3009, 3191)};
- RSTile[] EndToSlash = { new RSTile(2984,3191), new RSTile(2990,3187)};
- RSTile[] BurnToSlash = { new RSTile(3009, 3191), new RSTile(2997,3191), new RSTile(2990,3187)};
- public boolean Burning = false;
- public boolean Cleaned = false;
- private boolean BurnZone = false;
- private boolean ChopZone = false;
- private boolean EndZone = false;
- public int percent; //declare variables
- public int percent2;
- private int Idle = 0;
- int currentXP2;
- int currentXP;
- int startXP;
- int startXP2;
- int gainedXP;
- int gainedXP2;
- private String status = "Loading...";
- private int WILLOW_TREE[] = {5552, 5551}; //trees
- private int Keepers[] = {1359, 1351, 1349, 1353, 1361, 1357, 1355, 590, 1519}; //tinderbox and hatchets, and willow logs
- private int Logs = 1519;
- private int Tinderbox = 590;
- public long startTime = System.currentTimeMillis();
- private final Color color1 = new Color(153, 102, 0, 205);
- private final Color color2 = new Color(0, 0, 0, 230);
- private final Color color3 = new Color(51, 204, 0, 205);
- private final Color color4 = new Color(51, 153, 0, 205);
- private final Color color5 = new Color(0, 0, 0);
- private final Color color6 = new Color(255, 153, 0, 205);
- private final Color color7 = new Color(0, 0, 0, 205);
- private final Color color8 = new Color(255, 0, 0, 205);
- private final Color color9 = new Color(153, 0, 0, 205);
- private final Color color10 = new Color(0, 0, 0, 180);
- private final Color color11 = new Color(255, 255, 255);
- private final Color color12 = new Color(255, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(3);
- private final Font font1 = new Font("Arial", 1, 12);
- final int startingFire = 733;
- public boolean onStart(){
- startXP = skills.getCurrentExp(Skills.WOODCUTTING);
- startXP2 = skills.getCurrentExp(Skills.FIREMAKING);
- log("Script Started..");
- return true;
- }
- public void antiban() { //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, 24) == 6) {
- log("[Antiban] mouse off screen");
- status = "Antiban";
- mouse.moveOffScreen();
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 3:
- if (random(0, 18) == 3) {
- log("[antiban] Checking Xp.");
- status = "Antiban";
- game.openTab(1);
- skills.doHover(skills.INTERFACE_WOODCUTTING);
- sleep(random(2100, 3400));
- }
- break;
- default:
- break;
- }
- } // End antiban
- public boolean ChopZone(){
- RSArea area = new RSArea(new RSTile(2986,3183), new RSTile(2992,3190));
- return area.contains(getMyPlayer().getLocation());
- }
- public boolean BurnZone(){
- RSArea area = new RSArea(new RSTile(3008,3191), new RSTile(3009, 3191));
- return area.contains(getMyPlayer().getLocation());
- }
- public boolean EndZone(){
- RSArea area = new RSArea(new RSTile(2984,3190), new RSTile(2985, 3192));
- return area.contains(getMyPlayer().getLocation());
- }
- public boolean FireLane(){
- RSArea area = new RSArea(new RSTile(2985, 3191), new RSTile(3009, 3191));
- return area.contains(getMyPlayer().getLocation());
- }
- public void onRepaint(Graphics g1) {
- percent = skills.getPercentToNextLevel(Skills.WOODCUTTING);
- percent2 = skills.getPercentToNextLevel(Skills.FIREMAKING);
- currentXP = skills.getCurrentExp(Skills.WOODCUTTING);
- currentXP2 = skills.getCurrentExp(Skills.FIREMAKING);
- gainedXP = currentXP - startXP;
- gainedXP2 = currentXP2 - startXP2;
- 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(color10);
- g.fillRect(337, 310, 182, 28);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(337, 310, 182, 28);
- g.setColor(color3);
- g.fillRect(339, 312, (int) (percent * 178 / 100.0), 11);
- g.setColor(color4);
- g.fillRect(339, 323, (int) (percent * 178 / 100.0), 14);
- g.setFont(font1);
- g.setColor(color11);
- g.drawString("Slash Xp: " + gainedXP, 341, 328);
- g.setColor(color10);
- g.fillRect(337, 282, 182, 26);
- g.setColor(color7);
- g.drawRect(337, 282, 182, 26);
- g.setColor(color8);
- g.fillRect(339, 284, (int) (percent2 * 178 / 100.0), 14);
- g.setColor(color9);
- g.fillRect(339, 298, (int) (percent2 * 178 / 100.0), 9);
- g.setColor(color11);
- g.drawString("Burn Xp: " + gainedXP2, 343, 300);
- g.setColor(color10);
- g.fillRect(337, 252, 181, 28);
- g.setColor(color5);
- g.drawRect(337, 252, 181, 28);
- g.setColor(color11);
- g.drawString("| " + hours + ":" + minutes + ":" + seconds, 380, 270);
- g.drawString("|", 479, 270);
- g.setColor(color10);
- g.fillRect(337, 230, 180, 21);
- g.setColor(color5);
- g.drawRect(337, 230, 180, 21);
- g.setColor(color11);
- g.drawString("[Nvr] Slash N' Burn", 378, 245);
- }
- public int loop(){
- mouse.setSpeed(random(4, 7));
- if(!inventory.isFull()){ //if my inventory isnt full
- if(ChopZone()){ //and im in the slashzone
- if(getMyPlayer().getAnimation() != 867){ //and im not chopping logs
- RSObject tree = objects.getNearest(WILLOW_TREE); //find the nearest tree
- if(tree != null){
- tree.doAction("Chop"); //and chop that shit
- status = "Chopping";
- sleep(720, 1232);
- antiban();
- }
- }
- }
- }
- if(inventory.isFull()){ //if my inventory is full
- if(!BurnZone()){ //and im not in the burnzone
- walking.walkPathMM(SlashToBurn);
- status = "Walking to BurnZone";
- antiban();
- sleep(random(1400, 2200));
- walking.walkPathOnScreen(SlashToBurn); //walk to the burnzone
- sleep(random(1400, 2200));
- }
- }
- if(FireLane()){ //if im in the Firelane
- while(getMyPlayer().getAnimation() == startingFire) //if im lighting a fire
- sleep(50); //wait
- if(inventory.getItem(Logs) != null){
- inventory.getItem(Tinderbox).doAction("Use"); //if not, light a fire
- status = "Burning";
- sleep(random(336, 630));
- while (inventory.isItemSelected()) {
- inventory.getItem(Logs).doAction("Use");
- antiban();
- }
- }else{
- walking.walkPathMM(BurnToSlash);
- sleep(random(1400, 2200));
- }
- }
- if(EndZone()){ //if ive entered the endzone
- sleep(random(2200, 2900));
- walking.walkPathMM(EndToSlash); //walk back to the slash zone
- status = "Walking to SlashZone";
- antiban();
- sleep(random(2200, 2900));
- }
- if(getMyPlayer().getAnimation() == -1){
- Idle++;
- }
- if(Idle >= 400){
- walking.walkPathMM(BurnToSlash);
- log("Resetting");
- Idle = 0;
- }
- return random(120, 201);
- }
- public void onFinish(){
- env.saveScreenshot(true);
- log("Shutting down script...");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement