Guest User

Untitled

a guest
Jun 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. package com.scripts;
  2.  
  3. import com.kbot2.scriptable.*;
  4. import com.kbot2.scriptable.methods.data.*;
  5. import com.kbot2.scriptable.methods.wrappers.*;
  6.  
  7. public class mytoscript extends Script {
  8.  
  9. public final int[] hatchetIDS = { 1351, 1349, 1353, 1361, 1355, 1357, 1359,
  10. 6739 };
  11. int[] Oak_ID = { 1281, 3037, 8462, 8463, 8464, 8465, 8466, 8467 };
  12. int BANK_BOOTH_ID = 11402;
  13. Obj oak;
  14. Obj bankBooth;
  15. int Oak_Logs = 1521;
  16. int status;
  17. long antibanTimer = 0;
  18.  
  19. Tile[] BANK_TO_oak = { new Tile(3253, 3420), new Tile(3253, 3425),
  20. new Tile(3257, 3428), new Tile(3262, 3428), new Tile(3267, 3428),
  21. new Tile(3272, 3428), new Tile(3276, 3428) };
  22.  
  23. Tile[] oak_TO_BANK = Walking.reversePath(BANK_TO_oak);
  24.  
  25. @Override
  26. public boolean active() {
  27. return true;
  28. }
  29.  
  30. @Override
  31. public boolean onStart() {
  32. log("Starting the Script...");
  33. return true;
  34. }
  35.  
  36. public String getName() {
  37. return "mytoscript";
  38. }
  39.  
  40. public String getAuthor() {
  41. return "Tomaso88";
  42. }
  43.  
  44. public String getDescription() {
  45. return "cuts oaks and drops them";
  46.  
  47. }
  48.  
  49. public int loop() {
  50.  
  51. if (walking.getEnergy() > 40)
  52. walking.setRunning(true);
  53. if (getMyPlayer().getAnimation() != -1 || getMyPlayer().isMoving()) {
  54. return random(100, 150);
  55. }
  56.  
  57. switch (status) {
  58. case 0:
  59. walking.walkPath(BANK_TO_oak);
  60. status = 1;
  61.  
  62. case 1:
  63.  
  64. oak = getClosestObject(7, Oak_ID);
  65. if (oak == null) {
  66. log("Couldnt find oak spot.");
  67.  
  68. } else {
  69. oak.doAction("Chop down");
  70.  
  71. if (!inventory.isFull() && !inventory.contains(1521)
  72. && getMyPlayer().getAnimation() == -1) {
  73. return 500;
  74. } else {
  75. if (inventory.isFull() && inventory.contains(1521)
  76. && getMyPlayer().getAnimation() == -1) {
  77. status = 2;
  78. }
  79. }
  80. }
  81. break;
  82.  
  83. case 2:
  84.  
  85. walking.walkPath(oak_TO_BANK);
  86.  
  87. bankBooth = getClosestObject(7, BANK_BOOTH_ID);
  88. if (bankBooth == null) {
  89. return 400;
  90. } else {
  91. bankBooth.doAction("Use-quickly");
  92. bank.depositAllExcept(1351, 1349, 1353, 1361, 1355, 1357, 1359,
  93. 6739);
  94. }
  95. break;
  96. }
  97. return random(300, 500);
  98. }
  99.  
  100. }
Add Comment
Please, Sign In to add comment