My conditional sleep is executing, before it's completed the set task above it, I'm not sure why though?
Example of code ( This was my first attempt ) - ( but it kept running the conditional sleep, before even clicking inventory tab )
getTabs().open(Tab.INVENTORY);
new ConditionalSleep(15000, 600) {
@Override
public boolean condition() {
log("Wait for Fishing tut!");
RS2Widget FishingWidg = getWidgets().getWidgetContainingText(263, "Fishing");
return FishingWidg != null && FishingWidg.isVisible();
}
}.sleep();
This was my second attempt -
getTabs().open(Tab.INVENTORY);
if(getTabs().isOpen(Tab.INVENTORY)) {
new ConditionalSleep(15000, 600) {
@Override
public boolean condition() {
log("Wait for Fishing tut!");
RS2Widget FishingWidg = getWidgets().getWidgetContainingText(263, "Fishing");
return FishingWidg != null && FishingWidg.isVisible();
}
}.sleep();
}
But still the same issue...?
It's strange though because sometimes it works correctly & sometimes it doesn't..