if(inventory.contains("Steel bar") && !inventory.contains("Iron Ore") && !inventory.contains("Coal")) {
log("Deposit Steel Bar: 9");
bank.deposit("Steel bar", 9);
} else {
if(!inventory.contains("Coal") && !inventory.contains("Iron ore") && !inventory.contains("Steel Bar")) {
log("Withdrawing Coal and Ore");
bank.withdraw("Coal", 1);
bank.withdraw("Iron ore", 9);
sleep(random(200,400));
bank.withdraw("Coal", 10);
sleep(random(100,200));
bank.withdraw("Coal", 10);
sleep(random(200,400));
} else if(inventory.isFull() && bank.isOpen()) {
log("Closing Bank");
sleep(random(500,1000));
mouse.move(random(485,495),random(18,26));
mouse.click(false);
sleep(random(1000,2000));
} else if(inventory.contains("Coal") && inventory.contains("Iron ore") && !inventory.isFull()) {
log("Secondary Withdraw: Coal");
bank.withdraw("Coal", 10);
} else if(inventory.contains("Coal") && !inventory.contains("Iron ore")) {
log("Secondary Withdraw: Iron");
bank.withdraw("Iron ore", 9);
}
}
I don't have time to fix the entire thing but I've had a similar problem with other scripts, with OSBot, when you use IF statements, you need to declare the same rules for ea statement e.g.
if(inv.contain(ore) && inv.contain(coal) && !inv.contain(steel bar)) {
} else if(!inv.contain(ore) && !inv.contain(coal) && inv.contain(steel bar)) {
}else if(!inv.contain(ore) && inv.contain(coal) && !inv.contain(steel bar)) {
}
Not sure if you get the point, but I recommend you use getState() method, as this script is a little more complex than a simple Loop() through.