package Clayminer;
import java.awt.Graphics2D;
import org.osbot.rs07.api.Bank;
import org.osbot.rs07.api.Inventory;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
@ScriptManifest(author = "Spooder", info = "Mines clay in varrock west", logo = "", name = "ClayMiner + banking", version = 1)
public class ClayMiner extends Script {
final int clay = 7454;
final Area CLAY_AREA = new Area(3183, 3378, 3183, 3378);
final Area BANK_AREA = new Area(3185, 3445, 3182, 3436);
Inventory inven = getInventory();
Player player = myPlayer();
Bank bank = getBank();
@Override
public void onStart() {
log("The Script has started");
}
@Override
public int onLoop() throws InterruptedException {
getWalking().webWalk(CLAY_AREA);
if (!inven.isFull()) {
if (CLAY_AREA.contains(player)) {
if (!player.isMoving()) {
if (!player.isAnimating()) {
Entity rock = getObjects().closest(clay);
if (rock != null) {
rock.interact("mine");
sleep(random(50, 120));
}
}
}
}
}
if (inven.isFull()) {
getWalking().webWalk(BANK_AREA);
if (BANK_AREA.contains(player)) {
if (!getBank().isOpen()) {
getBank().open();
} else {
bank.deposit(434, 28);
}
}
}
return 80;
}
@Override
public void onPaint(Graphics2D g) {
}
@Override
public void onExit() {
}
}
Since i dont know how people bring in the script i just copied and pasted. If you cant already see, this script is very scrubby, because this is my first ever attempt at writing a script, not sure why its not starting. Look forward to a solution. Thanks