Jump to content

Conditions true but won't execute code...


Recommended Posts

Posted

So following this guide I am writing a script:

 

Mostly it works flawlessly, but some of my classes just wont work. For example I have a class where the condition check is::

@Override
    public boolean canProcess() {
        return VarWest.contains(api.myPlayer())
                && !api.bank.isOpen();
    }

If this is true it is supposed to open the bank. Works great, when the bot is in the bank and the bank is not open, it opens it.

Then I have another class that is supposed to withdraw specific items from the bank when the following is true:

@Override
    public boolean canProcess() {
        return VarWest.contains(api.myPlayer())
                && api.bank.isOpen();
    }

 

Does not work, it falls past that task all the way to my debug class where I have it checking if the above is true and if so to print "true" to the log. The script knows the condition has been met because the logs show this:

[INFO][04/28 12:13:05 PM]: Started bot #1
[INFO][Bot #1][04/28 12:14:31 PM]: Loaded 1 built-in random solvers!
[INFO][Bot #1][04/28 12:14:31 PM]: Started script : 
[INFO][Bot #1][04/28 12:14:32 PM]: Opening Varrock bank
[INFO][Bot #1][04/28 12:14:37 PM]: Emptying inventory
[INFO][Bot #1][04/28 12:14:37 PM]: true
[INFO][Bot #1][04/28 12:14:38 PM]: true
[INFO][Bot #1][04/28 12:14:40 PM]: true
[INFO][Bot #1][04/28 12:14:41 PM]: true
[INFO][Bot #1][04/28 12:14:42 PM]: true
[INFO][Bot #1][04/28 12:14:42 PM]: Terminating script ..
[INFO][Bot #1][04/28 12:14:42 PM]: Script has exited!

I am not sure what to make of this, the script sees that the conditions are met but never executes the class, and I have checked to see that the task is in the list of tasks loaded onStart.

 

Any thoughts?

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