The conditional sleep doesnt work properly, Here you have my code
package com.company;
import org.osbot.rs07.script.MethodProvider;
import org.osbot.rs07.utility.ConditionalSleep;
import java.lang.reflect.Method;
import java.util.function.BooleanSupplier;
public final class Sleep extends ConditionalSleep {
private final BooleanSupplier condition;
public Sleep(final BooleanSupplier condition, final int timeout) {
super(timeout);
this.condition = condition;
}
public Sleep(final BooleanSupplier condition, final int timeout, final int interval) {
super(timeout, interval);
this.condition = condition;
}
@Override
public final boolean condition() throws InterruptedException {
return condition.getAsBoolean();
}
public static boolean sleepUntil(final BooleanSupplier condition, final int timeout) {
return new Sleep(condition, timeout).sleep();
}
public static boolean sleepUntil(final BooleanSupplier condition, final int timeout, final int interval) {
return new Sleep(condition, timeout, interval).sleep();
}
}
My ide says somtehing about sleepUntil not returning a value. How can this be