ValvePython / dota2

🐸 Python package for interacting with Dota 2 Game Coordinator
http://dota2.readthedocs.io
198 stars 32 forks source link

request_top_source_tv_games() returns ready #73

Closed Hekkta closed 3 years ago

Hekkta commented 3 years ago

Just as in 48, the method returns ready.

But I tried with both a new account and old account and it didn't make a difference.

I'm assuming I'm doing something wrong as I'm pretty new to all this.

Here's the code:

from steam.client import SteamClient import dota2

client = SteamClient() dota = dota2.client.Dota2Client(client)

@client.on('logged_on') def start_dota(): print('launching') dota.launch()

@dota.on('ready') def do_dota_stuff(): print('finished launching')

job = dota.request_top_source_tv_games()
print(dota.wait_msg(job, timeout=20))

client.cli_login() client.run_forever()

FedorAronov commented 3 years ago
# 🤔🤔🤔
dota_client.request_top_source_tv_games(hero_id=14)
response, = dota_client.wait_event("top_source_tv_games", timeout=5) or (None,)
# 😎😎😎
dota_client.send(EDOTAGCMsg.EMsgClientToGCFindTopSourceTVGames, {"hero_id": 14})
response, = dota_client.wait_event(EDOTAGCMsg.EMsgGCToClientFindTopSourceTVGamesResponse, timeout=5) or (None,)
Hekkta commented 3 years ago

My hero <3