July 30, 20169 yr 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!
July 30, 20169 yr 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.
July 30, 20169 yr 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, 20169 yr by lg_juggles
July 30, 20169 yr Author 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!
July 30, 20169 yr 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 <>
Create an account or sign in to comment