This script monitors the active games of a specific player on OGS (Online Go Server) and updates a configuration file based on the opponent's rank.
- Python 3.x
requests
library (can be installed usingpip install -r requirements.txt
)
-
Set Player ID:
- Replace
player_id
in themain()
function with the OGS player ID you want to monitor.
- Replace
-
Set Configuration File Path:
- Update the
config_file_path
variable in themain()
function with the path to the configuration file you want to modify.
- Update the
-
Fetch Active Games:
- The script queries the OGS API to get the active games for the specified player.
-
Extract Opponent Information:
- For each active game, it determines the opponent and retrieves their rating.
-
Update Configuration File:
- The script updates a specific line in the configuration file to reflect the opponent's rank based on their rating.
-
Continuous Monitoring:
- The script continuously checks for active games every 2 seconds and updates the configuration file accordingly.
-
Run the Script:
-
Execute the script using Python:
python path/to/ELO.py
-
-
Script Output:
- The script prints the updated rank label and the opponent's name to the console.
- If the script encounters any issues (e.g., network errors or file read/write issues), it will print an error message to the console.
This script is licensed under the MIT License. See the LICENSE file for more details.
For questions or feedback, please reach out to changcheng6541@gmail.com.