Guest User

Untitled

a guest
Oct 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.50 KB | None | 0 0
  1.  
  2. import org.rsbot.script.Script;
  3. import org.rsbot.script.ScriptManifest;
  4. import java.util.Map;
  5. import org.rsbot.script.Constants;
  6. import org.rsbot.script.wrappers.RSNPC;
  7. import org.rsbot.script.wrappers.RSObject;
  8. import org.rsbot.script.wrappers.RSTile;
  9. import org.rsbot.script.Skills;
  10. import org.rsbot.script.wrappers.RSInterfaceChild;
  11.  
  12. /*
  13. * To change this template, choose Tools | Templates
  14. * and open the template in the editor.
  15. */
  16. /**
  17. *
  18. * @author Frank
  19. */
  20. @ScriptManifest(authors = "IBotAllDay", name = "IPickFungi", category = "Money Making",
  21. description = "<html>\n"
  22. + "<head></head><body>"
  23. + "<b><center>IPickFungi by: IBotAllDay</center><center>"
  24. + "</html></body>", version = 1.0)
  25. public class IPickFungi extends Script {
  26.  
  27. public int lumbyTabID = 8008;
  28. public int fungiID = 2970;
  29. public int price = 0;
  30. public int lawID = 563;
  31. public int bloodID = 565;
  32. public int altarID = 36972;
  33. public int bBoothID = 24914;
  34. public int closedID = 24936;
  35. public RSTile outsideGateTile = (new RSTile(3444, 3458));
  36. public int[] gateID = {3506, 3507};
  37. public int logID = 3508;
  38. public RSTile logsTile = (new RSTile(3436, 3453));
  39. public int fungiLogID = 3509;
  40. public int sickleID = 2963;
  41.  
  42. @Override
  43. public boolean onStart(final Map<String, String> args) {
  44. new Thread() {
  45.  
  46. @Override
  47. public void run() {
  48. price = grandExchange.loadItemInfo(fungiID).getGuidePrice();
  49. }
  50. }.start();
  51. return true;
  52. }
  53.  
  54. @Override
  55. public int loop() {
  56. if (getInventoryCount(lawID) < 2 || getInventoryCount(bloodID) < 2) {
  57. log.warning("We ran out of runes to teleport. Stopping");
  58. stopScript();
  59. }
  60. if (isInventoryFull()) {
  61. if (!atLumbridge()) {
  62. if (isIdle()) {
  63. atInventoryItem(lumbyTabID, "Break");
  64. }
  65. wait(random(1000, 1200));
  66. } else {
  67. if (isIdle() || distanceTo(getDestination()) < 4) {
  68. RSObject altar = getNearestObjectByID(altarID);
  69. if (altar != null) {
  70. if (altar.isOnScreen()) {
  71. if (isIdle()) {
  72. altar.action("Pray");
  73. }
  74. } else {
  75. walkTo(altar.getLocation());
  76. }
  77. } else {
  78. walkTo(new RSTile(3243, 3209));
  79. }
  80. wait(random(900, 1300));
  81. }
  82. }
  83. } else {
  84. if (!atCanifis()) {
  85. if (getCurrentTab() != Constants.TAB_MAGIC) {
  86. openTab(Constants.TAB_MAGIC);
  87. } else if (getCurrentTab() == Constants.TAB_MAGIC) {
  88. getInterface(193, 42).action("Cast");
  89. }
  90. } else {
  91. if (inSwamp()) {
  92. RSObject fungiLog = getNearestObjectByID(fungiLogID);
  93. if (fungiLog != null) {
  94. //TODO code
  95. } else {
  96. walkTo(logsTile);
  97. }
  98. } else {
  99. if (outsideGateTile.isOnScreen()) {
  100. //TODO enter gate
  101. } else if (isIdle() ||distanceTo(getDestination()) < 4){
  102. walkTo(outsideGateTile);
  103. wait(random(900, 1300));
  104. }
  105. }
  106. if (inInn()){
  107. RSObject door = getNearestObjectByID(closedID);
  108. if (door != null){
  109. door.action("Open");
  110. wait(random(500, 900));
  111. } else {
  112. walkTo(new RSTile());
  113. }
  114. }
  115. }
  116. }
  117. return random(100, 500);
  118. }
  119.  
  120. public boolean atLumbridge() {
  121. return distanceTo(new RSTile(3223, 3219)) < 100;
  122. }
  123.  
  124. public boolean atCanifis() {
  125. return distanceTo(new RSTile(3495, 3477)) < 100;
  126. }
  127.  
  128. public boolean inSwamp() {
  129. return false;
  130. }
  131.  
  132. public int getPrayPoints() {
  133. return skills.getCurrSkillLevel(STAT_PRAYER);
  134. }
  135.  
  136. public void RechargePrayer() {
  137. if (skills.getRealSkillLevel(STAT_PRAYER) != getPrayPoints()) {
  138. }
  139. }
  140. }
Add Comment
Please, Sign In to add comment