Phys Ex - Oak

by Loading on December 28th, 2010
No notes
Syntax: Java
Show lines - Hide lines - Show in textbox - Download
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.methods.Skills;
  4. import org.rsbot.script.wrappers.RSObject;
  5.  
  6.  
  7. @ScriptManifest(authors = "Loading, B3TA", name = "PhEx Oak Cutter", version = 1.0, description = "Test")
  8. public class PhExOak extends Script {
  9.  
  10. private int Tree[] = {1281};
  11. private final int[] hatchetIDs = {1351, 1349, 1353, 1361, 1355, 1357, 1359, 6739, 13470};
  12. private int log = 1521;
  13. private int Stump[] = {1356};
  14.  
  15. public boolean onStart(){
  16. if (equipment.containsOneOf(hatchetIDs) == true) {
  17. log("You have an axe equiped, script will now continue.");
  18. }
  19. else if (inventory.containsOneOf(hatchetIDs) == true) {
  20. log("You have an axe on your inventory, script will now continue.");
  21. }
  22. else if (equipment.containsOneOf(hatchetIDs) == false || (inventory.containsOneOf(hatchetIDs) == false)) {
  23. stopScript();
  24. log("No hatchet found. Please start the script with a hatchet equiped or on your inventory.");
  25. }
  26.  
  27. mouse.setSpeed(random(8, 14));
  28. return true;
  29. }
  30.  
  31. @SuppressWarnings("static-access")
  32. public void antiban() {
  33. int a = random(0, 10);
  34. if (random(0, 4)==0 || mouse.getSpeed() < 9 || mouse.getSpeed() > 13) {
  35. mouse.setSpeed(random(3, 6));
  36. }
  37. switch (a) {
  38. case 1:
  39. if (random(0, 6) == 0) {
  40. game.openTab(1);
  41. skills.doHover(skills.INTERFACE_WOODCUTTING);
  42. sleep(random(2100, 3400));
  43.  
  44. }
  45. case 2:
  46. if (!getMyPlayer().isIdle()) {
  47. camera.setAngle(random(20,80));
  48. sleep(random(1000,2000));
  49. }
  50. }
  51. }
  52.  
  53. @Override
  54. public int loop() {
  55. if(inventory.isFull()){
  56. inventory.dropAllExcept(hatchetIDs);
  57. } else if(getMyPlayer().getAnimation() != 867) {
  58. RSObject tree = objects.getNearest(Tree);
  59. if(tree != null){
  60. tree.doAction("Chop");
  61. sleep(200, 350);
  62. antiban();
  63. sleep(1000,2000);
  64. }
  65. }
  66. return 0;
  67.  
  68. }
  69. }

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS