import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;
@ScriptManifest(author = "Kingbutton", info = "Fire Cooking", logo = "", name = "LumbCook", version = 0)
public class Main extends Script {
@Override
public int onLoop() throws InterruptedException {
if (fireCheck()) {
log("hello bitch");
} else {
makeFire();
}
return 50;
}
public boolean fireCheck() {
RS2Object fire = objects.closest("Fire");
return fire != null;
}
public void makeFire() {
if (!myPlayer().isAnimating() && !myPlayer().isMoving()) {
GroundItem log = getGroundItems().closest("Logs");
if (log != null && log.interact("Light")) {
new ConditionalSleep(3000) {
@Override
public boolean condition() throws InterruptedException {
return myPlayer().isAnimating();
}
}.sleep();
}
}
}
}