Advertisement
RaZgRiZ

Autobot Player Balancer 1.3 SVN

May 1st, 2012
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. autobot = [
  2.     local bots players maxbots total
  3.     bots = 0
  4.     players = 0
  5.     maxbots = (? (isconnected) (? (ismaster (getclientnum)) (? (isadmin (getclientnum)) 32 8) 0) 32)
  6.     looplist l (listclients 1) [
  7.         cond (> $l 127) [
  8.             bots = (+ $bots 1)
  9.         ] (&& (< $l 128) (! (isspectator $l))) [
  10.             players = (+ $players 1)
  11.         ]
  12.     ]
  13.     _ab_balance = $arg1
  14.     if (&& (> $arg1 0) $maxbots) [
  15.         total = (+ $bots $players)
  16.         cond (&& (< $bots $maxbots) (< $total $_ab_balance)) [
  17.             loop i (min (- $_ab_balance $total) $maxbots) addbot
  18.         ] (&& (< $_ab_balance $total) (> $bots 0)) [
  19.             loop i (min (- $total $_ab_balance) $bots) delbot
  20.         ]
  21.         sleep 500 [
  22.             autobot = [@@@autobot]
  23.             autobot $_ab_balance
  24.             if $_ab_balance [
  25.                 autobot = [_ab_balance = $arg1]
  26.             ]
  27.         ]
  28.     ] [loop i $bots delbot]
  29. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement