qlpycon/README.md
2026-01-09 13:17:30 +01:00

2.6 KiB

QLPyCon - Quake Live Python Console

Terminal-based client for monitoring and controlling Quake Live servers via ZMQ.

Features

  • Real-time game monitoring (kills, deaths, medals, team switches)
  • Server info display (map, gametype, scores, player list)
  • Team-aware colorized chat with location tracking
  • Powerup pickup and carrier kill notifications
  • JSON event capture for analysis
  • Quake color code support (^0-^7)
  • Autocomplete for cvars/commands with fuzzy matching
  • Intelligent argument suggestions for 25+ commands (bot names, maps, gametypes)

Installation

pip install pyzmq
python main.py --host tcp://SERVER_IP:PORT --password RCON_PASSWORD

Usage

# Basic
python main.py --host tcp://SERVER_IP:PORT --password RCON_PASSWORD

# Verbose logging
python main.py --host tcp://SERVER_IP:PORT --password RCON_PASSWORD -v

# Capture JSON events
python main.py --host tcp://SERVER_IP:PORT --password RCON_PASSWORD --json events.log

Options:

  • --host URI - ZMQ RCON endpoint (default: tcp://127.0.0.1:27961)
  • --password PASS - RCON password (required)
  • -v / -vv - Verbose (INFO) or debug (DEBUG) logging
  • --json FILE - Log all events as JSON
  • --unknown-log FILE - Log unparsed events (default: unknown_events.log)

Configuration File (Optional): Create ~/.qlpycon.conf or ./qlpycon.conf:

[connection]
host = tcp://SERVER_IP:PORT
password = your_password

[logging]
level = INFO

Input Features:

  • Smart autocomplete - Type commands and see arguments highlighted in real-time
  • Argument value suggestions - Intelligent suggestions for bot names, maps, gametypes, teams, etc.
  • Tab - Cycle through autocomplete suggestions
  • ↑/↓ - Command history navigation
  • Argument highlighting - Current argument position shown in reverse video
  • Command signatures - Automatic display (e.g., addbot <botname> [skill 1-5] [team])

See AUTOCOMPLETE.md for details.

Architecture

main.py       - Main loop, argument parsing, signal handling
config.py     - Constants (weapons, teams, colors, limits)
state.py      - Game state (ServerInfo, PlayerTracker, EventDeduplicator)
network.py    - ZMQ connections (RCON DEALER, Stats SUB sockets)
parser.py     - JSON event parsing (deaths, medals, switches, stats)
formatter.py  - Message formatting, color codes, team prefixes
ui.py         - Curses interface (3-panel: info, output, input)

Supported Events: PLAYER_SWITCHTEAM, PLAYER_DEATH/KILL, PLAYER_MEDAL, PLAYER_STATS, MATCH_STARTED/REPORT, PLAYER_CONNECT/DISCONNECT, ROUND_OVER

License

WTFPL