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
  • Creating Batch Files to Run Multiple Accounts


    CatnipandMilk

    Recommended Posts

    You can create a batch file with command line arguments for a specific user and script. Now that Dreambot has a built-in scheduler, life is even easier. 

    With the argument "-script script_name_here" we can have an account launch an instance and cycle through several tasks by running just a batch file for each account we want running. I currently have it take my freshly created account details and turn them into a trade-ready account.

     

    You can use a Python script to create bulk batch files from an account.txt file (USN:PASS format):

    import os
    
    # Read accounts from accounts.txt
    with open('accounts.txt', 'r') as file:
        accounts = file.read().splitlines()
    
    # Updated template for the batch file
    batch_template = """java -Xmx500M -jar "C:\\Users\\User\\DreamBot\\BotData\\client.jar" -schedule Fresh -proxyHost 00.000.000.000 -proxyPort 0000 -accountUser "{email}" -accountPass {password} -userhome {email} -covert
    """
    
    # Create batch files for each account
    for i, account in enumerate(accounts, start=1):
        email, password = account.split(':')
        batch_content = batch_template.format(email=email, password=password)
    
        batch_filename = f'account{i}.bat'
        with open(batch_filename, 'w') as batch_file:
            batch_file.write(batch_content)
    
        print(f'{batch_filename} created successfully.')

     

    You should be able to add a timer to close the application after a set period, but I'm still trying to make this work:

    import os
    
    # Read accounts from accounts.txt
    accounts_file_path = 'accounts.txt'
    client_jar_path = 'C:\\Users\\USER\\DreamBot\\BotData\\client.jar'
    
    if not os.path.exists(accounts_file_path):
        print(f"Error: {accounts_file_path} not found.")
        exit()
    
    with open(accounts_file_path, 'r') as file:
        accounts = [line.strip() for line in file]
    
    # Updated template for the batch file
    batch_template = """start java -Xmx500M -jar "{client_jar_path}" -schedule Fresh -proxyHost 00.000.000.000 -proxyPort 0000 -accountUser "{email}" -accountPass {password} -userhome {email} -covert
    timeout /t 900 /nobreak  REM Wait for 900 seconds (15 minutes)
    taskkill /F /IM java.exe
    exit
    """
    
    # Create batch files for each account
    for i, account in enumerate(accounts, start=1):
        try:
            email, password = account.split(':')
        except ValueError:
            print(f"Error: Invalid account format in line {i} of {accounts_file_path}.")
            continue
    
        batch_content = batch_template.format(email=email, password=password, client_jar_path=client_jar_path)
    
        batch_filename = f'account{i}.bat'
        with open(batch_filename, 'w') as batch_file:
            batch_file.write(batch_content)
    
        print(f'{batch_filename} created successfully.')

     

    In theory, you could chain the batch files together and add an exit java.exe line after the timer and before the next batch file is run. This should run the schedule for x time and then close the client, and start the next account. Still working on this part, tho.

     

    Edited by CatnipandMilk
    Link to comment
    Share on other sites

    • 4 weeks later...

    i have a fresh off tut island account. i want it to mine copper (dropping ores) to level 10 and then stop. can you show a script describing this application ?

     

    Link to comment
    Share on other sites

    Replace this part:

    # Updated template for the batch file
    batch_template = """start java -Xmx500M -jar "{client_jar_path}" -schedule Fresh -proxyHost 00.000.000.000 -proxyPort 0000 -accountUser "{email}" -accountPass {password} -userhome {email} -covert
    timeout /t 900 /nobreak  REM Wait for 900 seconds (15 minutes)
    taskkill /F /IM java.exe
    exit

    with your script and it's parameters/arguments/CLI commands

    # Updated template for the batch file
    batch_template = """start java -Xmx500M -jar C:/Users/YOURUSER/DreamBot/BotData/client.jar -schedule Fresh -proxyHost 00.000.000.000 -proxyPort 0000 -script "BarMiner" -params "Bronze - Lumbridge" -account "[email protected]" -covert -world f2p
    timeout /t 900 /nobreak  REM Wait for 900 seconds (15 minutes)
    taskkill /F /IM java.exe
    exit

    If you don't have a proxy, just delete that part.

    Link to comment
    Share on other sites

    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 account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • 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.