I've been trying to follow this guide. I've gotten to the sleep timer. I put it into the code just as you have. Then once I compile the script still spam clicks the tree and doesn't wait. I'm not sure what I am getting wrong?
package BasicWoodcutter;
import org.dreambot.api.methods.filter.Filter;
import org.dreambot.api.script.AbstractScript;
import org.dreambot.api.script.Category;
import org.dreambot.api.script.ScriptManifest;
import org.dreambot.api.wrappers.interactive.GameObject;
import java.awt.*;
/**
* Created by metal on 9/21/2015.
*/
@ScriptManifest(category = Category.WOODCUTTING, name = "Basic WoodCutter", author = "Metal", version = 1.0)
public class MainClass extends AbstractScript{
@Override
public void onStart (){
log("Hi");
}
@Override
public int onLoop() {
GameObject tree = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Tree"));
if(tree.interact("Chop down")){
int countLog = getInventory().count("Logs");
sleepUntil(() -> getInventory().count("Logs") > countLog, 8000);
}
return 600;
}
@Override
public void onExit () {
}
@Override
public void onPaint(Graphics graphics) {
}
}
Any help would be appreciated. Also thank you for making these!