Small OCR scanner for exporting Zenless Zone Zero Drive Disc inventory data.
The tool uses screenshots, calibrated UI regions, and Tesseract OCR to read disc details from the game inventory. It is intended as a read-only inventory exporter: it does not modify game files, access game memory, bypass anti-cheat, or automate gameplay/rewards.
Install Python dependencies:
.\venv\Scripts\pip.exe install -r requirements.txtInstall Tesseract OCR and update this path in src/scan_disc.py if needed:
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"Run grid calibration first:
.\venv\Scripts\python.exe -m src.calibrate.calibrate_gridThen run ROI calibration:
.\venv\Scripts\python.exe -m src.calibrate.calibrate_roisThe ROI calibration can also save an optional inventory count ROI used for
count-based stopping. Select the count text such as 1234/3000 when prompted.
Calibration stores the window size used for the selected coordinates. During scans, grid positions and OCR ROIs are scaled from that base size to the current ZZZ window size.
To capture a screenshot fixture for tests, open the Drive Disc inventory and run:
.\venv\Scripts\python.exe -m src.tools.capture_zzz_screenshotUse --name disc_inventory_1920x1080.png to choose a stable filename.
Start the row scanner:
.\venv\Scripts\python.exe -m src.scan_by_rowsOutput is written to:
output/scanned_discs.json
Logs are written to:
output/scanner.log
Timing values live in config/grid_config.json:
"click_delay": 0.35,
"input_settle_delay": 0.05,
"auto_scroll_delay": 0.6If scans sometimes read the previous selected disc, increase click_delay.
OCR fields run in parallel by default. To compare worker counts:
$env:ZZZ_OCR_WORKERS=1
.\venv\Scripts\python.exe -m src.scan_by_rowsThe scanner stops when the row-compare logic detects the end of the inventory.
Optionally, set expected_total_discs in config/grid_config.json, or calibrate
inventory_count_roi, to stop once the output reaches the known disc count.
If count OCR fails, debug images are saved:
output/inventory_count_roi_raw.png
output/inventory_count_roi_processed.png
Run the lightweight parser and scaling checks:
.\venv\Scripts\python.exe -m src.tools.test_text_parser
.\venv\Scripts\python.exe -m src.tools.test_coordinate_scalingRun OCR against tracked screenshot fixtures:
.\venv\Scripts\python.exe -m src.tools.test_screenshot_fixtures