import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.*;
@ScriptManifest(author = "H", info = "My Willow Cutter", name = "H", version = 0.1, logo = "")
public class main extends Script {
@Override
public void onStart() {
log("Welcome to my simple willow cutter");
}
private enum State {
CUT, DROP, WAIT
};
private State getState() {
Entity tree = objects.closest("Willow");
if (!inventory.isEmpty())
return State.DROP;
if (tree != null)
return State.CUT;
return State.WAIT;
}
@Override
public int onLoop() throws InterruptedException {
log("Loop reached");
switch (getState()) {
case CUT:
Entity tree = objects.closest("Willow");
if (tree != null) {
tree.interact("Chop down");
}
break;
case DROP:
inventory.dropAll();
break;
case WAIT:
sleep(random(500, 700));
break;
}
return random(200, 300);
}
@Override
public void onExit() {
log("Thanks for running my Willow cutter!");
}
@Override
public void onPaint(Graphics2D g) {
}
}
I recently started scripting again and thought I would try and make a simple woodcutter as practice. However no matter what I do my osbot does not seem to want to run scripts. This is the code I came up with for my willow cutter, nothing special at all. I am using the latest version 2.3.106. The same happens with all of the free woodcutting scripts as well. Any ideas as to what the problem could be?
Edit: Before anyone asks, I am using the latest version of java, eclipse etc... and I am exporting as a jar file to the osbot scripts folder as well as adding the osbot jar to the build path in my project.