Hello botters,
I made the following script just for practice. It is intended to withdraw bones of any kind from the bank and bury them.
import org.osbot.rs07.api.model.Item;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.*;
@ScriptManifest(author = "Drokle", info = "Babby's first script", name = "DrokleBone", version = 0, logo = "")
public class DrokleBone extends Script {
@Override
public void onStart(){
log("This is it, you're running DrokleBone!");
}
private enum State {
BANK, BONE
}
@Override
public int onLoop() throws InterruptedException {
Item[] pockets = inventory.getItems();
for(Item thing: pockets)
{
if(thing.hasAction("Bury"))
thing.interact("Bury");
sleep(random(500,550));
}
RS2Object booth = getObjects().closest("Bank booth");
bank.open();
Item[] vault = bank.getItems();
for(Item thing: vault)
{
if(thing.nameContains("Bones")||thing.nameContains("bones"))
thing.interact("Withdraw-All");
if(inventory.getEmptySlotCount() == 0)
break;
sleep(random(500,700));
}
return random(400,800);
}
@Override
public void onExit() {
log("This is has been DrokleBone, hope you had a good one.");
}
@Override
public void onPaint(Graphics2D g) {
g.drawString("THIS IS IT, YOU'RE RUNNING DROKLEBONE!! GOOD JOB!!!!", 50,50);
}
}
For some reason, when I run it, the VM eventually becomes unresponsive and I can't shut it down. Could anyone help me figure out why? It happens if I use it to bury bones far away from any bank.
Best,
Drokle