March 19, 20187 yr private enum State{ BANK, MAKE, GRANDEXCHANGE, } private State getState() { if(inventory.contains(227) && inventory.contains(HighestMarginHerbId)) return State.MAKE; return State.BANK; } First of all im a beginner in scripting and in java. Im trying to make getState() return GRANDEXCHANGE when bank does not contain the item 227 and HighestMarginHerbId. But it keeps giving me errors.
March 19, 20187 yr if(!getBank().contains(227) || !getBank.contains(HighestMarginHerbId)) { return State.GRANDEXCHANGE; } Put that into your getState() method. If the bank does not contain any of the items with id 227 OR HighestMarginHerbId, it will return to state GRANDEXCHANGE. Edited March 19, 20187 yr by Woody
March 19, 20187 yr 10 minutes ago, Chris said: dont use states its trash just throw it all on loop bro
March 19, 20187 yr 1 hour ago, Woody said: if(!getBank().contains(227) || !getBank.contains(HighestMarginHerbId)) { return State.GRANDEXCHANGE; } Put that into your getState() method. If the bank does not contain any of the items with id 227 OR HighestMarginHerbId, it will return to state GRANDEXCHANGE. Should be && instead of || for the result you describe
March 19, 20187 yr 1 hour ago, andrewboss said: Why? Because you're a beginner in java and osbot scripting. PLus states are garbage to learn from
March 19, 20187 yr 2 hours ago, FrostBug said: Should be && instead of || for the result you describe But then it will only return to GRANDEXCHANGE if both of the items are missing Am I missing something?
March 19, 20187 yr 1 hour ago, andrewboss said: Why? Don't listen to them. You should learn how state machine works because you're new to java and it's a good start for you.
March 19, 20187 yr They want you to use the onLoop() method to do sequential instead of using the states as it is "easier to learn java with" as they said.
Create an account or sign in to comment