Jump to content

peilis

Members
  • Posts

    2
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

peilis's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. 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.
  2. Hello, How should i define the "if" statement for finishing my script ? It should finish then there is no specific item in the bank. So then that condition is met, it will go to a state that will stop the script / logout. private State getState() { Item something = bank.getItem("specific item"); if (something == null) return State.FINISHED; if (something.getAmount() == 0) return State.FINISHED; case FINISHED: stop(); logoutTab.logOut(); break; So i tried 2 different ways, yet what happens is : i start the script and the condition for it is met and it just do the stuff in FINISHED state. This is my first script, so im not used to the osbot api and not sure how some method works.
×
×
  • Create New...