Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Graphics;
- import java.util.Map;
- import org.rsbot.bot.Bot;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.script.Methods;
- @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.")
- public class ClaySoftener extends Script implements PaintListener {
- public int bankbooth = 11402;
- public int bankID = 11402;
- public int SoftClayID = 1761;
- public int ClayID = 434;
- public int EmptyBucketID = 1925;
- public int bucketWaterID = 1929;
- public long startTime = System.currentTimeMillis();
- public String status = "";
- public boolean onStart() {
- RSObject bankbooth = getNearestObjectByID(bankID);
- atObject(bankbooth, "Use-quickly");
- wait(random(700,900));
- startTime = System.currentTimeMillis();
- return true;
- }
- public void onRepaint(Graphics g) {
- if (isLoggedIn()) {
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- long minutes2 = minutes + (hours * 60);
- g.setColor(Color.red);
- g.drawString("Time running: " + hours + ":" + minutes + ":"
- + seconds + "." , 9, 315);
- g.drawString("Status : " + status , 9, 299);
- g.drawString(" " , 9, 327);
- }
- }
- public void Bank() {
- status = "Banking";
- RSObject bankbooth = getNearestObjectByID(bankID);
- atObject(bankbooth, "Use-quickly");
- wait(random(700, 900));
- if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {
- clickMouse(random(381,408), random(300,315), true);
- if (getInventoryCount(ClayID, bucketWaterID) == 0)
- withdraw();
- wait(random(500, 700));
- }
- }
- public void withdraw() {
- status = "Withdrawing";
- if (getInventoryCount(ClayID, bucketWaterID) == 0) {
- if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {
- RSObject bankbooth = getNearestObjectByID(bankID);
- atObject(bankbooth, "Use-quickly");
- bank.withdraw(bucketWaterID, 14);
- bank.withdraw(ClayID, 14);
- wait(1000);
- bank.close();
- }
- }
- }
- public void Soften() {
- status = "Softening Clay";
- if(getInventoryCount(ClayID) == 14 && getInventoryCount(bucketWaterID) == 14) {
- atInventoryItem(bucketWaterID, "Use");
- atInventoryItem(ClayID, "Use");
- wait(random(20000,25000));
- if(getMenuActions().contains("Make All")) {
- if (RSInterface.getInterface(INTERFACE_MENU).isValid()) {
- atMenu("Make All");
- wait(random(5000,6000));
- }
- }
- }
- }
- public int loop() {
- if(getInventoryCount(SoftClayID) == 14 && getInventoryCount(EmptyBucketID) == 14)
- Bank();
- if (getInventoryCount(ClayID, bucketWaterID) == 0)
- Bank();
- withdraw();
- if(getInventoryCount(ClayID) == 14 && getInventoryCount(bucketWaterID) == 14)
- Soften();
- return 500;
- }
Add Comment
Please, Sign In to add comment