Jump to content

Why would this fail?


harrypotter

Recommended Posts

This seems to fail on Low CPU mode. It will continue to pick the bush even when the inventory contains Cadava berries.

                if (!script.inventory.contains("Cadava berries")) {
                    if (!bushArea.contains(script.myPosition())) {
                        script.getWalking().webWalk(bushArea);
                    } else {
                        Entity bush = script.getObjects().closest("Cadava bush");
                        if (bush != null) {
                            if (bush.interact("Pick-from")) {
                                Sleep.sleepUntil(() -> script.inventory.contains("Cadava berries"), 5000);
                            }
                        }
                    }
                }

If I pause the script and resume again it works as expected?

Edited by harrypotter
Link to comment
Share on other sites

2 minutes ago, IDontEvenBot said:

your bush.interact("Pick-from") is inside the Boolean of the if statement?? I dont know if that could cause it but that might be an issue.

No because it shouldn't be passing the very first if statement after the first loop.

The bot will pick the berries, however on the next loop the first if statement continues to return false

 

Link to comment
Share on other sites

27 minutes ago, harrypotter said:

No because it shouldn't be passing the very first if statement after the first loop.

The bot will pick the berries, however on the next loop the first if statement continues to return false

 

Might be possible if Inventory is not the currently open tab, then you wont register as having the berries in inv when you check inventory??? Or the game doesn't  update quick enough on low CPU mode and your code checks before the inv has updated?

Edited by IDontEvenBot
Link to comment
Share on other sites

I submitted a bug report about inventory needing to be open in order to view items. If they don't fix it that breaks all scripts that use tabs other than inventory and use any item checking for script logic. So all of them :doge:

6 hours ago, Stimpack said:

how many times does it repeat after inventory already contains berries?

Idk but on my tut island script it will mine entire inventory of ore and won't register as having one until the tab is opened. 

Link to comment
Share on other sites

23 minutes ago, harrypotter said:

 

Indefinitely until I pause then resume

try getInventory().getItemInSlot of cadava berries then check the name of it, maybe there's weird formatting? idk.

could also open your inventory then picking from bush, as suggested above.

 

really strange :( based on code, it shouldn't be doing that..

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