Popymon24 Posted July 30, 2016 Share Posted July 30, 2016 I'm working on a fishing and cooking script, and I want the bot to sleep until all of the raw trout in my inventory is cooked. The code that i have for my conditional sleep is: if (cookMenu != null && cookMenu.isVisible()) { cookMenu.interact("Cook All"); new ConditionalSleep(600000) { @Override public boolean condition() throws InterruptedException { return inventory.onlyContains(314, 309, 331, 343, 333) || !myPlayer().isAnimating() ||getDialogues().inDialogue(); } }.sleep(); The problem is that it doesn't sleep, and continually selects the trout, uses it on the fire, and clicks "Cook All". Any help is appreciated! Quote Link to comment Share on other sites More sharing options...
progamerz Posted July 30, 2016 Share Posted July 30, 2016 I'm working on a fishing and cooking script, and I want the bot to sleep until all of the raw trout in my inventory is cooked. The code that i have for my conditional sleep is: if (cookMenu != null && cookMenu.isVisible()) { cookMenu.interact("Cook All"); new ConditionalSleep(600000) { @Override public boolean condition() throws InterruptedException { return inventory.onlyContains(314, 309, 331, 343, 333) || !myPlayer().isAnimating() ||getDialogues().inDialogue(); } }.sleep(); The problem is that it doesn't sleep, and continually selects the trout, uses it on the fire, and clicks "Cook All". Any help is appreciated! make it return if inventory doesn't contain the raw trout so it will stay sleeping untill that. Quote Link to comment Share on other sites More sharing options...
Juggles Posted July 30, 2016 Share Posted July 30, 2016 (edited) new ConditionalSleep(60000) { @Override public boolean condition() throws InterruptedException { return !getInventory.contains("Raw trout") || getDialogue().inDialogue(); } }.sleep(); I believe your guy stops animating between fishes cooked. I'm not sure on this but that might be why it didn't work for you. Edited July 30, 2016 by lg_juggles Quote Link to comment Share on other sites More sharing options...
Popymon24 Posted July 30, 2016 Author Share Posted July 30, 2016 Thank you so much for the help! Now that I've slept for a bit, I don't know why I didn't think of either of these things! Quote Link to comment Share on other sites More sharing options...
Explv Posted July 30, 2016 Share Posted July 30, 2016 I'm working on a fishing and cooking script, and I want the bot to sleep until all of the raw trout in my inventory is cooked. The code that i have for my conditional sleep is: if (cookMenu != null && cookMenu.isVisible()) { cookMenu.interact("Cook All"); new ConditionalSleep(600000) { @Override public boolean condition() throws InterruptedException { return inventory.onlyContains(314, 309, 331, 343, 333) || !myPlayer().isAnimating() ||getDialogues().inDialogue(); } }.sleep(); The problem is that it doesn't sleep, and continually selects the trout, uses it on the fire, and clicks "Cook All".Any help is appreciated! In the future please use the code tags when posting code on OSBot. It's the button that looks like <> Quote Link to comment Share on other sites More sharing options...