Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 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.wrappers.RSTile;
  6. import org.rsbot.script.wrappers.RSArea;
  7. import org.rsbot.script.wrappers.RSNPC;
  8.  
  9. @ScriptManifest(authors = "NEXBot", name = "NEXBot'sYEWWoodcutter", version = 1.0, description = "Banks YEWS, and cuts them")
  10. public class NEXBot'sYEWWoodcutter extends Script {
  11. //declare my variables here to boolean
  12.  
  13. int YEWID = 1309;
  14. int BANKER = 6533;
  15. int YEWLog = 1515;
  16.  
  17. RSTile[] BANKTILE = { new RSTile(3199, 3501), new RSTile(3194, 3489),
  18. new RSTile(3193, 3492), new RSTile(3180, 3487),
  19. new RSTile(3177, 3489), new RSTile(3170, 3489)
  20. };
  21.  
  22. RSNPC BANKER = npcs.getNearest("Banker");
  23.  
  24. public boolean onStart(){
  25. log("Hello.");
  26. return true;
  27. }
  28. //private voids:
  29. private void cutYew() {
  30. RSObject yew = objects.getNearest(YEWID);
  31. if (yew != null && getMyPlayer().getAnimation() == -1) {
  32. yew.doAction("Chop down Yew");
  33. }
  34. }
  35. private boolean BANK() {
  36. RSTile[] randomizedPath = walking.randomizePath(BANKTILE, 2, 2);
  37. return walking.walkPathMM(randomizedPath, 15);
  38. }
  39. private boolean TOTREES() {
  40. RSTile[] reversedPath = walking.reversePath(BANKTILE);
  41. RSTile[] randomizedPath = walking.randomizePath(reversedPath,2, 2);
  42. return walking.walkPathMM(randomizedPath);
  43. }
  44. private boolean TREESAREA(){
  45. RSArea area = new RSArea(new RSTile(3199, 3502), new RSTile(3225, 3506));
  46. return area.contains(getMyPlayer().getLocation());
  47. }
  48. private boolean BANKAREA() {
  49. RSArea area = new RSArea(new RSTile(3154,3479), new RSTile (3176,3497));
  50. return area.contains(gerMyPlayer().getLocation());
  51. }
  52. //on finish
  53. public void onFinish(){
  54. log("Goodbye.");
  55. }
  56. @Override
  57. public int loop() {
  58. if (TREESAREA() && inventory.isFull()) {
  59. BANK();
  60. log("Going to bank..");
  61. } else if (BANKAREA() && inventory.isFull()){
  62. log("Depositing yews.");
  63. bank.open();
  64. sleep(random(3000, 5000));
  65. if(bank.isOpen()){
  66. bank.deposit(YEWLog, 0);
  67. sleep(random(1000, 2000));
  68. bank.close();
  69. sleep(random(1000, 2000));
  70. TOTREES();
  71. }
  72. } else if (TREESAREA() && !inventory.isFull()) {
  73. cutYew();
  74. }
  75. return (random(300, 950));
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement