drdr444 1 Share Posted June 30, 2022 i want to make custom parameters in quickstart and make use of them by like Run-Time Type Information. for example , if param 1 is set as patternA, a script attacks monsterA, and if param 1 is set as patternB, the script attacks monsterB. in short, i want to run the same script differently depending on quickstart parameters, so that i dont have to make many simular scripts. if it is possible, plz show me some exaple codes. thanks in advance. Link to comment Share on other sites More sharing options...
yeeter 523 Share Posted June 30, 2022 yeah you can easily pass params from quickstart to your onStart method in your script Script setup (write your own code to handle the things you mentioned, this is just showing you how to pass the params) public void onStart(String... params) { for (String param : params) { System.out.println(`Passed parameter: ${param}`); } onStart(); // Calling your default on start if you also plan on using this script without parameters } public void onStart() { // code you use with and without parameters (starting GUIs, kicking off establishing external connects etc) } CLI Command building official docs are pretty POG -> https://dreambot.org/guides/user-guide/quickstart/#available-parameters In the 'Available Parameters' section of that post you'll see a flag called '-params' these are the params that get passed to your new onStart(String .. params){} method you added to your script. java -jar C:\Users\YOURNAME\DreamBot\BotData\client.jar -script "Test Script" -params Param1 Param2 Param3 simple as that~ Link to comment Share on other sites More sharing options...
drdr444 1 Author Share Posted July 1, 2022 (edited) thanks yeeter01 as always! I really appreciate it. Edited July 1, 2022 by drdr444 Link to comment Share on other sites More sharing options...
yeeter 523 Share Posted July 1, 2022 15 hours ago, drdr444 said: thanks yeeter01 as always! I really appreciate it. no problem 😃 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