Jump to content

Why would this fail?


Recommended Posts

Posted (edited)

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

 

Posted (edited)
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
Posted

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. 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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