Jump to content

Conditions true but won't execute code...


sudoinit6

Recommended Posts

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?

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