Hello,
Thank you for replying!
So i think i fixed the output you talked about?
Also the code below, tho it does not seem the code itself is producing the error, since i cant even find it in the osbot client, hence the error messages in the first post. Any ideas?
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.utility.ConditionalSleep;
import java.util.concurrent.ThreadLocalRandom;
public class Wcbot extends Script {
private static final String TREE_NAME = "Tree";
private static final int RANDOM_MIN = 500;
private static final int RANDOM_MAX = 800;
@Override
public int onLoop() {
if (!myPlayer().isAnimating()) {
chopTree();
}
return ThreadLocalRandom.current().nextInt(RANDOM_MIN, RANDOM_MAX);
}
private void chopTree() {
RS2Object tree = getObjects().closest(TREE_NAME);
if (tree != null) {
if (!tree.isVisible()) {
getCamera().toEntity(tree);
} else if (tree.interact("Chop down")) {
new ConditionalSleep(3000, 500) {
@Override
public boolean condition() {
return myPlayer().isAnimating();
}
}.sleep();
}
}
}
@Override
public void onStart() {
log("Starting Woodcutting Bot");
}
@Override
public void onExit() {
log("Stopping Woodcutting Bot");
}
public static void main(String[] args) {
Wcbot bot = new Wcbot();
bot.start();
}
private void start() {
}
}