- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.util.Map;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.methods.Skills;
- @ScriptManifest(authors = { "Krypsis" }, name = "Krypt-Cutter", category = "Woodcutting", version = 1.1, description = "<html><body><b><center><font size='8' color='Red'>Krypt-Cutter</center></b><br/></font>"
- + "<center>Made By Krypsis"
- + "<br>Version: 1.01</br>"
- + "<br>Log To Cut:<br>"
- + "<select name='treeLoc'>"
- + "<option>Willows (Draynor)</option>"
- + "<option>Willows (Rimmington)</option>"
- + "<br></br>"
- + "<br>Power-Cut Logs:"
- + "<select name='powerCut'>"
- + "<option>No</option>"
- + "<option>Yes</option>"
- + "<br>Start At Location Selected</br><br></center>")
- /*-----------------------------------------------------------
- *- This Script Is Trademarked By KrYpSiS of "www.RSBot.org"-
- *- This Script Is Not To Be Released Under False Name -
- *- Or Reproduced Without Permission Of The User "KrYpSiS". -
- *-----------------------------------------------------------
- * Thank You For Your Time,
- * > Krypt-Cutterâ„¢
- *@ScriptStart Extend Script Implements ServerMessageListener
- */
- public class KryptCutter extends Script implements ServerMessageListener,
- PaintListener {
- // ID's
- public RSArea bankArea = new RSArea(new RSTile(0000, 0000), new RSTile(
- 0000, 0000));
- public RSArea treeArea = new RSArea(new RSTile(0000, 0000), new RSTile(
- 0000, 0000));
- // Willow (Rimmington) Walking Spot's
- public double toLvl = 0;
- public double willowXP = 67.5;
- public double wcXP = 0;
- public long curXPToLvl;
- public long Lvl;
- public long seconds;
- public long minutes;
- public long hours;
- public long runTime;
- public long startTime = System.currentTimeMillis();
- public int amount = 0;
- public int axeID[] = { 1351, 1352, 1349, 1350, 1353, 1354, 1355, 1356,
- 1357, 1358, 1359, 1360 };
- public int[] bankBoothID = { 2213 };
- public int logID = 0;
- public int willowID[] = { 5551, 5552, 5553 };
- public int wcLvl = Skills.WOODCUTTING;
- public int wilChopped = 0;
- public int treeSpot;
- public int powerCut;
- public String status;
- public String location;
- private void mouseSpeed() {
- mouse.setSpeed(random(6, 8));
- }
- public void onRepaint(final Graphics g) {
- if (game.isLoggedIn()) {
- // Credits To Garrett For This Timer.
- runTime = System.currentTimeMillis() - startTime;
- seconds = runTime / 1000;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= (minutes * 60);
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= (hours * 60);
- }
- Lvl = (int) skills.getCurrentLevel(Skills.WOODCUTTING);
- toLvl = skills.getExpToNextLevel(Skills.WOODCUTTING) / 67.5;
- g.setColor(new Color(0, 0, 0, 120));
- g.fill3DRect(545, 203, 195, 264, true);
- g.setColor(Color.white);
- g.drawImage(null, 560, 380, null);
- g.setFont(new Font("papyrus", Font.BOLD, 14));
- g.drawString("Krypt-Cutter v1.01", 560, 232);
- g.setColor(Color.pink);
- g.drawString("Krypt-Cutter v1.01", 561, 233);
- g.setColor(Color.cyan);
- g.setFont(new Font("sansserif", Font.BOLD, 12));
- g.drawString("Run Time: " + hours + " : " + minutes + " : "
- + seconds, 560, 250);
- g.drawString("Logs Cut: " + wilChopped, 560, 268);
- g.drawString("XP Gained: " + wcXP, 560, 286);
- g.drawString("Logs Till Level: " + Math.round(toLvl), 560, 304);
- g.setFont(new Font("sansserif", Font.BOLD, 13));
- g.setColor(Color.red);
- g.drawString("Status: " + status, 560, 322);
- g.drawString("Area: " + location, 560, 340);
- g.setColor(Color.white);
- g.drawString("Woodcutting Level: " + Lvl, 560, 362);
- }
- }
- public boolean onStart(Map<String, String> args) {
- log("Krypt-Cutter Successfully Started!");
- // GUI Settings
- if (args.get("treeLoc").equals("Willows (Draynor)")) {
- // Willows (Draynor)
- location = "Willows (Draynor)";
- treeSpot = 1;
- logID = 1519;
- bankArea = new RSArea(new RSTile(3091, 3239),
- new RSTile(3097, 3247));
- treeArea = new RSArea(new RSTile(3085, 3224),
- new RSTile(3091, 3239));
- } else if (args.get("treeLoc").equals("Willows (Rimmington)")) {
- // Willows (Rimmington)
- location = "Willows (Rimmington)";
- treeSpot = 2;
- logID = 1519;
- bankArea = new RSArea(new RSTile(3091, 3239),
- new RSTile(3097, 3247));
- treeArea = new RSArea(new RSTile(3056, 3250),
- new RSTile(3066, 3257));
- }
- if(args.get("powerCut").equals("No")) {
- powerCut = 0;
- } else if(args.get("powerCut").equals("Yes")) {
- powerCut = 1;
- }
- return true;
- }
- public boolean onFinish(Map<String, String> args) {
- log("Thank You For Using Krypt-Cutter.");
- log("You've Gained " + wcXP + " xp");
- log("Chopped " + wilChopped + " Logs");
- log("Please Donate To Keep This Script Going!");
- return true;
- }
- public void serverMessageRecieved(final ServerMessageEvent e) {
- final String word = e.getMessage().toLowerCase();
- if (word.contains("you get some willow logs")) {
- wilChopped++;
- wcXP = wcXP + willowXP;
- }
- }
- private void chopTrees() {
- if (treeSpot == 1) {
- // Willows (Draynor)
- final RSObject willows = objects.getNearest(willowID);
- if (treeArea.contains(getMyPlayer().getLocation())
- && getMyPlayer().getAnimation() == -1
- && !getMyPlayer().isMoving()) {
- if (calc.distanceTo(willows) < 12) {
- status = "Chopping Trees!";
- willows.doAction("Chop");
- sleep(1000, 1250);
- cameraAntiBan();
- }
- }
- } else if (treeSpot == 2) {
- // Willows (Rimmington)
- final RSObject willows = objects.getNearest(willowID);
- if (treeArea.contains(getMyPlayer().getLocation())
- && getMyPlayer().getAnimation() == -1
- && !getMyPlayer().isMoving()) {
- if (calc.distanceTo(willows) < 15) {
- status = "Chopping Trees!";
- willows.doAction("Chop");
- sleep(1000, 1250);
- cameraAntiBan();
- }
- }
- }
- }
- private void toTrees() {
- status = "Running To Trees!";
- if (treeSpot == 1) {
- final int random = random(1, 4);
- if (random == 1 && !getMyPlayer().isMoving()) {
- walking.walkTileMM(walking.randomizeTile(
- new RSTile(3088, 3237), 2, 2));
- cameraAntiBan();
- sleep(4750, 5500);
- } else if (random == 2 && !getMyPlayer().isMoving()) {
- walking.walkTileMM(walking.randomizeTile(
- new RSTile(3090, 3233), 2, 2));
- cameraAntiBan();
- sleep(4750, 5500);
- } else if (random == 3 && !getMyPlayer().isMoving()) {
- walking.walkTileMM(walking.randomizeTile(
- new RSTile(3086, 3233), 2, 2));
- cameraAntiBan();
- sleep(4750, 5500);
- } else if (random == 4 && !getMyPlayer().isMoving()) {
- walking.walkTileMM(walking.randomizeTile(
- new RSTile(3089, 3230), 2, 2));
- cameraAntiBan();
- sleep(4750, 5500);
- } else {
- return;
- }
- } else if (treeSpot == 2) {
- final int random = random(1, 2);
- if(random == 1 && !getMyPlayer().isMoving()) {
- cameraAntiBan();
- walking.walkPathMM(walking.randomizePath(new RSTile[] {
- new RSTile(3093, 3244),
- new RSTile(3093, 3243),
- new RSTile(3081, 3250),
- new RSTile(3070, 3261),
- new RSTile(3059, 3253) }, 2, 2));
- cameraAntiBan();
- } else if (random == 2 && !getMyPlayer().isMoving()) {
- cameraAntiBan();
- walking.walkPathMM(walking.randomizePath(new RSTile[] {
- new RSTile(3082, 3253),
- new RSTile(3074, 3264),
- new RSTile(3065, 3265),
- new RSTile(3061, 3253) }, 2, 2));
- cameraAntiBan();
- }
- }
- }
- private void toBank() {
- status = "Running To Bank!";
- if (treeSpot == 1) {
- final int random = random(1, 3);
- if (random == 1 && !getMyPlayer().isMoving()) {
- walking.walkTileMM(walking.randomizeTile(
- new RSTile(3093, 3243), 2, 2));
- cameraAntiBan();
- sleep(4750, 5500);
- } else if (random == 2 && !getMyPlayer().isMoving()) {
- walking.walkTileMM(walking.randomizeTile(
- new RSTile(3094, 3244), 2, 2));
- cameraAntiBan();
- sleep(4750, 5500);
- } else if (random == 3 && !getMyPlayer().isMoving()) {
- walking.walkTileMM(walking.randomizeTile(
- new RSTile(3094, 3242), 2, 2));
- cameraAntiBan();
- sleep(4750, 5500);
- } else {
- return;
- }
- } else if (treeSpot == 2) {
- final int random = random(1, 2);
- if (random == 1 && !getMyPlayer().isMoving()) {
- cameraAntiBan();
- walking.walkPathMM(walking.randomizePath(new RSTile[] {
- new RSTile(3059, 3253),
- new RSTile(3064, 3264),
- new RSTile(3075, 3264),
- new RSTile(3079, 3250),
- new RSTile(3090, 3248),
- new RSTile(3093, 3244) }, 2, 2));
- cameraAntiBan();
- } else if (random == 2 && !getMyPlayer().isMoving()) {
- cameraAntiBan();
- walking.walkPathMM(walking.randomizePath(new RSTile[] {
- new RSTile(3061, 3265),
- new RSTile(3072, 3269),
- new RSTile(3073, 3254),
- new RSTile(3085, 3249),
- new RSTile(3093, 3243) }, 2, 2));
- cameraAntiBan();
- }
- }
- }
- private void useBank() {
- status = "Banking!";
- final RSObject banker = objects.getNearest(bankBoothID);
- if (calc.distanceTo(banker) < 10) {
- if (bank.isOpen()) {
- if (inventory.getCount(logID) == amount) {
- bank.depositAllExcept(axeID);
- sleep(500, 600);
- bank.close();
- statAntiBan();
- }
- } else {
- banker.doAction("Use-Quickly ");
- sleep(950, 1250);
- }
- } else {
- toBank();
- sleep(1000, 2000);
- }
- }
- private void cameraAntiBan() {
- final int angNumb = random(1, 100);
- final int altNumb = random(1, 100);
- if (angNumb == 59 || angNumb == 98 || angNumb == 12) {
- camera.setAngle(random(-90, 180));
- } else if (angNumb == 77) {
- camera.setAngle(random(-180, 180));
- camera.setAltitude(true);
- }
- if (altNumb == 47) {
- camera.setAltitude(true);
- } else if (altNumb == 29) {
- camera.setAltitude(false);
- }
- }
- @SuppressWarnings( { "static-access" })
- public void statAntiBan() {
- final int wcCheck = random(1, 20);
- if (wcCheck == 2 || wcCheck == 15) {
- if (game.getCurrentTab() != game.TAB_STATS) {
- game.openTab(game.TAB_STATS);
- }
- mouse.move(692, 358, 28, 10);
- }
- sleep(1000, 1100);
- }
- public int loop() {
- if (game.isLoggedIn()) {
- mouseSpeed();
- if (inventory.getCount(axeID) == 1) {
- amount = 27;
- } else {
- amount = 28;
- }
- if (!treeArea.contains(getMyPlayer().getLocation())
- && inventory.getCount(logID) < amount) {
- toTrees();
- sleep(750, 1125);
- } else if (treeArea.contains(getMyPlayer().getLocation())
- && inventory.getCount(logID) < amount) {
- chopTrees();
- } else if (treeArea.contains(getMyPlayer().getLocation())
- && inventory.isFull()
- && powerCut == 0) {
- toBank();
- sleep(750, 1125);
- } else if (!bankArea.contains(getMyPlayer().getLocation())
- && inventory.isFull()
- && powerCut == 0) {
- toBank();
- sleep(750, 1125);
- } else if (bankArea.contains(getMyPlayer().getLocation())
- && inventory.isFull()
- && powerCut == 0) {
- useBank();
- sleep(750, 1125);
- } else if(treeArea.contains(getMyPlayer().getLocation())
- && inventory.isFull()
- && powerCut == 1) {
- status = "Dropping Logs!";
- inventory.dropAllExcept(axeID);
- sleep(300, 400);
- }
- if (walking.getEnergy() > 40) {
- walking.setRun(true);
- sleep(200, 300);
- }
- }
- return 0;
- }
- }