-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
32 lines (27 loc) · 1007 Bytes
/
Copy pathrun.py
File metadata and controls
32 lines (27 loc) · 1007 Bytes
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
import sys, sc2
from sc2.bot_ai import BotAI
from __init__ import run_ladder_game
# Load bot
from mavBot import MavBot
from sc2 import maps
from sc2.data import Difficulty, Race
from sc2.main import run_game
from sc2.player import Bot, Computer
bot = Bot(Race.Protoss, MavBot())
class WorkerRushBot(BotAI):
async def on_step(self, iteration):
for worker in self.workers:
worker.attack(self.enemy_start_locations[0])
bot2 = Bot(Race.Protoss, WorkerRushBot())
# 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...")
run_game(maps.get("HardwireAIE"), [bot, Computer(Race.Zerg, Difficulty.VeryHard)], realtime=False)
#run_game(maps.get("HardwireAIE"), [bot, bot2], realtime=True)