I tried to do as Ispecyou showed, yet it looks like my client freezes then i try to use .getAmount() method. I can see people walking arround, yet i cannot stop the script, nor exit the client, the only way to exit is to kill process.
private State getState() {
Item something = bank.getItem("specific item");
boolean something = bank.contains("specific item");
}
These 2 lines in getState() will return null or false not sure why it is like that.
But it works if i start the script while bank is open.
private State getState() {
boolean something = bank.contains("specific item");
if (!something)
return State.FINISHED;
}
Yet, im quite confused why it does not get the correct value while bank is closed.
Item something = bank.getItem("specific item");
Maybe there is another better way of doing it ? Not necessary according to what i have ? - no specific item left in bank -> go to state.