Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.osbot.rs07.api.map.Area;
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.api.ui.RS2Widget;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import org.osbot.rs07.utility.ConditionalSleep;
- import java.awt.*;
- @ScriptManifest(name = "PigeonClaySoftener", version = 6.9, author = "datpigeon", logo = "https://i.imgur.com/03YTrCy.jpg", info = "gz kys")
- public class PigeonClaySoftener extends Script {
- private long startTime;
- private Font font = new Font("Arial", Font.BOLD, 14);
- private String status = "NULL";
- private final Area botArea = new Area(3260, 3414, 3235, 3438);
- private final Area fountainArea = new Area(3237,3436,3240,3433);
- private final Area bankArea = new Area(3251,3420,3256,3420);
- private final Area bankBoothArea = new Area(3253,3419,3254,3419);
- private int antiBan;
- public final String formatTime(final long time) {
- long s = time / 1000, m = s / 60, h = m / 60;
- s %= 60;
- m %= 60;
- h %= 24;
- return String.format("%02d:%02d:%02d", h, m, s);
- }
- public void logoutNow() {
- if (getLogoutTab().logOut()) {
- stop();
- }
- }
- @Override
- public void onStart() throws InterruptedException {
- log("Starting Script");
- startTime = System.currentTimeMillis();
- }
- @Override
- public int onLoop() throws InterruptedException {
- if(botArea.contains(myPosition())) {
- antiBan = random(1,100);
- if (antiBan > 95) {
- if (getMouse().moveOutsideScreen()) {
- sleep(random(2000,6000));
- }
- }
- if (bankArea.contains(myPosition())) {
- if (!getBank().isOpen()) {
- if (getInventory().getAmount("Clay") > 0 && getInventory().getAmount("Bucket of water") > 0) {
- status = "Making Soft Clay";
- long tempNumOfClay = getInventory().getAmount("Clay");
- if (getMouse().moveOutsideScreen()) {
- sleep(random(2500, 3500));
- }
- if (getInventory().getAmount("Clay") == tempNumOfClay) {
- if (getInventory().interact("Use", "Bucket of water")) {
- if (getInventory().interact("Use", "Clay")) {
- sleep(random(1250, 2250));
- if (getWidgets().get(270,14) != null) {
- RS2Widget makeClay = getWidgets().get(270,14);
- makeClay.interact("Make");
- }
- }
- }
- }
- } else if (getInventory().getAmount("Clay") == 14 && getInventory().getAmount("Bucket") == 14) {
- status = "Walking to fountain";
- getWalking().webWalk(fountainArea);
- } else {
- if (getObjects().closest("Bank booth") != null) {
- RS2Object bankBooth = getObjects().closest(bankBoothArea,"Bank booth");
- if (bankBooth.interact("Bank")) {
- new ConditionalSleep(3000, 500) {
- @Override
- public boolean condition() throws InterruptedException {
- return getBank().isOpen();
- }
- }.sleep();
- }
- }
- }
- } else { //bank is open
- status = "Banking";
- if (getBank().getAmount("Clay") > 0 && getInventory().getAmount("Bucket") == 14) {
- if (getInventory().getAmount("Clay") != 14) {
- if (getInventory().getAmount("Soft Clay") > 0) {
- getBank().depositAll("Soft Clay");
- } else {
- getBank().withdrawAll("Clay");
- }
- } else {
- status = "Walking to fountain";
- getWalking().webWalk(fountainArea);
- }
- } else {
- status = "Logging out and ending script";
- log("Ran out of Clay or you didn't have exactly 14 buckets in your inventory");
- logoutNow();
- }
- }
- } else { //not in bankArea but could be in fountain area
- if (getInventory().getAmount("Bucket") == 0) {
- status = "Walking to Bank";
- getWalking().webWalk(bankArea);
- } else {
- if (fountainArea.contains(myPosition())) {
- status = "Getting Buckets of water";
- if (getObjects().closest("Fountain") != null) {
- RS2Object fountain = getObjects().closest("Fountain");
- if (getInventory().interact("Use","Bucket")) {
- if (fountain.interact("Use")) {
- antiBan = random(1,100);
- if (antiBan > 25) {
- getMouse().moveOutsideScreen();
- }
- new ConditionalSleep(10000,1000) {
- @Override
- public boolean condition() throws InterruptedException {
- return !getInventory().contains("Bucket");
- }
- }.sleep();
- }
- }
- }
- } else {
- status = "Walking to fountain";
- getWalking().webWalk(fountainArea);
- }
- }
- }
- } else {
- status = "Walking to Varrock east";
- getWalking().webWalk(botArea);
- }
- return random(200,600);
- }
- @Override
- public void onExit() throws InterruptedException {
- long exitRunTime = System.currentTimeMillis() - startTime;
- log("Script ended, runtime: " + formatTime(exitRunTime));
- }
- @Override
- public void onPaint(Graphics2D g) {
- Point mP = getMouse().getPosition();
- long runTime = System.currentTimeMillis() - startTime;
- g.setColor(Color.white);
- g.setFont(font);
- g.drawLine(mP.x, mP.y - 10, mP.x, mP.y + 10);
- g.drawLine(mP.x - 10, mP.y, mP.x + 10, mP.y);
- g.drawString("PigeonClaySoftener", 10, 170);
- g.drawString("Runtime: " + formatTime(runTime), 10, 190);
- g.drawString("Status: " + status, 10, 210);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement