added better headlines for tabs in vote menu
[twcon.git] / scripts / mass_server.py
blobd9a304d5a60d32d142eacda432aa3e6cc9fe0154
1 #from random import choice
3 import random
4 import os
6 masterservers = ["localhost 8300"]
8 maps = [
9 ["dm1", "dm2", "dm6"],
10 ["dm1", "dm2", "dm6"],
11 ["ctf1", "ctf2", "ctf3"],
14 servernames = [
15 "%s playhouse",
16 "%s own server",
19 nicks = []
20 for l in file("scripts/nicks.txt"):
21 nicks += l.replace(":port80c.se.quakenet.org 353 matricks_ = #pcw :", "").strip().split()
22 inick = 0
24 def get_nick():
25 global inick, nicks
26 inick = (inick+1)%len(nicks)
27 return nicks[inick].replace("`", "\`")
29 for s in xrange(0, 350):
30 cmd = "./fake_server_d_d "
31 cmd += '-n "%s" ' % (random.choice(servernames) % get_nick())
32 for m in masterservers:
33 cmd += '-m %s '%m
35 max = random.randint(2, 16)
36 cmd += "-x %d " % max
38 t = random.randint(0, 2)
40 cmd += '-a "%s" ' % random.choice(maps[t])
41 cmd += '-g %d ' % random.randint(0, 100)
42 cmd += '-t %d ' % t # dm, tdm, ctf
43 cmd += "-f %d " % random.randint(0, 1) # password protected
45 for p in xrange(0, random.randint(0, max)):
46 cmd += '-p "%s" %d ' % (get_nick(), random.randint(0, 20))
48 print cmd
49 os.popen2(cmd)