MaximusPrimo 60 Share Posted February 7 Idk why you're closing bank during onStart so probably don't do that. Try in your onLoop Link to comment Share on other sites More sharing options...
Pandemic 2723 Share Posted February 7 This was caused by our Keyboard class not thinking the script was running yet, and will be fixed in the next build badramen 1 Link to comment Share on other sites More sharing options...
badramen 1 Author Share Posted February 8 19 hours ago, fallacy87 said: there are 2 methods for onStart, if it is @Override public void onStart(String... params) { super.onStart(params); } then you are using the onstart with parameters and isn't firing. If you are using the one without onStart(String...params) then it is only going to fire 1 time, at the start of the script. You should read the API documentation on these to get a better understanding of what you are doing in your code. Put it in the loop and give it some conditions to detect it like Smokeyjay posted above. It's not like it's not firing, it's literally Bank.close() method doing nothing plain and simple. I know java and have read the docs lmao (not like there is much to read up on) Snippet if(!Bank.open()) { Logger.log("Open near a bank"); stop(); } /* Clean Slate */ Bank.depositAllEquipment(); Bank.depositAllItems(); Bank.withdraw("Bandos godsword"); Bank.withdraw("Fire cape (l)"); Bank.close(); Just the bank.close() bit not working anymore The purpose of opening the bank on start is part of automatically analysing a players bank to determine the best gear that they can be using and auto-generating loadouts for various bosses (i.e. vorkath in this case but can be expanded over time). Whatever loop it runs in is compeletely irrelevant to the problem MaximusPrimo 1 Link to comment Share on other sites More sharing options...
fallacy87 8 Share Posted February 8 6 hours ago, badramen said: It's not like it's not firing, it's literally Bank.close() method doing nothing plain and simple. I know java and have read the docs lmao (not like there is much to read up on) Snippet if(!Bank.open()) { Logger.log("Open near a bank"); stop(); } /* Clean Slate */ Bank.depositAllEquipment(); Bank.depositAllItems(); Bank.withdraw("Bandos godsword"); Bank.withdraw("Fire cape (l)"); Bank.close(); Just the bank.close() bit not working anymore The purpose of opening the bank on start is part of automatically analysing a players bank to determine the best gear that they can be using and auto-generating loadouts for various bosses (i.e. vorkath in this case but can be expanded over time). Whatever loop it runs in is compeletely irrelevant to the problem Well, I was just trying to help you out in your code, not insult you. Feel free to correct me if I'm wrong (this might be practiced here, I recently came over from another API less than a week ago), but onStart should be used to initialize code that is meant to be ran only 1 time. For example, adding a GameTickListener to the instance or updating your global parameters(if params were given) and not generally used to control the bot. While your intent is only to check the equipment 1 time and that's what onStart technically does, the better approach might be to set a global boolean to false and in the loop set it to true once the conditions have been met. This allows you to control the bot way more efficiently and if a misfire does happen the loop comes back and does the action in the near future. boolean equipmentChecked = false; @Override public int onLoop() { if(!equipmentChecked){ // do your equipment check, // set equipmentChecked = true; once your script finds what it is looking for // return -1 if the user does not meet the requirements return 1; } // run the rest of your code once the equipment is checked // this will not run until the equipmentChecked boolean equals true return 1; } badramen 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now