-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDistrictStarter.py
67 lines (55 loc) · 1.42 KB
/
DistrictStarter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os, subprocess, sys, random
NUM_DISTRICTS = 5
districtNames = [
'Boingy Acres',
'Boingy Bay',
'Boingy Summit',
'Boingyboro',
'Bouncy Summit',
'Crazy Grove',
'Crazy Hills',
'Crazyham',
'Funnyfield',
'Giggly Bay',
'Giggly Grove',
'Giggly Hills',
'Giggly Point',
'Gigglyfield',
'Gigglyham',
'Goofy Valley',
'Goofyport',
'Kooky Grove',
'Kookyboro',
'Loopy Harbor',
'Nutty Hills',
'Nutty River',
'Nutty Summit',
'Nuttyville',
'Nuttywood',
'Silly Rapids',
'Silly Valley',
'Sillyham',
'Toon Valley',
'Zany Acres'
]
cutDistrictNames = random.sample(districtNames, NUM_DISTRICTS)
# if districtNames[21] not in cutDistrictNames:
# Add Nutty River to the district list.
# cutDistrictNames.append(districtNames[21])
startingNum = 401000000
isWindows = sys.platform == 'win32'
isLinux = sys.platform == 'linux'
if isWindows:
os.chdir('startup/win32')
elif isLinux:
os.chdir('startup/unix')
for index, elem in enumerate(cutDistrictNames):
subprocess.shell = True
districtName = str(cutDistrictNames[index])
os.environ['DISTRICT_NAME'] = districtName
os.environ['BASE_CHANNEL'] = str(startingNum)
if isWindows:
os.system('start cmd /c districtStarter.bat')
elif isLinux:
os.system(f'screen -dmS "{districtName}" ./districtStarter.sh')
startingNum = startingNum + 1000000