Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Start multiple instances different args


    Pengu

    Recommended Posts

    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

    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

    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

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.