Thanks everyone Got it working now.
How would you add it to repeat a certain part of a task based script?
So
if (dialogues.isPendingContinuation())
dialogues.clickContinue();
repeat // - how to make it repeat the below until the return is met for final condition?
api.getObjects().closest("Spinning wheel").interact("Spin");
api.log("Interacting with Spinning wheel..");
new ConditionalSleep(MethodProvider.random(2000,3000)) {
public boolean condition() throws InterruptedException {
return api.getWidgets().isVisible(459, 93);
}
}.sleep();
api.getWidgets().getWidgetContainingText("Bow String").interact("Make X");
MethodProvider.sleep(900);
api.getKeyboard().typeString("" + MethodProvider.random(31, 283));
api.log("Starting to spin Flax....");
new ConditionalSleep(MethodProvider.random(80000,110000)) {
public boolean condition() throws InterruptedException {
return !api.getInventory().contains("Flax") && !api.myPlayer().isAnimating() && api.getInventory().onlyContains("Bow string");
}
}.sleep();
Currently I just have a class called "pending" which states