Guest User

Untitled

a guest
Jan 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.wrappers.RSObject;
  4. import org.rsbot.script.wrappers.RSTile;
  5.  
  6.  
  7.  
  8.  
  9. @ScriptManifest(authors={"Task"}, keywords={"RSP", "RSPORTAL", "Woodcut"}, name="RSPwoodcut", description="CutnDrop", version=1.0)
  10. public class RSPwoodcut extends Script {
  11. RSTile path;
  12. public final RSTile[] TREE_BIG_VARROCK = {new RSTile(3153, 3456), new RSTile(3158, 3456), new RSTile(3163, 3456), new RSTile(3164, 3456), new RSTile(3169, 3454), new RSTile(3173, 3454), new RSTile(3175, 3454), new RSTile(3180, 3451), new RSTile(3183, 3449), new RSTile(3184, 3448), new RSTile(3182, 3444)};
  13. public final RSTile[] VARROCK_BIG_TREE = {new RSTile(3182, 3444), new RSTile(3185, 3450), new RSTile(3176, 3452), new RSTile(3174, 3454), new RSTile(3167, 3454), new RSTile(3166, 3455), new RSTile(3165, 3456), new RSTile(3156, 3457)};
  14. public final int HATCHET_ID = 1349;
  15. public final int BANKER_ID = 11402;
  16. int[] TREES_ID = {1276, 1278};
  17. int[] WOOD_ID = {1511, 0000};
  18.  
  19.  
  20. public boolean onStart() {
  21. log("RSPwoodcut Developed by Task");
  22. camera.setPitch(100);
  23. return true;
  24. }
  25.  
  26.  
  27. public int loop() {
  28.  
  29. if (!inventory.isFull() && (getMyPlayer().getAnimation() == -1)){
  30. cutLogs();
  31.  
  32. return random(1200, 2200);
  33. } else {
  34. if (inventory.getCount(WOOD_ID) == 28)
  35. if(inventory.containsAll(WOOD_ID))
  36. if(inventory.isFull());
  37. RSObject obj = objects.getNearest(BANKER_ID);
  38. if (obj != null) {
  39. if (!obj.isOnScreen()) {
  40. walking.walkTileMM(obj.getLocation());
  41. return random(600, 900);
  42. } else {
  43. walking.newTilePath(VARROCK_BIG_TREE);
  44. }
  45. if (obj.doAction("Use-quickly")){
  46. sleep(1000);
  47. return random(800, 1400);
  48.  
  49. } else {
  50. }
  51. }
  52. if (bank.isOpen()) {
  53. if (inventory.isFull()) {
  54. bank.depositAll();
  55. sleep(1000);
  56. }
  57. }
  58. return random(1200, 2200);
  59. }
  60.  
  61. }
  62.  
  63.  
  64.  
  65.  
  66.  
  67. private void cutLogs() {
  68.  
  69.  
  70. RSObject Tree = objects.getNearest("Tree");
  71. if (Tree != null && getMyPlayer().getAnimation() == -1) {
  72. if (!Tree.isOnScreen() && Tree != null) {
  73. camera.turnTo(Tree.getLocation());
  74. if (calc.distanceTo(Tree) > 3) {
  75. walking.walkTileMM(Tree.getLocation());
  76. }
  77. }
  78.  
  79.  
  80. Tree.doAction("Chop down");
  81. if (random(0, 3) != 1) {
  82.  
  83. }
  84. Tree = objects.getNearest(TREES_ID);
  85. if (getMyPlayer().getAnimation() == 867){
  86. log("Chopping");
  87. int randomNum = random(1, 14);
  88. if (randomNum == 8) {
  89. camera.turnTo(Tree);
  90. }
  91.  
  92. int randomNum2 = random(0, 5);
  93. if (randomNum2 != 0) {
  94. sleep(random(1000, 1200));
  95.  
  96. }
  97. }
  98.  
  99. sleep(random(500, 1000));
  100.  
  101. }
  102. }
  103. }
Add Comment
Please, Sign In to add comment