generated from the-evillevi/python-sc2-bot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
37 lines (31 loc) · 902 Bytes
/
bot.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
from sc2.bot_ai import BotAI, Race
from sc2.data import Result
class CompetitiveBot(BotAI):
NAME: str = "CompetitiveBot"
"""This bot's name"""
RACE: Race = Race.Terran
"""This bot's Starcraft 2 race.
Options are:
Race.Terran
Race.Zerg
Race.Protoss
Race.Random
"""
async def on_start(self):
"""
This code runs once at the start of the game
Do things here before the game starts
"""
print("Game started")
async def on_step(self, iteration: int):
"""
This code runs continually throughout the game
Populate this function with whatever your bot should do!
"""
pass
async def on_end(self, result: Result):
"""
This code runs once at the end of the game
Do things here after the game ends
"""
print("Game ended.")