Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sulphurous Fertiliser

Featured Replies

I whipped this up tonight, start it in any bank with or without the compost or the saltpetre in your inventory.

i know other people have made this, i just don't run other peoples free scripts no offense to anyone. Heres my version.

 

import java.awt.Graphics2D;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

@ScriptManifest(author = "Durky", name = "Sulphurous Fertiliser", info = "Combines compost and Saltpetre", version = 1.0, logo = "")

public class main extends Script {
	private String Sulphurousfertiliser = "Sulphurous fertiliser";
	private String Compost = "Compost";
	private String Saltpetre = "Saltpetre";
	private boolean opened = false;
	private boolean lastInventory = false;
	private int leftOverAmount = 14;
	private long startTime;
	private int amountMade = 0;
	private String status;
	private State playerState = State.COMBINING;

	@Override
	public void onStart() {
		startTime = System.currentTimeMillis();
		status = "Starting up!";
	}

	public enum State {
		BANKING, COMBINING, SHUTTING_DOWN;
	}

	private int sleepDelay = 2500;
	private long iterations;

	@Override
	public int onLoop() throws InterruptedException {
		switch (playerState) {

		case BANKING:
			if (!opened) {
				log("attempting to open bank.");
				status = "Opening Bank, getting more!";
				opened = true;
				if (!getBank().isOpen()) {
					getBank().open();
					new ConditionalSleep(5000) {
						public boolean condition() {
							return getBank().isOpen();
						}
					}.sleep();
				}
			}
			if (getBank().isOpen()) {
				status = "Removing Items from the bank!";
				if (getInventory().contains(Sulphurousfertiliser)) {
					getBank().depositAll();
					amountMade += getInventory().getAmount(Sulphurousfertiliser);
				}
				sleep(random(500, 1000));
				if (getBank().getAmount(Saltpetre) > 13) {
					getBank().withdraw(Saltpetre, 14);
				} else {
					leftOverAmount = (int) getBank().getAmount(Saltpetre);
					getBank().withdraw(Saltpetre, leftOverAmount);
					lastInventory = true;
					log("down to the last " + leftOverAmount + " saltpetre");
					status = "Last Inventory! out of saltpetre";
				}
				sleep(random(500, 1000));
				if (getBank().getAmount(Compost) > 13) {
					getBank().withdraw(Compost, 14);
				} else {
					leftOverAmount = (int) getBank().getAmount(Compost);
					getBank().withdraw(Compost, leftOverAmount);
					lastInventory = true;
					log("down to the last " + leftOverAmount + " compost");
					status = "Last Inventory! out of compost";
				}
				getBank().close();
				opened = false;

				setPlayerState(State.COMBINING);
			}
			break;

		case COMBINING:
			if (!getInventory().isEmpty()) {
				if (getInventory().contains(Compost) && getInventory().contains(Saltpetre)) {
					getInventory().getItem(Compost).interact("Use");
					sleep(250);
					getInventory().getItem(Saltpetre).interact("Use");
					iterations = getInventory().getAmount(Compost) >= getInventory().getAmount(Saltpetre)
							? getInventory().getAmount(Compost)
							: getInventory().getAmount(Saltpetre);
					status = "Combining the materials!";
					amountMade += iterations;
					sleep((int) sleepDelay * iterations);
					setPlayerState(lastInventory ? State.SHUTTING_DOWN : State.BANKING);
				}
				else
					setPlayerState(State.BANKING);
			} else
				setPlayerState(State.BANKING);

			break;
		case SHUTTING_DOWN:
			log("Shutting down, thanks!");
			stop();
			break;
		}
		return 500;
	}

	public State getPlayerState() {
		return playerState;
	}

	public void setPlayerState(State playerState) {
		this.playerState = playerState;
	}

	@Override
	public void onPaint(Graphics2D g) {
		g.drawString("Run time: " + formatTime(System.currentTimeMillis() - startTime), 10, 304);
		g.drawString("Bot Status: " + status, 10, 320);
		g.drawString("You have currently made " + amountMade + " Sulphurous fertiliser!", 10, 334);
	}

	public final String formatTime(final long ms) {
		long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24;
		s %= 60;
		m %= 60;
		h %= 24;

		return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s)
				: h > 0 ? String.format("%02d:%02d:%02d", h, m, s) : String.format("%02d:%02d", m, s);
	}

}

 

SulphurousFertiliser.jar

Edited by Durky

  • 2 years later...

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.