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
  • [BASH] MassLauncher, How to Ruin Any Script Quickly


    falloutr

    Recommended Posts

    Hi guys,

    So my first post here and first post really getting back into the community. I came from TopBot which is an old defunct client so have some experience from the past.
    Anyway on with the thread..

    I went a bit overboard with this one but its fairly simple in design, it will take a file formatted like below located in the same directory as it
     

    308:script name:param0 param1
    318:script name0:param0
    331:script name1:params...


    And launch the script it is configured to launch on all those accounts with the world selected, once done it will output their PIDs and you can press enter to kill them all at once.
    Its pretty straight forward that I'm sure most of you can figure out how to convert it to your favorite scripts if they require more or less parameters

    Here is the beast:
     

    #!/bin/bash
    file='accounts.txt'
    db_username='YOUR_DB_USERNAME'
    db_pass='YOUR_DB_PASS'
    
    pids_calc="pgrep java"
    pids=$(eval $pids_calc)
    while IFS=: read -r world script params
    do	
    	sh -c 'java -jar ~/DreamBot/BotData/client.jar -world "$0" -username "$1" -password "$2" -script "$3" -params "$4"' "$world" "$db_username" "$db_pass" "$script" "$param0"&
    	sleep .5
    	newpids_calc="pgrep java"
    	newpids=$(eval $newpids_calc)
    	newpid=($(comm --nocheck-order -3 <(printf "%s\n" "${pids[@]}") <(printf "%s\n" "${newpids[@]}")))
    	printf "*****\n"
    	printf "*\n"
    	printf "NEW PID IS: %s\n" $newpid
    	printf "*\n"
    	printf "*****\n"
    	newpid=" "$newpid
    	finalpids+=$newpid
    	sleep 3
    	pids=$newpids
    	let "launch_count++"
    done < "$file"
    let "sleep_time=4*$launch_count" #change out the number here for faster/slower finish time
      				 #set conservatively to 4 by default because slow VPS, 2 is optimal on my desktop
    sleep $sleep_time
    printf "*****\n"
    printf "*\n"
    printf "Client launched with pid: %s\n" $finalpids 
    printf "All clients launched, press enter to kill all\n"
    printf "*\n"
    printf "*****\n"
    read -s
    kill -9 $finalpids


    P.S. any feedback is welcome, if you have a masslauncher yourself share it :^D
    Would love to get a powershell and awk version too!

    P.P.S. I'll be adding any good recommendations and separate versions to the OP, giving credit ofc
    Also special thanks to Nezz for doing most of the work! :^)

    EDIT0: Made it a bit more generic to make it a little bit easier for other scripts

    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.