So basically I've decided to start creating my own script for personal use, very basic script to Runecraft air runes, let me know what you think/any general improvements moving forwards, thanks.
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
@ScriptManifest(author = "Jashy", info = "Air Runecrafter - First Script.", logo = "", version = 0.1, name = "Air Runecrafter")
public final class Air extends Script {
private final Area AIR_ALTAR = new Area(2989,3295,2982,3289);
private final Area AIR_RUNES = new Area(2839, 4826, 2849, 4840);
@Override
public final int onLoop() throws InterruptedException {
if (hasPureEssense()) {
runecraft();
} else {
bank();
}
return random(2500, 4000);
}
private void runecraft() throws InterruptedException {
if(!AIR_ALTAR.contains(myPosition())) {
getWalking().webWalk(new Position(2987, 3294, 0));
sleep(random(2500, 4000));
useAltar();
sleep(random(2500, 4000));
}
craftRunes();
sleep(random(3500, 5000));
}
private boolean hasPureEssense() {
return getInventory().contains("Pure essence");
}
private boolean useAltar() {
return getObjects().closest("Mysterious ruins").interact("Enter");
}
private boolean craftRunes() {
return getObjects().closest("Altar").interact("Craft-rune");
}
private boolean usePortal() {
return getObjects().closest("Portal").interact("Use");
}
private void bank() throws InterruptedException {
//Added this in case script was started inside air runes area.
while(AIR_RUNES.contains(myPosition())) {
usePortal();
sleep(random(1500, 2500));
}
if (!Banks.FALADOR_EAST.contains(myPosition())) {
getWalking().webWalk(Banks.FALADOR_EAST);
} else if (!getBank().isOpen()) {
getBank().open();
sleep(random(2000, 3000));
} else if (!getInventory().isEmptyExcept("Pure essence")) {
getBank().depositAll();
sleep(random(2000, 3000));
} else if (getBank().contains("Pure essence")) {
getBank().withdrawAll("Pure essence");
sleep(random(2000, 3000));
} else {
stop(true);
}
}
}