-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: how would I implement receiving moves from a server? #61
Comments
After 9ac351f, you can control lizgoban from its STDIN as follows (example on Linux).
See Please note that this feature is experimental and API etc. may be changed in future. Enjoy! |
Cool thank you very much! |
I think the message 'sysctlbyname ...' is unrelated to this feature. If you notice D3 and R4 stones on the board, the Both 'undefined' and 'REPL is closed' messages indicate expected behaviors. The former means that the API returns nothing, while the latter shows that the |
(1) (2) (3) #!/bin/python3
import subprocess
import time
working_directory = '/PATH/TO/LIZGOBAN'
command = 'npm start -- -j \'{"repl": true}\''
process = subprocess.Popen(
command,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
cwd=working_directory,
)
process.stdin.write('mimic("play", "D3")\n')
process.stdin.flush()
time.sleep(3)
process.stdin.write('mimic("play", "R4")\n')
process.stdin.flush()
time.sleep(3)
process.stdin.write('app.quit()\n')
process.stdin.flush()
process.wait() |
You are right. I have been running
The Python code also ran successfully. I need to further consider how to dynamically obtain data information for synchronous analysis. Thanks for your guidance! update: Success! I was able to request data from the website https://19x19.com/engine/live/list/117738?from=%2Fengine%2Flive%2Fdata%2F117738&to=%2Fengine%2Flive%2Fdata%2F117738&liveType=TOP_LIVE and sync it to the application for analysis. Thank you very much! |
Encountered a new issue: The following method works in the command line: mimic('read_sgf','(;AP[golaxy]CA[UTF-8]KM[6.5]PB[金湊笌]PW[金珉舒]RE[B+R]SZ[19];B[pd];W[dp])') However, it is invalid when running in Python. The sgf string would not be loaded. s='(;AP[golaxy]CA[UTF-8]KM[6.5]PB[金凑笌]PW[金珉舒]RE[B+R]SZ[19];B[pd];W[dp])'
command=f"mimic('read_sgf','{s}')"
self.process.stdin.write(command)
self.process.stdin.flush() |
missing
|
You're right. It works if |
I would like to hook up lizgoban to OGS to make every move of an OGS game appear live in lizgoban.
For that I would be able to do the OGS adapter part, but I do not know how I would make the necessary changes to lizgoban.
My main question is: How do I programmatically enter a move into lizgoban?
The text was updated successfully, but these errors were encountered: