Guest User

Untitled

a guest
Jul 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Graphics;
  3. import java.util.Map;
  4.  
  5. import org.rsbot.bot.Bot;
  6. import org.rsbot.event.listeners.PaintListener;
  7. import org.rsbot.script.Script;
  8. import org.rsbot.script.ScriptManifest;
  9. import org.rsbot.script.wrappers.*;
  10. import org.rsbot.script.Methods;
  11.  
  12. @ScriptManifest(authors = { "IDominateAll", "XScripting Inc" }, category = "Money", name = "ClaySoftener", version = 1.0, description = "Start in Varrock east bank with buckets and clay visible in bank.")
  13. public class ClaySoftener extends Script implements PaintListener {
  14.  
  15. public int bankbooth = 11402;
  16. public int bankID = 11402;
  17. public int SoftClayID = 1761;
  18. public int ClayID = 434;
  19. public int EmptyBucketID = 1925;
  20. public int bucketWaterID = 1929;
  21. public long startTime = System.currentTimeMillis();
  22. public String status = "";
  23.  
  24. public boolean onStart() {
  25. RSObject bankbooth = getNearestObjectByID(bankID);
  26. atObject(bankbooth, "Use-quickly");
  27. wait(random(700,900));
  28. startTime = System.currentTimeMillis();
  29. return true;
  30. }
  31.  
  32. public void onRepaint(Graphics g) {
  33. if (isLoggedIn()) {
  34. long millis = System.currentTimeMillis() - startTime;
  35. long hours = millis / (1000 * 60 * 60);
  36. millis -= hours * (1000 * 60 * 60);
  37. long minutes = millis / (1000 * 60);
  38. millis -= minutes * (1000 * 60);
  39. long seconds = millis / 1000;
  40. long minutes2 = minutes + (hours * 60);
  41. g.setColor(Color.red);
  42. g.drawString("Time running: " + hours + ":" + minutes + ":"
  43. + seconds + "." , 9, 315);
  44. g.drawString("Status : " + status , 9, 299);
  45. g.drawString(" " , 9, 327);
  46. }
  47. }
  48.  
  49.  
  50. public void Bank() {
  51. status = "Banking";
  52. RSObject bankbooth = getNearestObjectByID(bankID);
  53. atObject(bankbooth, "Use-quickly");
  54. wait(random(700, 900));
  55. if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  56. clickMouse(random(381,408), random(300,315), true);
  57. if (getInventoryCount(ClayID, bucketWaterID) == 0)
  58. withdraw();
  59. wait(random(500, 700));
  60. }
  61. }
  62.  
  63. public void withdraw() {
  64. status = "Withdrawing";
  65. if (getInventoryCount(ClayID, bucketWaterID) == 0) {
  66. if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  67. RSObject bankbooth = getNearestObjectByID(bankID);
  68. atObject(bankbooth, "Use-quickly");
  69. bank.withdraw(bucketWaterID, 14);
  70. bank.withdraw(ClayID, 14);
  71. wait(1000);
  72. bank.close();
  73. }
  74. }
  75. }
  76.  
  77. public void Soften() {
  78. status = "Softening Clay";
  79. if(getInventoryCount(ClayID) == 14 && getInventoryCount(bucketWaterID) == 14) {
  80. atInventoryItem(bucketWaterID, "Use");
  81. atInventoryItem(ClayID, "Use");
  82. wait(random(20000,25000));
  83. if(getMenuActions().contains("Make All")) {
  84. if (RSInterface.getInterface(INTERFACE_MENU).isValid()) {
  85. atMenu("Make All");
  86. wait(random(5000,6000));
  87. }
  88. }
  89. }
  90. }
  91.  
  92. public int loop() {
  93. if(getInventoryCount(SoftClayID) == 14 && getInventoryCount(EmptyBucketID) == 14)
  94. Bank();
  95.  
  96. if (getInventoryCount(ClayID, bucketWaterID) == 0)
  97. Bank();
  98. withdraw();
  99.  
  100.  
  101. if(getInventoryCount(ClayID) == 14 && getInventoryCount(bucketWaterID) == 14)
  102. Soften();
  103. return 500;
  104. }
Add Comment
Please, Sign In to add comment