This script attempts to maintain a player balance on an online server automatically.
Usage:
Preview:
maxautobot = 8 // maximum number of bots we can add balautobot = 8 // attempt to keep this many players runautobot = [ cln = (listclients 1) bot = 0; ppl = 0 loop i (listlen $cln) [ num = (at $cln $i) if (= (isspectator $num) 0) [ ppl = (+ $ppl 1) if (strcmp (getclientname $num) bot) [ // not ideal, but it works bot = (+ $bot 1) ] ] ] if (> $balautobot 0) [ amt = (- $balautobot $ppl) if (> $amt 0) [ if (> (+ $bot $amt) $maxautobot) [ amt = (- $maxautobot $bot) ] if (mod (+ $ppl $amt) 2) [ amt = (- $amt 1) ] if (> $amt 0) [ loop i $amt [ addbot ] ] ] [ amt = (- 0 $amt) if (> $amt 0) [ if (> $amt $bot) [ amt = $bot ] if (mod (- $ppl $amt) 2) [ amt = (+ $amt 1) ] if (> $amt 0) [ loop i $amt [ delbot ] ] ] ] ] [ if (> $bot 0) [ loop i $bot [ delbot ] ] ] ] doautobot = [ runautobot if (&& (= $balautobot $arg1) (> $balautobot 0)) [ sleep 1000 [ doautobot $balautobot ] // rinse, repeat ] ] autobot = [ if (> $numargs 0) [ balautobot = $arg1 ] doautobot $balautobot ]