Pengu 23 Share Posted June 3, 2018 I've been using batch files on my farm for a while now to start all my clients with different arguments, and want to move over to having one master client that can restart clients etc. I want the master client to start all other clients with different args. I know how i can start multiple clients with the same arguments. try { for (int i = 0; i < 5; i++){ String JAVA_FILE_LOCATION = "java -Xmx512M -jar -Xbootclasspath/p:C:\\Users\\Nig\\Dreambot\\BotData\\client.jar C:\\Users\\Nig\\Dreambot\\BotData\\client.jar"; Runtime.getRuntime().exec(JAVA_FILE_LOCATION); } } catch (Exception e) { e.printStackTrace(); } How can I start multiple clients with different args and detect if one of them closes and start it again with same args. Would appriciate some help on what to look into etc. Link to comment Share on other sites More sharing options...
Zoe 7 Share Posted June 3, 2018 Set a list of all the arguments you'd like to run the client with (and possibly the amount of clients for that specified argument), and then process the list, running a client with the arguments (and number of clients to open). I would just write a bit of code to have it read, say a JSON file (for ease of access, readability and editing without compiling), or any other file where you can add arguments. Then just read the file and set your run variable/argument (and amount of clients to open). Is this sort of what you were after? Link to comment Share on other sites More sharing options...
Nuclear Nezz 2056 Share Posted June 3, 2018 Java doesn't actually have that great of a process manager (at least, java 8 doesn't) so I would recommend looking into using Python for your "master client" code. There you can do something like every time you create a new process, add it to a list of "running" processes when a process in the "running" list is no longer running, restart it. Link to comment Share on other sites More sharing options...
Pengu 23 Author Share Posted June 3, 2018 3 hours ago, Zoe said: Set a list of all the arguments you'd like to run the client with (and possibly the amount of clients for that specified argument), and then process the list, running a client with the arguments (and number of clients to open). I would just write a bit of code to have it read, say a JSON file (for ease of access, readability and editing without compiling), or any other file where you can add arguments. Then just read the file and set your run variable/argument (and amount of clients to open). Is this sort of what you were after? 1 hour ago, Nuclear Nezz said: Java doesn't actually have that great of a process manager (at least, java 8 doesn't) so I would recommend looking into using Python for your "master client" code. There you can do something like every time you create a new process, add it to a list of "running" processes when a process in the "running" list is no longer running, restart it. Thanks, ill look into theese Never touched python, but ill check it out. My main reason for needing this is so that i can get new cache after x amount of bans etc instead of me restarting all clients after 3-4 days of bans on the same cache. ¯\_(ツ)_/¯ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.