- Joined
- Aug 23, 2015
- Messages
- 2,232
- Thread Author
- #1
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:
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
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();
}
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