Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 11.66 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.awt.Color;
  2. import java.awt.Font;
  3. import java.awt.Graphics;
  4. import java.util.Map;
  5.  
  6. import org.rsbot.event.events.ServerMessageEvent;
  7. import org.rsbot.event.listeners.PaintListener;
  8. import org.rsbot.event.listeners.ServerMessageListener;
  9. import org.rsbot.script.Script;
  10. import org.rsbot.script.ScriptManifest;
  11. import org.rsbot.script.wrappers.RSTile;
  12. import org.rsbot.script.wrappers.RSObject;
  13. import org.rsbot.script.wrappers.RSArea;
  14. import org.rsbot.script.methods.Skills;
  15.  
  16. @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>"
  17.                 + "<center>Made By Krypsis"
  18.                 + "<br>Version: 1.01</br>"
  19.                 + "<br>Log To Cut:<br>"
  20.                 + "<select name='treeLoc'>"
  21.                 + "<option>Willows (Draynor)</option>"
  22.                 + "<option>Willows (Rimmington)</option>"
  23.                 + "<br></br>"
  24.                 + "<br>Power-Cut Logs:"
  25.                 + "<select name='powerCut'>"
  26.                 + "<option>No</option>"
  27.                 + "<option>Yes</option>"
  28.                 + "<br>Start At Location Selected</br><br></center>")
  29. /*-----------------------------------------------------------
  30.  *- This Script Is Trademarked By KrYpSiS of "www.RSBot.org"-
  31.  *- This Script Is Not To Be Released Under False Name      -
  32.  *- Or Reproduced Without Permission Of The User "KrYpSiS". -
  33.  *-----------------------------------------------------------
  34.  * Thank You For Your Time,
  35.  *    >            Krypt-Cutterâ„¢
  36.  *@ScriptStart Extend Script Implements ServerMessageListener
  37.  */
  38. public class KryptCutter extends Script implements ServerMessageListener,
  39.                 PaintListener {
  40.  
  41.         // ID's
  42.         public RSArea bankArea = new RSArea(new RSTile(0000, 0000), new RSTile(
  43.                         0000, 0000));
  44.         public RSArea treeArea = new RSArea(new RSTile(0000, 0000), new RSTile(
  45.                         0000, 0000));
  46.         // Willow (Rimmington) Walking Spot's
  47.         public double toLvl = 0;
  48.         public double willowXP = 67.5;
  49.         public double wcXP = 0;
  50.         public long curXPToLvl;
  51.         public long Lvl;
  52.         public long seconds;
  53.         public long minutes;
  54.         public long hours;
  55.         public long runTime;
  56.         public long startTime = System.currentTimeMillis();
  57.         public int amount = 0;
  58.         public int axeID[] = { 1351, 1352, 1349, 1350, 1353, 1354, 1355, 1356,
  59.                         1357, 1358, 1359, 1360 };
  60.         public int[] bankBoothID = { 2213 };
  61.         public int logID = 0;
  62.         public int willowID[] = { 5551, 5552, 5553 };
  63.         public int wcLvl = Skills.WOODCUTTING;
  64.         public int wilChopped = 0;
  65.         public int treeSpot;
  66.         public int powerCut;
  67.         public String status;
  68.         public String location;
  69.  
  70.         private void mouseSpeed() {
  71.                 mouse.setSpeed(random(6, 8));
  72.         }
  73.  
  74.         public void onRepaint(final Graphics g) {
  75.                 if (game.isLoggedIn()) {
  76.                         // Credits To Garrett For This Timer.
  77.                         runTime = System.currentTimeMillis() - startTime;
  78.                         seconds = runTime / 1000;
  79.                         if (seconds >= 60) {
  80.                                 minutes = seconds / 60;
  81.                                 seconds -= (minutes * 60);
  82.                         }
  83.                         if (minutes >= 60) {
  84.                                 hours = minutes / 60;
  85.                                 minutes -= (hours * 60);
  86.                         }
  87.                         Lvl = (int) skills.getCurrentLevel(Skills.WOODCUTTING);
  88.                         toLvl = skills.getExpToNextLevel(Skills.WOODCUTTING) / 67.5;
  89.  
  90.                         g.setColor(new Color(0, 0, 0, 120));
  91.                         g.fill3DRect(545, 203, 195, 264, true);
  92.                         g.setColor(Color.white);
  93.                         g.drawImage(null, 560, 380, null);
  94.                         g.setFont(new Font("papyrus", Font.BOLD, 14));
  95.                         g.drawString("Krypt-Cutter v1.01", 560, 232);
  96.                         g.setColor(Color.pink);
  97.                         g.drawString("Krypt-Cutter v1.01", 561, 233);
  98.                         g.setColor(Color.cyan);
  99.                         g.setFont(new Font("sansserif", Font.BOLD, 12));
  100.                         g.drawString("Run Time: " + hours + " : " + minutes + " : "
  101.                                         + seconds, 560, 250);
  102.                         g.drawString("Logs Cut: " + wilChopped, 560, 268);
  103.                         g.drawString("XP Gained: " + wcXP, 560, 286);
  104.                         g.drawString("Logs Till Level: " + Math.round(toLvl), 560, 304);
  105.                         g.setFont(new Font("sansserif", Font.BOLD, 13));
  106.                         g.setColor(Color.red);
  107.                         g.drawString("Status: " + status, 560, 322);
  108.                         g.drawString("Area: " + location, 560, 340);
  109.                         g.setColor(Color.white);
  110.                         g.drawString("Woodcutting Level: " + Lvl, 560, 362);
  111.                 }
  112.         }
  113.  
  114.         public boolean onStart(Map<String, String> args) {
  115.                 log("Krypt-Cutter Successfully Started!");
  116.  
  117.                 // GUI Settings
  118.                 if (args.get("treeLoc").equals("Willows (Draynor)")) {
  119.                         // Willows (Draynor)
  120.                         location = "Willows (Draynor)";
  121.                         treeSpot = 1;
  122.                         logID = 1519;
  123.                         bankArea = new RSArea(new RSTile(3091, 3239),
  124.                                         new RSTile(3097, 3247));
  125.                         treeArea = new RSArea(new RSTile(3085, 3224),
  126.                                         new RSTile(3091, 3239));
  127.                 } else if (args.get("treeLoc").equals("Willows (Rimmington)")) {
  128.                         // Willows (Rimmington)
  129.                         location = "Willows (Rimmington)";
  130.                         treeSpot = 2;
  131.                         logID = 1519;
  132.                         bankArea = new RSArea(new RSTile(3091, 3239),
  133.                                         new RSTile(3097, 3247));
  134.                         treeArea = new RSArea(new RSTile(3056, 3250),
  135.                                         new RSTile(3066, 3257));
  136.                 }
  137.                 if(args.get("powerCut").equals("No")) {
  138.                         powerCut = 0;
  139.                 } else if(args.get("powerCut").equals("Yes")) {
  140.                         powerCut = 1;
  141.                 }
  142.                 return true;
  143.         }
  144.  
  145.         public boolean onFinish(Map<String, String> args) {
  146.                 log("Thank You For Using Krypt-Cutter.");
  147.                 log("You've Gained " + wcXP + " xp");
  148.                 log("Chopped " + wilChopped + " Logs");
  149.                 log("Please Donate To Keep This Script Going!");
  150.                 return true;
  151.         }
  152.  
  153.         public void serverMessageRecieved(final ServerMessageEvent e) {
  154.                 final String word = e.getMessage().toLowerCase();
  155.                 if (word.contains("you get some willow logs")) {
  156.                         wilChopped++;
  157.                         wcXP = wcXP + willowXP;
  158.                 }
  159.         }
  160.  
  161.         private void chopTrees() {
  162.                 if (treeSpot == 1) {
  163.                         // Willows (Draynor)
  164.                         final RSObject willows = objects.getNearest(willowID);
  165.                         if (treeArea.contains(getMyPlayer().getLocation())
  166.                                         && getMyPlayer().getAnimation() == -1
  167.                                         && !getMyPlayer().isMoving()) {
  168.                                 if (calc.distanceTo(willows) < 12) {
  169.                                         status = "Chopping Trees!";
  170.                                         willows.doAction("Chop");
  171.                                         sleep(1000, 1250);
  172.                                         cameraAntiBan();
  173.                                 }
  174.                         }
  175.                 } else if (treeSpot == 2) {
  176.                         // Willows (Rimmington)
  177.                         final RSObject willows = objects.getNearest(willowID);
  178.                         if (treeArea.contains(getMyPlayer().getLocation())
  179.                                         && getMyPlayer().getAnimation() == -1
  180.                                         && !getMyPlayer().isMoving()) {
  181.                                 if (calc.distanceTo(willows) < 15) {
  182.                                         status = "Chopping Trees!";
  183.                                         willows.doAction("Chop");
  184.                                         sleep(1000, 1250);
  185.                                         cameraAntiBan();
  186.                                 }
  187.                         }
  188.                 }
  189.         }
  190.  
  191.         private void toTrees() {
  192.                 status = "Running To Trees!";
  193.                 if (treeSpot == 1) {
  194.                         final int random = random(1, 4);
  195.                         if (random == 1 && !getMyPlayer().isMoving()) {
  196.                                 walking.walkTileMM(walking.randomizeTile(
  197.                                                 new RSTile(3088, 3237), 2, 2));
  198.                                 cameraAntiBan();
  199.                                 sleep(4750, 5500);
  200.                         } else if (random == 2 && !getMyPlayer().isMoving()) {
  201.                                 walking.walkTileMM(walking.randomizeTile(
  202.                                                 new RSTile(3090, 3233), 2, 2));
  203.                                 cameraAntiBan();
  204.                                 sleep(4750, 5500);
  205.                         } else if (random == 3 && !getMyPlayer().isMoving()) {
  206.                                 walking.walkTileMM(walking.randomizeTile(
  207.                                                 new RSTile(3086, 3233), 2, 2));
  208.                                 cameraAntiBan();
  209.                                 sleep(4750, 5500);
  210.                         } else if (random == 4 && !getMyPlayer().isMoving()) {
  211.                                 walking.walkTileMM(walking.randomizeTile(
  212.                                                 new RSTile(3089, 3230), 2, 2));
  213.                                 cameraAntiBan();
  214.                                 sleep(4750, 5500);
  215.                         } else {
  216.                                 return;
  217.                         }
  218.                 } else if (treeSpot == 2) {
  219.                         final int random = random(1, 2);
  220.                         if(random == 1 && !getMyPlayer().isMoving()) {
  221.                                 cameraAntiBan();
  222.                                 walking.walkPathMM(walking.randomizePath(new RSTile[] {
  223.                                                 new RSTile(3093, 3244),
  224.                                                 new RSTile(3093, 3243),
  225.                                                 new RSTile(3081, 3250),
  226.                                                 new RSTile(3070, 3261),
  227.                                                 new RSTile(3059, 3253) }, 2, 2));
  228.                                 cameraAntiBan();
  229.                         } else if (random == 2 && !getMyPlayer().isMoving()) {
  230.                                 cameraAntiBan();
  231.                                 walking.walkPathMM(walking.randomizePath(new RSTile[] {
  232.                                                 new RSTile(3082, 3253),
  233.                                                 new RSTile(3074, 3264),
  234.                                                 new RSTile(3065, 3265),
  235.                                                 new RSTile(3061, 3253) }, 2, 2));
  236.                                 cameraAntiBan();
  237.                         }
  238.                 }
  239.         }
  240.  
  241.         private void toBank() {
  242.                 status = "Running To Bank!";
  243.                 if (treeSpot == 1) {
  244.                         final int random = random(1, 3);
  245.                         if (random == 1 && !getMyPlayer().isMoving()) {
  246.                                 walking.walkTileMM(walking.randomizeTile(
  247.                                                 new RSTile(3093, 3243), 2, 2));
  248.                                 cameraAntiBan();
  249.                                 sleep(4750, 5500);
  250.                         } else if (random == 2 && !getMyPlayer().isMoving()) {
  251.                                 walking.walkTileMM(walking.randomizeTile(
  252.                                                 new RSTile(3094, 3244), 2, 2));
  253.                                 cameraAntiBan();
  254.                                 sleep(4750, 5500);
  255.                         } else if (random == 3 && !getMyPlayer().isMoving()) {
  256.                                 walking.walkTileMM(walking.randomizeTile(
  257.                                                 new RSTile(3094, 3242), 2, 2));
  258.                                 cameraAntiBan();
  259.                                 sleep(4750, 5500);
  260.                         } else {
  261.                                 return;
  262.                         }
  263.                 } else if (treeSpot == 2) {
  264.                         final int random = random(1, 2);
  265.                         if (random == 1 && !getMyPlayer().isMoving()) {
  266.                                 cameraAntiBan();
  267.                                 walking.walkPathMM(walking.randomizePath(new RSTile[] {
  268.                                                 new RSTile(3059, 3253),
  269.                                                 new RSTile(3064, 3264),
  270.                                                 new RSTile(3075, 3264),
  271.                                                 new RSTile(3079, 3250),
  272.                                                 new RSTile(3090, 3248),
  273.                                                 new RSTile(3093, 3244) }, 2, 2));
  274.                                 cameraAntiBan();
  275.                         } else if (random == 2 && !getMyPlayer().isMoving()) {
  276.                                 cameraAntiBan();
  277.                                 walking.walkPathMM(walking.randomizePath(new RSTile[] {
  278.                                                 new RSTile(3061, 3265),
  279.                                                 new RSTile(3072, 3269),
  280.                                                 new RSTile(3073, 3254),
  281.                                                 new RSTile(3085, 3249),
  282.                                                 new RSTile(3093, 3243) }, 2, 2));
  283.                                 cameraAntiBan();
  284.                         }
  285.                 }
  286.         }
  287.  
  288.         private void useBank() {
  289.                 status = "Banking!";
  290.                 final RSObject banker = objects.getNearest(bankBoothID);
  291.                 if (calc.distanceTo(banker) < 10) {
  292.                         if (bank.isOpen()) {
  293.                                 if (inventory.getCount(logID) == amount) {
  294.                                         bank.depositAllExcept(axeID);
  295.                                         sleep(500, 600);
  296.                                         bank.close();
  297.                                         statAntiBan();
  298.                                 }
  299.                         } else {
  300.                                 banker.doAction("Use-Quickly ");
  301.                                 sleep(950, 1250);
  302.                         }
  303.                 } else {
  304.                         toBank();
  305.                         sleep(1000, 2000);
  306.                 }
  307.         }
  308.  
  309.         private void cameraAntiBan() {
  310.                 final int angNumb = random(1, 100);
  311.                 final int altNumb = random(1, 100);
  312.                 if (angNumb == 59 || angNumb == 98 || angNumb == 12) {
  313.                         camera.setAngle(random(-90, 180));
  314.                 } else if (angNumb == 77) {
  315.                         camera.setAngle(random(-180, 180));
  316.                         camera.setAltitude(true);
  317.                 }
  318.                 if (altNumb == 47) {
  319.                         camera.setAltitude(true);
  320.                 } else if (altNumb == 29) {
  321.                         camera.setAltitude(false);
  322.                 }
  323.         }
  324.  
  325.         @SuppressWarnings( { "static-access" })
  326.         public void statAntiBan() {
  327.                 final int wcCheck = random(1, 20);
  328.                 if (wcCheck == 2 || wcCheck == 15) {
  329.                         if (game.getCurrentTab() != game.TAB_STATS) {
  330.                                 game.openTab(game.TAB_STATS);
  331.                         }
  332.                         mouse.move(692, 358, 28, 10);
  333.                 }
  334.                 sleep(1000, 1100);
  335.         }
  336.  
  337.         public int loop() {
  338.  
  339.                 if (game.isLoggedIn()) {
  340.                         mouseSpeed();
  341.                         if (inventory.getCount(axeID) == 1) {
  342.                                 amount = 27;
  343.                         } else {
  344.                                 amount = 28;
  345.                         }
  346.                         if (!treeArea.contains(getMyPlayer().getLocation())
  347.                                         && inventory.getCount(logID) < amount) {
  348.                                 toTrees();
  349.                                 sleep(750, 1125);
  350.                         } else if (treeArea.contains(getMyPlayer().getLocation())
  351.                                         && inventory.getCount(logID) < amount) {
  352.                                 chopTrees();
  353.                         } else if (treeArea.contains(getMyPlayer().getLocation())
  354.                                         && inventory.isFull()
  355.                                         && powerCut == 0) {
  356.                                 toBank();
  357.                                 sleep(750, 1125);
  358.                         } else if (!bankArea.contains(getMyPlayer().getLocation())
  359.                                         && inventory.isFull()
  360.                                         && powerCut == 0) {
  361.                                 toBank();
  362.                                 sleep(750, 1125);
  363.                         } else if (bankArea.contains(getMyPlayer().getLocation())
  364.                                         && inventory.isFull()
  365.                                         && powerCut == 0) {
  366.                                 useBank();
  367.                                 sleep(750, 1125);
  368.                         } else if(treeArea.contains(getMyPlayer().getLocation())
  369.                                         && inventory.isFull()
  370.                                         && powerCut == 1) {
  371.                                 status = "Dropping Logs!";
  372.                                 inventory.dropAllExcept(axeID);
  373.                                 sleep(300, 400);
  374.                         }
  375.                        
  376.                         if (walking.getEnergy() > 40) {
  377.                                 walking.setRun(true);
  378.                                 sleep(200, 300);
  379.                         }
  380.                 }
  381.                 return 0;
  382.         }
  383. }