Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.wrappers.RSArea;
  4. import org.rsbot.script.wrappers.RSObject;
  5. import org.rsbot.script.wrappers.RSTile;
  6.  
  7. @ScriptManifest(authors = "Test", name = "test", version = 1.0, description = "Test")
  8. public class TestScript extends Script {
  9.  
  10. int[] WillowTreeID = { 5551, 5552, 5553 };
  11. int[] HatchetID = { 1351, 1355, 1349, 1353, 1361, 1357, 1359, 6739 };
  12. int[] StoreKeeperID = { 530, 531};
  13. int Willowlog = 1519;
  14.  
  15. RSTile[] willowsToStore = { new RSTile(2969, 3195),
  16. new RSTile(2962, 3205), new RSTile(2954, 3210),
  17. new RSTile(2947, 3215)};
  18.  
  19. RSTile[] StoreToWillows = {new RSTile(2947, 3215), new RSTile(2954, 3210),
  20. new RSTile(2962, 3205), new RSTile(2969, 3195),};
  21.  
  22.  
  23. public boolean onStart() {
  24. log("Powned by piepoloo!");
  25. return true;
  26.  
  27. }
  28.  
  29. private void ChopWillow() {
  30. log("Lets Chop");
  31. RSObject willow = objects.getNearest(WillowTreeID);
  32. if (willow != null && getMyPlayer().getAnimation() == -1) {
  33. willow.doAction("Chop");
  34. sleep(200, 600);
  35. }
  36. }
  37.  
  38. // private void dropOre() {
  39. // inventory.dropAllExcept(pickID);
  40. // }
  41.  
  42. private boolean WalkToStore() {
  43.  
  44. RSTile[] randomizedPath = walking.randomizePath(willowsToStore, 2, 2);
  45. return walking.walkPathMM(randomizedPath);
  46. }
  47.  
  48. private boolean WalkToWillows(){
  49. RSTile[] randdomizedPath = walking.randomizePath(StoreToWillows, 4, 4);
  50. return walking.walkPathMM(randdomizedPath);
  51. }
  52.  
  53. private boolean atWillows() {
  54. RSArea area = new RSArea(new RSTile(2966, 3190), new RSTile(2976, 3200));
  55. return (area.contains(getMyPlayer().getLocation()));
  56. }
  57.  
  58. private boolean atStore() {
  59. RSArea area = new RSArea(new RSTile(2947, 3212), new RSTile(2950, 3217));
  60. return area.contains(getMyPlayer().getLocation());
  61. }
  62.  
  63. private void openStore() {
  64. RSObject StoreKeeper = objects.getNearest(StoreKeeperID);
  65. if (StoreKeeper != null && !store.isOpen()) {
  66. StoreKeeper.doClick(false);
  67. StoreKeeper.doAction("rade");
  68. }
  69. }
  70.  
  71.  
  72.  
  73.  
  74. private void SellWillow() {
  75. if (store.isOpen()) {
  76. mouse.click(581, 265, 5, 5, false);
  77. menu.doAction("Sell 50");
  78. sleep(200, 500);
  79. }
  80. }
  81.  
  82. private void closeStore() {
  83. if (store.isOpen()) {
  84. mouse.move(487, 20, 3, 3);
  85. sleep(200, 500);
  86. WalkToWillows();
  87.  
  88. }
  89. }
  90.  
  91. private void Sell() {
  92. openStore();
  93. SellWillow();
  94. closeStore();
  95. }
  96.  
  97. public void onFinish() {
  98. log("Thanks 4 using this script :)");
  99. }
  100.  
  101. public int loop() {
  102. if (atWillows() && inventory.isFull()) {
  103. log("walk to store");
  104. WalkToStore();
  105. } else if (atStore() && inventory.isFull()) {
  106. log("lets sell this shit!");
  107. Sell();
  108. } else if (atWillows() && !inventory.isFull()) {
  109. log("lets try to cut some willow!");
  110. ChopWillow();
  111. }
  112. return (random(650, 950));
  113.  
  114. }
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement