Guest User

Untitled

a guest
Jun 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | None | 0 0
  1.  
  2. }<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 498px; text-align: left;">import java.awt.*;
  3. import java.util.*;
  4. import com.speljohan.rsbot.script.*;
  5. import com.speljohan.rsbot.bot.*;
  6. import com.speljohan.rsbot.script.wrappers.*;
  7. import com.speljohan.rsbot.event.listeners.*;
  8. import com.speljohan.rsbot.event.events.*;
  9.  
  10. public class CopperMiner extends Script{
  11.  
  12. public int YewTree = 1309;
  13. public int CuttingAnim = 2846;
  14. public int WcAxe = 6739;
  15. public int TreeWalk =
  16. public int NeedToWalk =
  17.  
  18. public String getName(){
  19. return "SorsaYews";
  20. }
  21.  
  22. public String getAuthor(){
  23. return "Sorsa";
  24. }
  25.  
  26. public String getScriptCategory(){
  27. return "Woodcutting";
  28. }
  29.  
  30. public double getVersion(){
  31. return 1.0;
  32. }
  33.  
  34. public String getScriptDescription() {
  35. String html = "";
  36. return(html);
  37. }
  38.  
  39. public boolean onStart(Map<String, String> args) {
  40. /*
  41. * What you want to do on the starting of the script
  42. * Goes here. It must return true for the script to run.
  43. * If you return false, it will stop the entire script
  44. * and it will say "Failed to startup";
  45. * This will only be used once, at the beginning
  46. */
  47. return true;
  48. }
  49.  
  50.  
  51.  
  52. public void onFinish(){
  53. /*
  54. * This is what you want it to do when the user
  55. * Stops the script.
  56. * This will only be used once, at the end.
  57. */
  58. return;
  59. }
  60.  
  61. public int loop() {
  62. if(getMyPlayer().isMoving()){
  63. return 800;
  64. }
  65.  
  66. if(getMyPlayer().getAnimation() == CuttingAnim){
  67. return 800;
  68. }
  69.  
  70. //If the loop has gotten this far, we know we are not already
  71. //mining a rock and We know we are not moving, therefore
  72. //it is safe to mine a rock
  73.  
  74. if(isInventoryFull()){
  75. GoBank(WcAxe);
  76. return 800;
  77. }
  78.  
  79. //if we have gotten here, this means all of the above comments,
  80. //and our inventory is not full. This means it's perfect to
  81. //mine a rock.
  82.  
  83. RSObject rock = findObject(copperRock);
  84. if(rock == null) return 800;
  85.  
  86. atObject(rock, "Mine");
  87. return 300;
  88. import com.speljohan.rsbot.script.Script;
  89. import com.speljohan.rsbot.script.wrappers.RSTile;
  90.  
  91.  
  92. public class Blabla extends Script{
  93.  
  94. RSTile[] bankToMine = { new RSTile(2934, 2342) , new RSTile(2944, 2338),
  95. new RSTile(2954, 2333)};
  96.  
  97. //THIS IS NOT A REAL WORKING TILEPATH, THEY ARE MADE UP NUMBERS!
  98.  
  99. RSTile[] mineToBank = reversePath(bankToMine);
  100.  
  101.  
  102. public boolean needToWalk(){
  103. if(!getMyPlayer().isMoving()) return true;
  104. //^^ obviously if we aren't moving we need
  105. //^^ to walk.
  106.  
  107. if(distanceTo(getDestination()) <= random(4, 7)) return true;
  108. // getDestination returns the tile on where
  109. // the flag is currently placed. So if we are
  110. // between 4 and 7 tiles away, your player
  111. // will attempt to click the next tile.
  112.  
  113. return false;
  114. // if we get here, we do not need to walk.
  115.  
  116. }
  117. public int loop() {
  118. if(isInventoryFull()){ // Need to bank
  119. if(distanceTo(*Insert Bank Tile Here*) >= 4){
  120. // If we aren't close to bank.
  121.  
  122. mineToBank = randomizePath(mineToBank, 2, 2);
  123. if(needToWalk()){ walkTilePath(mineToBank, 25); }
  124.  
  125. return random(600, 800);
  126. }else{
  127. // we are close to bank
  128.  
  129. *Bank here*
  130. }
  131. }else{
  132. if(*We are at yews){
  133. //We are at yews
  134. *Mining code here*
  135. }else{
  136. //we are not at mine
  137.  
  138. bankTocut = randomizePath(bankTocut, 2, 2);
  139. if(needToWalk()){ walkTilePath(bankTocut, 25); }
  140.  
  141. return random(600, 800);
  142. }
  143. }
  144. }
  145.  
  146.  
  147. }</pre>
  148.  
  149. }
  150. }</pre>
Add Comment
Please, Sign In to add comment