Jar Posted January 12, 2019 Share Posted January 12, 2019 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.. Quote Link to comment Share on other sites More sharing options...
Explv Posted January 12, 2019 Share Posted January 12, 2019 23 minutes ago, Jar said: 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...? What do you mean by still the same issue? Does the ConditionalSleep never get executed in this case? If the inventory tab is already open, the bot won't click on the inventory tab. Quote Link to comment Share on other sites More sharing options...
Juggles Posted January 12, 2019 Share Posted January 12, 2019 Why are you using widgets when you can sleep until getTabs.getOpen==Tabs.Inventory? Quote Link to comment Share on other sites More sharing options...
Explv Posted January 12, 2019 Share Posted January 12, 2019 (edited) 1 minute ago, Juggles said: Why are you using widgets when you can sleep until getTabs.getOpen==Tabs.Inventory? He shouldn't be using either. getTabs().open(Tab) will sleep until the tab is open anyway. + He should be using configs like here: https://github.com/Explv/Tutorial-Island/blob/master/src/sections/SurvivalSection.java#L35 Edited January 12, 2019 by Explv Quote Link to comment Share on other sites More sharing options...
Jar Posted January 12, 2019 Author Share Posted January 12, 2019 1 minute ago, Explv said: What do you mean by still the same issue? Does the ConditionalSleep never get executed in this case? If the inventory tab is already open, the bot won't click on the inventory tab. That's the strange thing, it still executes ConditionalSleep even though inventory is not open.. Quote Link to comment Share on other sites More sharing options...
Jar Posted January 12, 2019 Author Share Posted January 12, 2019 3 minutes ago, Juggles said: Why are you using widgets when you can sleep until getTabs.getOpen==Tabs.Inventory? The conditional sleep isn't waiting for the inventory tab to be open... it's waiting for the next stage of the tutorial which in this case is " Fishing " which appears in chatbox after clicking inventory tab Quote Link to comment Share on other sites More sharing options...
Juggles Posted January 12, 2019 Share Posted January 12, 2019 44 minutes ago, Jar said: The conditional sleep isn't waiting for the inventory tab to be open... it's waiting for the next stage of the tutorial which in this case is " Fishing " which appears in chatbox after clicking inventory tab Sorry I'm on my phone. If you're doing tut island then use Configs Quote Link to comment Share on other sites More sharing options...
Jar Posted January 12, 2019 Author Share Posted January 12, 2019 9 minutes ago, Juggles said: Sorry I'm on my phone. If you're doing tut island then use Configs No problem, I managed to fix it by adding a if statement - if(!getTabs().isOpen(Tab.INVENTORY)) { } which made it work, but I still don't see why that is necessary, i should be able to just call " getTabs().open(Tab.INVENTORY); " but never mind it works now i guess.. Quote Link to comment Share on other sites More sharing options...