Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 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. import org.rsbot.script.wrappers.RSTilePath;
  7.  
  8. @ScriptManifest(authors = { "snotboy808" }, version = 0.01, keywords = { "Varrock west tree chopper" }, description = "Chops trees near varrock west bank & banks the logs", name = "Varrockchopper")
  9. public class Varrockchopper extends Script {
  10.  
  11. int boothID = 11402;
  12. int treeID[] = { 1278, 1276 };
  13. int chopAnimation = 867;
  14. int Axes[] = { 666, 666 };
  15.  
  16. RSObject tree;
  17.  
  18. RSTile[] TilesToTrees = { new RSTile(3182, 3444), new RSTile(3178, 3451),
  19. new RSTile(3168, 3454), new RSTile(3157, 3453) };
  20.  
  21. RSTilePath PathToTrees;
  22. RSTilePath PathToBank;
  23.  
  24. // path 1 void
  25. public void PathToTrees() {
  26. PathToTrees.traverse();
  27. }
  28.  
  29. // path 2 void
  30. public void PathToBank() {
  31. PathToBank.traverse();
  32. }
  33.  
  34.  
  35. RSArea oakArea = new RSArea(new RSTile(3151, 3449), new RSTile(3159, 3457));
  36. RSArea bankArea = new RSArea(new RSTile(3182, 3434), new RSTile(3189, 3445));
  37.  
  38.  
  39. public boolean onstart() {
  40. PathToTrees = walking.newTilePath(TilesToTrees);
  41. PathToBank = walking.newTilePath(TilesToTrees).reverse();
  42.  
  43. log("W00T IT WORKS?!");
  44.  
  45. return true;
  46. }
  47.  
  48. @Override
  49. public int loop() {
  50. if(inventory.isFull() && !bankArea.contains(getMyPlayer().getLocation())) {
  51. PathToBank();
  52. }
  53. if(inventory.isFull() && bankArea.contains(getMyPlayer().getLocation())) {
  54. doBank();
  55. }
  56. if(!inventory.isFull() && !oakArea.contains(getMyPlayer().getLocation())) {
  57. PathToTrees();
  58. }
  59. if(!inventory.isFull() && oakArea.contains(getMyPlayer().getLocation()) && getMyPlayer().getAnimation() == -1) {
  60. chop();
  61. }
  62.  
  63.  
  64. return random(300, 500);
  65. }
  66.  
  67. private void chop() {
  68. tree = objects.getNearest(treeID);
  69. if (tree != null && tree.isOnScreen()) {
  70. tree.doAction("Chop down");
  71. sleep(400, 600);
  72. }
  73. }
  74.  
  75. public void onFinish() {
  76. log("Thank you for using GEchopper!");
  77. }
  78.  
  79. private void bankFailSafe() {
  80. if (!inventory.isFull()) {
  81. bank.close();
  82. sleep(600, 800);
  83. }
  84. return;
  85. }
  86.  
  87. private void doBank() {
  88. if (bank.isOpen()) {
  89. bank.depositAllExcept(Axes);
  90. sleep(600, 800);
  91. bank.close();
  92. sleep(600, 800);
  93. } else {
  94. bank.open();
  95. sleep(800, 1200);
  96.  
  97. }
  98. return;
  99. }
  100.  
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement