Created
August 12, 2017 06:41
-
-
Save timshen91/b0aa69e311ea3546ebc772c091b571fd to your computer and use it in GitHub Desktop.
StarCraftII Repl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import websocket | |
from s2clientprotocol import sc2api_pb2 | |
from google.protobuf import text_format | |
conn = websocket.create_connection("ws://127.0.0.1:9999/sc2api") | |
try: | |
while True: | |
conn.send(text_format.Parse(input(), sc2api_pb2.Request()).SerializeToString()) | |
resp = sc2api_pb2.Response() | |
resp.ParseFromString(conn.recv()) | |
print(resp) | |
except KeyboardInterrupt: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment