May 8, 20214 yr This is my first attemt making a script in java. the script is very basic it just makes wines until it runs out of jugs of water or grapes and then stops and logs out. using the script: start the script near any bank, you dont need to have an empty inventory cause the script will jsut bank everything if inventory contains any unnecessary items. Download souce + jar: https://github.com/Cloudyman420/wine-maker would like to see any feedback about the code and the actual script and see where could I improve.
May 8, 20214 yr Author Just now, hidden arrow said: I think you have to be approved to post this my brother goodluck. oh damn, really? where could I get approved then?
May 8, 20214 yr 1 hour ago, CloudyMan said: This is my first attemt making a script in java. the script is very basic it just makes wines until it runs out of jugs of water or grapes and then stops and logs out. using the script: start the script near any bank, you dont need to have an empty inventory cause the script will jsut bank everything if inventory contains any unnecessary items. Download souce + jar: https://github.com/Cloudyman420/wine-maker would like to see any feedback about the code and the actual script and see where could I improve. Good to see some new scripters Some tips: - I would only initiliaze stuff in the onStart, never really executed any interaction code in it. Since it's only run once it can fail. Another thing that will cause issues is that you do 15 tasks in a row. This will clog up sooner or later. If 1 action missclicks it could get stuck. What you should do instead is only execute 1-2 commands every loop. if animating => Wait, we are making wines else if inventory contains jug of water and grapes => use grapes on water else if inventory does not contain water and grapes => Bank else if bank is open? => if we have wine deposit else if bank is open and we have no wine? check if we have water else withdraw water else if bank is open and we have no wine? check if we have grapes else withdraw grapes this is just an example but it will improve stability by a lot. Kind regards Khaleesi Edited May 8, 20214 yr by Khaleesi
May 8, 20214 yr Welcome to the world of scripting! You don't need permission to post in the unofficial scripts section, so you're good. 100% agree with what Khal said, work on doing only one action per loop, and the onStart stuff. Other than that, a winemaker is a great idea for a first script. Hope to see more from you soon! Good luck!
May 8, 20214 yr Author 18 minutes ago, Lunar said: Welcome to the world of scripting! You don't need permission to post in the unofficial scripts section, so you're good. 100% agree with what Khal said, work on doing only one action per loop, and the onStart stuff. Other than that, a winemaker is a great idea for a first script. Hope to see more from you soon! Good luck! thank you, will try to work on it in the future. 27 minutes ago, Khaleesi said: Good to see some new scripters Some tips: - I would only initiliaze stuff in the onStart, never really executed any interaction code in it. Since it's only run once it can fail. Another thing that will cause issues is that you do 15 tasks in a row. This will clog up sooner or later. If 1 action missclicks it could get stuck. What you should do instead is only execute 1-2 commands every loop. if animating => Wait, we are making wines else if inventory contains jug of water and grapes => use grapes on water else if inventory does not contain water and grapes => Bank else if bank is open? => if we have wine deposit else if bank is open and we have no wine? check if we have water else withdraw water else if bank is open and we have no wine? check if we have grapes else withdraw grapes this is just an example but it will improve stability by a lot. Kind regards Khaleesi thanks for the tips, and the little private lesson
May 9, 20214 yr Author 8 hours ago, skillerkidos1 said: Looks good! Can’t wait to see what else you make! thank you trying to improve this one at the moment, but have some ideas for the future if everything works out.
June 16, 20223 yr On 5/8/2021 at 6:25 PM, CloudyMan said: This is my first attemt making a script in java. the script is very basic it just makes wines until it runs out of jugs of water or grapes and then stops and logs out. using the script: start the script near any bank, you dont need to have an empty inventory cause the script will jsut bank everything if inventory contains any unnecessary items. Download souce + jar: https://github.com/Cloudyman420/wine-maker would like to see any feedback about the code and the actual script and see where could I improve. I'll try it, thanks
Create an account or sign in to comment