我在Ubuntu上用酒安装了《星际争霸II》,并且遵循了senddex系列
https://www.youtube.com/watch?v=5U2WdZxJhEE&list=PLQVvvaa0QuDcT3tPehHdisGMc8TInNqdq&index=2
我在观看第二个视频时,正确地复制了他编写的代码,并且在运行游戏时打开并立即关闭并将其提供给终端
0033:fixme:ntdll:NtQueryDirectoryObject multiple entries not implemented
我不知道该怎么做,因为我搜索的内容似乎都不是我要找的东西。之后,我没有通过使用sc2库的代码打开游戏,而是使用wine执行了.exe文件,并且没有关闭游戏,我运行了代码并抛出了以下错误。之后,我尝试终止该进程,但似乎找不到它,并且不断抛出以下错误,我什至没有重新启动计算机。这是错误
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fe9f447e908>
到目前为止,这是我的代码。
import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
from sc2.constants import NEXUS, PROBE
class MelsBot(sc2.BotAI):
async def on_step(self, iteration):
await self.distribute_workers()
await self.build_workers()
await self.build_pylons()
async def build_workers(self):
for nexus in self.units(NEXUS).ready.noqueue:
if self.can_afford(PROBE):
await self.do(nexus.train(PROBE))
async def build_pylons(self):
if self.supply_left < 5 and not self.already_pending(PYLON):
nexuses = self.units(NEXUS).ready
if nexuses.exists:
if self.can_afford(PYLON):
await self.build(PYLON, near=nexuses.first)
run_game(maps.get("AbyssalReefLE"), [
Bot(Race.Protoss, MelsBot()),
Computer(Race.Protoss, Difficulty.Easy)
], realtime=True)