Game Bot for Chrome Dino

Automated game bot for the Chrome Dino game using Pillow + PyAutoGUI

Posted by CM-WebDev on November 11, 2025

Project Overview

I built a Python automation bot that plays the Chrome Dinosaur game by monitoring a thin ground strip ahead of the dino and triggering jumps when obstacles darken that region. The focus was professional execution: predictable behavior on multi-monitor setups, minimal dependencies, and a lean codebase that’s easy to read in a hiring context.

Core Technologies

  • Python 3
  • Pillow (PIL) — fast screen capture & pixel brightness
  • PyAutoGUI — reliable keypress automation
  • pynput — global hotkeys (F8/F9/Esc) for a frictionless UX

Technical Execution & Problem Solving

  • Deterministic ROI: The bot samples a small, fixed detection band on the ground line (not the dino body) to catch both short and tall cacti.
  • Signal over noise: Uses an EMA baseline (SMOOTH) and a brightness delta threshold (DELTA) to avoid false jumps from flicker.
  • Multi-monitor safety: Global hotkeys eliminate console focus issues; F8 captures ROI at the mouse, F9 starts/stops, Esc quits.
  • Human-centred UX: Clear console feedback (ROI coords, start/stop) and a small cooldown to prevent double jumps.

Key Features / Highlights

  • Ultra-lite codebase (~50 lines) with purposeful comments and constants.
  • Real-time tuning via FPS, SMOOTH, DELTA, COOLDOWN, W,H.
  • Works consistently across window positions and displays.

Demonstrated Skill Set

  • Practical automation & OS-level integration (input hooks, screen capture).
  • Applied signal processing (thresholding + EMA) for robust detection.
  • Developer ergonomics: hotkeys, safe shutdown, minimal dependencies.
  • Clean code practices: constants, small functions, readable structure.

What I’d Improve Next

  • Auto-calibration: detect the ground line/dino position to remove manual ROI.
  • Optional overlay: draw a transient rectangle over the ROI for visual confirmation.
  • CI note: add a short demo GIF and a concise README checklist for reviewers.