Skip to content

Repository files navigation

WatchGCG

This repo contains scripts to extract game data from GCG files in realtime for live stream broadcasts. Works as both a GUI and a CLI tool using the same script.

Table of Contents

Features

  • Automatic Dependency Handling: The script auto-installs required modules (no need to pre-install anything).

  • Dual Interface: The same script can be run as a graphical interface (GUI) or from the command line (CLI).

  • Version Selection: Supports both the default (std) and Australian (au) versions of the script (choose with the optional --ver parameter).

    • std: outputs one score file containing both players' scores
    • au: outputs separate score files for Player 1 and Player 2

Requirements

  • Python 3.9+ recommended (any modern Python 3 should work).

  • watchfiles module is installed automatically on first run but you must have requirements.txt. If you prefer manual install instead, run:

    # Manual installation
    python -m pip install watchfiles
    # or
    python3 -m pip install watchfiles
    # on Windows if you use the launcher:
    py -m pip install watchfiles

Running the GUI

Running the GUI presumes that you have the TK App installed (Windows & the official macOS python.org installers already include Tk.)

Methods

You have two options:

  • UI (Recommended)

    • Clone the repo to your computer
    • Double-click watch_gcg.py
  • CLI

    • Clone the repo to your computer
    • Navigate to its directory in the Command Terminal
    • Any one of these will open the GUI:
    python watch_gcg.py
    # OR
    python3 watch_gcg.py
    # OR
    py watch_gcg.py   # Windows launcher

In the GUI

  • Use the dropdown menu at the top to choose between the Default and Australian versions.
  • Use the Browse buttons to choose pre-existing files.
  • Press Start to start watching the .gcg file.

Note: DO NOT change the Python exe field and DO NOT click on the Find button unless you specifically want to change the python executable that you're using. This field is pre-populated by the script, which automatically finds your python executable. If you change the field and can't figure out where your python executable lives, close and re-open the GUI using the methods detailed above.

CLI Usage

Default version -- one combined score file (std)

The script needs 6 arguments:

  • The input GCG file to watch
  • The input lexicon file with definitions
  • The output file name for the scores
  • The output file name for the unseen tiles
  • The output file name for the unseen tiles count
  • The output file name for the last play

For example, to watch a GCG file called 'test.gcg', use the following command:

python3 watch_gcg.py --gcg test.gcg --lex CSW24defs.csv --score score.txt --unseen unseentiles.txt --count unseencount.txt --lp lastplay.txt

Australian version -- two score files (--ver au)

To output two separate score files, pass:

  • --ver au, and
  • either one --score OR both --p1score and --p2score

Option A (use --score only)

python3 watch_gcg.py --gcg test.gcg --lex CSW24defs.csv --ver au --score score.txt --unseen unseentiles.txt --count unseencount.txt --lp lastplay.txt
# writes ./p1_score.txt and ./p2_score.txt

Option B (use both --p1score and --p2score)

python3 watch_gcg.py --gcg test.gcg --lex CSW24defs.csv --ver au --p1score p1_score.txt --p2score p2_score.txt --unseen unseentiles.txt --count unseencount.txt --lp lastplay.txt

Notes

The script should now run indefinitely watching for changes to the GCG file. To stop execution in the terminal (CLI), hit Control-C. In the GUI, close the window.

The output files update when you save the game. Editing/committing moves in Quackle without saving the .gcg file won’t trigger changes.

About

Scripts to extract game data from GCG files in realtime for live stream broadcasts

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages