To discriminate the activities your bot is doing you should compare stuff, and depending on what you're doing you want to use the easiest / most consistent / least complicated method of categorizing your bot's behavior. You already did it by saying if(Bank.isOpen()) because then you know only the code inside that if() block will execute if the bank is open.
If your script is one Main class then u want to declare that int bankItem; inside your Main class, then find out what your bot is doing by comparing like I said, and depending on what your bot is doing you can set one of these:
bankItem = itemArray[0];
bankItem = itemArray[1];
bankItem = itemArray[2];
then after making sure u set that bankItem correctly in the right spot, u can start banking with a generic banking function using bankItem etc.
another option to ur array handling situation but basically equivalent is giving english names to ur int variables:
int axe = 232;
int pickaxe = 1337;
int jar = 6969;
int bankItem = jar;
and if u want to really have them in an array then I don't like arrays personally... I use Lists...
List<Integer> bankItems = new ArrayList<Integer>();
bankItems.add(234);
bankItems.add(1337);
bankItems.add(6969);
int bankItem = bankItems.get(0);
one difference in arrays and lists is that you can initialize the Lists in the Main class itself but only add to it in the @Override onLoop() / onStart() methods whereas you can initialize arrays as populated in just the Main class itself.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.