Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. import java.util.Map;
  2. import org.rsbot.script.Script;
  3. import org.rsbot.script.ScriptManifest;
  4. import org.rsbot.script.wrappers.RSObject;
  5. import org.rsbot.script.methods.Walking;
  6. import org.rsbot.script.wrappers.RSObject;
  7. import org.rsbot.script.wrappers.RSTilePath;
  8. import org.rsbot.script.wrappers.RSTile;
  9. import org.rsbot.script.wrappers.RSArea;
  10. import org.rsbot.script.methods.Methods;
  11. import org.rsbot.script.methods.Bank;
  12. import org.rsbot.script.util.Timer;
  13.  
  14. @ScriptManifest(authors = "WADIE", name = "OnionPick", version = 1.0, description = "Picks Onions")
  15. public class OnionPick extends Script {
  16.  
  17. int[] OnionID = { 3366 };
  18. int[] BankdepositboxID = { 9398 };
  19.  
  20. RSTile[] ftbank = { new RSTile(2957,3254), new RSTile(2968,3258), new RSTile(2976,3267), new RSTile(2980,3280), new RSTile(2988,3288), new RSTile(2998,3294), new RSTile(3004,3305), new RSTile(3006,3319), new RSTile(3006,3331), new RSTile(3006,3343), new RSTile(3006,3354), new RSTile(3012,3357)};
  21. RSTile[] btfield = { new RSTile(3009,3346), new RSTile(3007,3334), new RSTile(3007,3318), new RSTile(3005,3304), new RSTile(2996,3292), new RSTile(2984,3284), new RSTile(2976,3271), new RSTile(2968,3258), new RSTile(2954,3254)};
  22.  
  23. public boolean onStart() {
  24. log("Lets Pick Some Onions");
  25. return true;
  26.  
  27. }
  28. private boolean patharea(){
  29. RSArea area = new RSArea(new RSTile(2959, 3248), new RSTile(3021, 3359));
  30. return area.contains(getMyPlayer().getLocation());
  31.  
  32. }
  33. private boolean atarea(){
  34. RSArea area = new RSArea(new RSTile(2943, 3243), new RSTile(3024, 3360));
  35. return area.contains(getMyPlayer().getLocation());
  36. }
  37.  
  38. private boolean atBank(){
  39. RSArea area = new RSArea(new RSTile(3018, 3355), new RSTile(3010, 3358));
  40. return area.contains(getMyPlayer().getLocation());
  41. }
  42.  
  43. private boolean atfield(){
  44. RSArea area = new RSArea(new RSTile(2955, 3255), new RSTile(2945, 3255));
  45. return area.contains(getMyPlayer().getLocation());
  46.  
  47. }
  48. private void pickOnions() {
  49. RSObject onion = objects.getNearest(OnionID);
  50. onion.doAction("Pick");
  51. }
  52.  
  53. private void dobank() {
  54. RSObject Bankdepositbox = objects.getNearest(BankdepositboxID);
  55. Bankdepositbox.doAction("Deposit");
  56. sleep (2200, 2400);
  57. mouse.move(348, 278, 4, 4);
  58. mouse.click(true);
  59. sleep (400, 600);
  60. mouse.move(433, 42, 4, 4);
  61. mouse.click(true);
  62. sleep (700, 1000);
  63. }
  64.  
  65. public void onFinish() {
  66. log("Thanks For Using");
  67. }
  68.  
  69. private boolean walktobank() {
  70. RSTile[] randomizedPath = walking.randomizePath(ftbank, 0, 0);
  71. return walking.walkPathMM(randomizedPath, 0);
  72.  
  73. }
  74.  
  75. private void banking(){
  76. walktobank() ;
  77. if (atBank())
  78. dobank();
  79. }
  80.  
  81. private boolean walktofield() {
  82. RSTile[] reversedPath = walking.reversePath(ftbank);
  83. RSTile[] randomizedPath = walking.randomizePath(reversedPath,
  84. 0, 0);
  85. return walking.walkPathMM(randomizedPath);
  86. }
  87.  
  88.  
  89. public int loop() {
  90. if (atfield() && inventory.isFull()) {
  91. walktobank();
  92. } else if (atBank() && inventory.isFull()) {
  93. dobank();
  94. } else if(atBank() && !inventory.isFull()) {
  95. walktofield();
  96. } else if (atfield() && !inventory.isFull()) {
  97. pickOnions();
  98. }
  99.  
  100. return (random(1550, 1650));
  101.  
  102. }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement