Jump to content

Cooking Conditional Sleep


Popymon24

Recommended Posts

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: 

  1.  if (cookMenu != null && cookMenu.isVisible()) {
  2.                     cookMenu.interact("Cook All");
  3.                     new ConditionalSleep(600000) {
  4.                         @Override
  5.                         public boolean condition() throws InterruptedException {
  6.                             return inventory.onlyContains(314309331343333) || !myPlayer().isAnimating() ||getDialogues().inDialogue();
  7.                         }
  8.                     }.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!

Link to comment
Share on other sites

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: 

  1.  if (cookMenu != null && cookMenu.isVisible()) {
  2.                     cookMenu.interact("Cook All");
  3.                     new ConditionalSleep(600000) {
  4.                         @Override
  5.                         public boolean condition() throws InterruptedException {
  6.                             return inventory.onlyContains(314309331343333) || !myPlayer().isAnimating() ||getDialogues().inDialogue();
  7.                         }
  8.                     }.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.

Link to comment
Share on other sites

 
  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 by lg_juggles
Link to comment
Share on other sites

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 <>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...