Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 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. @ScriptManifest(authors = { "Vlad K" }, name = "RedBerry", version = 1.0, description = "Picks berries")
  7. public class tutorial extends Script {
  8.  
  9. int rockID[] = { 23628, 23628 };
  10. int ore = 1951;
  11. RSTile bankTile = new RSTile(3254, 3420);
  12. RSTile mineTile = new RSTile(3272, 3374);
  13.  
  14. RSTile toBank[] = new RSTile[] { new RSTile(3272, 3374),
  15. new RSTile(3276, 3372), new RSTile(3291, 3375),
  16. new RSTile(3292, 3391), new RSTile(3282, 3428),
  17. new RSTile(3254, 3420) };
  18.  
  19. RSTile toMine[] = walking.reversePath(toBank);
  20.  
  21. public boolean bank() {
  22.  
  23. if (bank.isOpen()) {
  24. bank.deposit(1951, 28);
  25. sleep(random(300, 700));
  26. }
  27.  
  28. else {
  29. bank.open();
  30. sleep(500);
  31. while (players.getMyPlayer().isMoving()) {
  32. sleep(50);
  33. }
  34. sleep(700);
  35. }
  36.  
  37. return true;
  38. }
  39.  
  40. public boolean walkToBank() {
  41. walking.walkPathMM(toMine);
  42. sleep(700);
  43.  
  44. while (players.getMyPlayer().isMoving()) {
  45. sleep(50);
  46. }
  47. return true;
  48. }
  49.  
  50. public boolean walkToBerry() {
  51.  
  52. return true;
  53. }
  54.  
  55. public boolean Berry() {
  56. RSObject rock = objects.getNearest(rockID);
  57. if (rock != null) {
  58. rock.doClick();
  59. sleep(1300);
  60.  
  61. while (players.getMyPlayer().getAnimation() != -1) {
  62. sleep(50);
  63. }
  64. }
  65. return true;
  66. }
  67.  
  68. public boolean onStart() {
  69. log("Welcome");
  70. return true;
  71. }
  72.  
  73. @Override
  74. public int loop() {
  75.  
  76. // If inventory full --> bank
  77. if (inventory.isFull()) {
  78.  
  79. if (calc.distanceTo(bankTile) < 5) {
  80. bank();
  81. return 10;
  82. }
  83.  
  84. else {
  85. walkToBank();
  86. return 10;
  87. }
  88. }
  89.  
  90. // If not at bank --> go to bank
  91.  
  92. // If at bank --> deposit ores
  93.  
  94. // If inventory not full --> mine
  95. if (!inventory.isFull()) {
  96.  
  97. if (calc.distanceTo(mineTile) < 5) {
  98. mine();
  99. return 10;
  100. }
  101.  
  102. else {
  103. walkToMine();
  104. return 10;
  105. }
  106. }
  107.  
  108. // If not at mine --> go to mine
  109.  
  110. // If at mine --> mine ores
  111.  
  112. return 0;
  113. }
  114.  
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement