-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun.py
More file actions
23 lines (21 loc) · 704 Bytes
/
run.py
File metadata and controls
23 lines (21 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sc2, sys
from __init__ import run_ladder_game
from sc2 import Race, Difficulty
from sc2.player import Bot, Computer
# Load bot
from example_bot import ExampleBot
bot = Bot(Race.Random, ExampleBot())
# 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(result," against opponent ", opponentid)
else:
# Local game
print("Starting local game...")
sc2.run_game(sc2.maps.get("Abyssal Reef LE"), [
bot,
Computer(Race.Protoss, Difficulty.VeryHard)
], realtime=True)