CloudyMan Posted May 8, 2021 Share Posted May 8, 2021 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. Quote Link to comment Share on other sites More sharing options...
hidden arrow Posted May 8, 2021 Share Posted May 8, 2021 I think you have to be approved to post this my brother goodluck. Quote Link to comment Share on other sites More sharing options...
CloudyMan Posted May 8, 2021 Author Share Posted May 8, 2021 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? Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted May 8, 2021 Share Posted May 8, 2021 (edited) 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, 2021 by Khaleesi 2 Quote Link to comment Share on other sites More sharing options...
Lunar Posted May 8, 2021 Share Posted May 8, 2021 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! 1 Quote Link to comment Share on other sites More sharing options...
CloudyMan Posted May 8, 2021 Author Share Posted May 8, 2021 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 1 Quote Link to comment Share on other sites More sharing options...
skillerkidos1 Posted May 9, 2021 Share Posted May 9, 2021 Looks good! Can’t wait to see what else you make! Quote Link to comment Share on other sites More sharing options...
CloudyMan Posted May 9, 2021 Author Share Posted May 9, 2021 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. Quote Link to comment Share on other sites More sharing options...
Graciekiller1 Posted June 16, 2022 Share Posted June 16, 2022 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 Quote Link to comment Share on other sites More sharing options...