Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.wrappers.*;
  4.  
  5. @ScriptManifest(authors = "GreenIce,", name = "SxM PureYew", keywords = "Yew", description = "Cuts Yews everywhere and banks", version = 1.0)
  6.  
  7.  
  8. public class SxMPureYew extends Script {
  9.  
  10. private int[] yewID = { 1309, 209, 9717, 9718, 9719, 11557, 11954, 11955,
  11.  
  12. 11956, 14913, 14914, 31071, 31072, 31073, 37307, 37308, 37309 };
  13. private int[] bankID = {782, 1309, 234};
  14. private int[] hatchetID = { 1349, 1351, 1353, 1355, 1357, 1359, 1361,
  15. 6739, 13470};
  16. public boolean onStart() {
  17. return true;
  18. }
  19.  
  20. @SuppressWarnings("deprecation")
  21. public int loop() {
  22. RSObject tree = objects.getNearest(yewID);
  23. tree.doAction("cut");
  24. if (players.getMyPlayer().getAnimation() == -1) {
  25. doBank();
  26. }
  27. return random (200,500);
  28. }
  29.  
  30.  
  31. private void doBank() {
  32. final RSObject Bank = objects.getNearest(bankID);
  33. if (Bank != null && Bank.isOnScreen()) {
  34. if (inventory.isFull()) {
  35. bank.open();
  36. if (bank.isOpen()) {
  37. bank.depositAllExcept(hatchetID);
  38. if (!inventory.containsOneOf(hatchetID));
  39. bank.open();
  40. if (bank.isOpen()) {
  41. bank.withdraw(hatchetID);
  42. }
  43. }
  44. bank.close();
  45. }
  46. }
  47. }
  48. public void onFinish() {
  49. }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement