-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
60 lines (57 loc) · 1.74 KB
/
run.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
# Imports have to be in this order, leave this comment here to fall back to it if they get messed up
# import sc2, sys
# from __init__ import run_ladder_game
# from sc2 import Race, Difficulty
# from sc2.player import Bot, Computer
# import random
import numpy.core.multiarray
import sc2, sys
from __init__ import run_ladder_game
from sc2 import Race, Difficulty
from sc2.player import Bot, Computer
import random
# Load bot
from Main import RoachRush
bot = Bot(Race.Zerg, RoachRush())
# Start game
if __name__ == "__main__":
if "--LadderServer" in sys.argv:
# Ladder game started by LadderManager
print("Starting ladder game...")
result, opponentid = run_ladder_game(bot)
print(f"{result} against opponent {opponentid}")
else:
# Local game
print("Starting local game...")
map_name = random.choice(
[
"(2)16-BitLE",
"(2)AcidPlantLE",
"(2)CatalystLE",
"(2)DreamcatcherLE",
"(2)LostandFoundLE",
"(2)RedshiftLE",
"(4)DarknessSanctuaryLE",
]
)
map_name = random.choice(
[
"ProximaStationLE",
"NewkirkPrecinctTE",
"OdysseyLE",
"MechDepotLE",
"AscensiontoAiurLE",
"BelShirVestigeLE",
]
)
# map_name = "(2)16-BitLE"
sc2.run_game(
sc2.maps.get(map_name),
[
# Human(Race.Terran),
bot,
Computer(Race.Random, Difficulty.VeryHard), # CheatInsane VeryHard
],
realtime=False,
save_replay_as="Example.SC2Replay",
)