Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.wrappers.RSObject;
  4. import org.rsbot.script.wrappers.RSTile;
  5. import org.rsbot.script.wrappers.RSTilePath;
  6.  
  7. @ScriptManifest(
  8. authors = {"Abysal Rush"},
  9. version = 0.01,
  10. keywords = {},
  11. description = "AMiner, by Abysal Rush!",
  12. name = "AMiner"
  13. )
  14. public class AMiner extends Script {
  15.  
  16. int boothID = 11402;
  17. int[] oreID = {10577, 10578, 10579};
  18. int miningAnimation = 625;
  19.  
  20. RSTile[] tilesToBank = {new RSTile(3182, 3376), new RSTile(3176, 3387), new RSTile(3169, 3399), new RSTile(3168, 3411),
  21. new RSTile(3169, 3423), new RSTile(3178, 3429), new RSTile(3183, 3438)};
  22. RSTilePath pathToBank;
  23.  
  24. public boolean onStart() {
  25. pathToBank = walking.newTilePath(tilesToBank);
  26. return true;
  27. }
  28.  
  29. @Override
  30. public int loop() {
  31. if(inventory.isFull()){
  32. if(atBank()){
  33. doBank();
  34. } else {
  35. walk();
  36. }
  37. }else {
  38. if(atMine()){
  39. mineOres();
  40. } else {
  41. walkR();
  42. }
  43. }
  44. return random(600, 800);
  45. }
  46.  
  47. private void mineOres() {
  48. RSObject rock = objects.getNearest(oreID);
  49. if(getMyPlayer().getAnimation() != miningAnimation ) {
  50. rock.doAction("Mine");
  51. }
  52. sleep(1800, 2000);
  53. }
  54.  
  55. private void walkR() {
  56. pathToBank.reverse();
  57. pathToBank.traverse();
  58. pathToBank.reverse();
  59. }
  60.  
  61. private void walk(){
  62. pathToBank.traverse();
  63. }
  64.  
  65. public void onFinish() {
  66. log("Thank you for using my script, asshole!");
  67. }
  68.  
  69. private boolean atBank(){
  70. RSObject bank = objects.getNearest(boothID);
  71. if(bank != null) {
  72. if(bank.isOnScreen()){
  73. return true;
  74. }
  75. }
  76. return false;
  77. }
  78.  
  79. private void doBank() {
  80. if(bank.isOpen()){
  81. bank.depositAll();
  82. sleep(800, 1200);
  83. } else {
  84. bank.open();
  85. sleep(1800, 2200);
  86. }
  87. }
  88.  
  89. private boolean atMine(){
  90. RSObject ore = objects.getNearest(oreID);
  91. if(ore != null) {
  92. if(ore.isOnScreen()){
  93. return true;
  94. }
  95. }
  96. return false;
  97. }
  98.  
  99.  
  100.  
  101.  
  102.  
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement