Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug Bank.containsAnyOf doesn't work properly

s̶c̶r̶i̶p̶t̶ bot*
Joined
Aug 23, 2015
Messages
2,232
In my case I had been using Bank.containsAnyOf improperly but in a situation where it should have worked.

In my original code I had:
Code:
if (Bank.containsAnyOf(bot.cookTask.cookable)) {
    // Withdrawing cookable
    //...
} else {
    // Changing bot task
    //bot.taskHandler.getCurrentTask().deactivate();
    //bot.cookTask = (CookTask) bot.taskHandler.getCurrentTask();
}
Where cookable was just a single string. In this case, the bot would return false on the First check and normally I would kill the bot here or proceed to the next cooking task, but for testing purposes I commented out the deactivation and allowed the bot to loop... doing this allowed Bank.containsAnyOf to return properly.

I've also messed around with adding multiple strings in the call and it seems that no matter the size, the First Call will always return false.

TLDR version;
Bank.containsAnyOf always returns false the first time it's called, going forward it returns properly.
@Cloud
 
12 year old normie
Joined
Jan 8, 2015
Messages
2,769
bot.cookTask.cookable

Bruh.

Also, maybe add a check for Bank.isOpen() before checking quantity. If the first call always fails it might have to do something with the bank not being fully loaded?
 
s̶c̶r̶i̶p̶t̶ bot*
Joined
Aug 23, 2015
Messages
2,232
bot.cookTask.cookable

Bruh.

Also, maybe add a check for Bank.isOpen() before checking quantity. If the first call always fails it might have to do something with the bank not being fully loaded?
.... this is a snippet of the code. Bank.isOpen returns true for this branch to run. And what's wrong with bot.cookTask.cookable?

I didn't necessarily invite any criticism on the Very limited amount of code above, but you obviously feel compelled to.
 
Last edited:
Top