Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.31 KB | None | 0 0
  1. package miner;
  2.  
  3. import java.awt.Graphics;
  4.  
  5. import org.osbot.rs07.script.*;
  6. import org.osbot.rs07.api.Inventory;
  7. import org.osbot.rs07.api.map.Area;
  8. import org.osbot.rs07.api.model.Entity;
  9. import org.osbot.rs07.api.model.Player;
  10. import org.osbot.rs07.api.model.RS2Object;
  11. import org.osbot.rs07.event.*;
  12.  
  13. @ScriptManifest(author = "daylanzz", info = "mines coal at mining guild", name = "mining guild miner", version = 1.00, logo="")
  14. public class miner extends Script {
  15.  
  16. final String ROCKS_NAME = "Rocks";
  17. final String LADDER_NAME = "ladder";
  18.  
  19. final Area BANK_AREA = new Area(3009, 3355, 3018, 3358);
  20. final Area WALK_AREA1 = new Area(3023, 3353, 3025, 3356);
  21. final Area WALK_AREA2 = new Area(3028,3345, 3031, 3348);
  22. final Area WALK_AREA4 = new Area(3016, 3337, 3022, 3341);
  23. final Area WALK_AREA5 = new Area(3017, 9737, 3021, 9741);
  24. final Area WALK_AREA6 = new Area(3038, 9736, 3040, 9738);
  25. final Area MINING_AREA = new Area(3028, 9732, 3055, 9747);
  26.  
  27. final int BANK_BOOTH_ID = 24101;
  28. final int ladder = 12653;
  29.  
  30. // code used at start
  31. public void onStart() {
  32.  
  33. }
  34.  
  35. // code to be executted at the end
  36. public void onExit() {
  37.  
  38. }
  39.  
  40. // code in loop
  41. public int onLoop() throws InterruptedException {
  42.  
  43. Inventory inven = client.getInventory();
  44. Player player = client.getMyPlayer();
  45. Entity Rocks = closestObject (6759 , 6758);
  46.  
  47. if (!inven.isFull()) {
  48. {
  49. if (BANK_AREA.contains(player))
  50. walk(WALK_AREA1);
  51. if (WALK_AREA1.contains(player))
  52. walk(WALK_AREA2);
  53. if (WALK_AREA2.contains(player))
  54. walk(WALK_AREA4);
  55. if (WALK_AREA4.contains(player))
  56. if (player.isInArea(WALK_AREA4))
  57. closestObject(ladder).interact("Climb-down");
  58. sleep (random(2000-2500));
  59. if (WALK_AREA5.contains(player))
  60. walk(WALK_AREA6);
  61. if (WALK_AREA6.contains(player))
  62. walk(MINING_AREA);
  63.  
  64. }
  65.  
  66. if (MINING_AREA.contains(player)) {
  67. if (Rocks.isVisible()) {
  68. if (!player.isAnimating()) {
  69. if (!player.isMoving()) {
  70. Rocks.interact("Mine");
  71. sleep(random(700, 800));
  72.  
  73. } else {
  74. client.moveCameraToEntity(Rocks);
  75. }
  76. }
  77. } else {
  78.  
  79. walk(MINING_AREA);
  80. }
  81. }
  82. }else{
  83.  
  84. if (inven.isFull()) {
  85.  
  86. if (MINING_AREA.contains(player))
  87. walk(WALK_AREA6);
  88. if (WALK_AREA6.contains(player))
  89. walk(WALK_AREA5);
  90. if (WALK_AREA5.contains(player))
  91. if ((closestObject(2120) != null))
  92. if(closestObject(2120).isVisible())
  93. { closestObject(2120).interact("Climb-up");}
  94. sleep (random(2000-2500));
  95. walk(WALK_AREA5);
  96. if (WALK_AREA5.contains(player))
  97. walk(WALK_AREA4);
  98. if (WALK_AREA4.contains(player))
  99. walk(WALK_AREA2);
  100. if (WALK_AREA2.contains(player))
  101. walk(WALK_AREA1);
  102. if (WALK_AREA1.contains(player))
  103. walk(BANK_AREA);
  104.  
  105. if (BANK_AREA.contains(player)) {
  106. bankDeposit();
  107. } else {
  108. walk(BANK_AREA);
  109. }
  110. }
  111. }
  112.  
  113. return 50;
  114. }
  115.  
  116. // paint
  117. public void onPaint(Graphics g) {
  118.  
  119. }
  120.  
  121. public void bankDeposit() throws InterruptedException {
  122. RS2Object booth = closestObjectForName("Bank booth");
  123. if ((booth != null) && (booth.interact("Bank"))) {
  124. booth.interact("Bank");
  125. sleep(1000);
  126. }
  127. while (this.client.getMyPlayer().isMoving()) {
  128. sleep(1500);
  129. }
  130. if (this.client.getBank().isOpen()) {
  131. this.client.getBank().depositAllExcept(1271, 1275);
  132. sleep(1000);
  133. }
  134. if (this.client.getInventory().isEmpty()) {
  135. this.client.getBank().close();
  136. }
  137. }
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement