Skip to content

Add live screen capture, mouse execution, and heuristic shot ranking#23

Open
RiqueAlvess wants to merge 2 commits into
brandonabela:masterfrom
RiqueAlvess:claude/realtime-screen-capture-OgpNe
Open

Add live screen capture, mouse execution, and heuristic shot ranking#23
RiqueAlvess wants to merge 2 commits into
brandonabela:masterfrom
RiqueAlvess:claude/realtime-screen-capture-OgpNe

Conversation

@RiqueAlvess

Copy link
Copy Markdown
  1. video_analysis.py: add analyse_live() using mss to capture the screen frame-by-frame instead of reading an MP4 file.

  2. input_executor.py (new): translates the chosen shot (white-ball and target-hit positions) into a pyautogui click-drag to control the game.

  3. shot_scorer.py (new): heuristic ranker that scores every valid shot by cue-ball travel distance, pocket distance, and cue/target alignment angle, then returns the lowest-cost candidate.

  4. ball_path.py: add find_ranked_path() that enumerates all geometrically valid shots, scores them with ShotScorer, and returns the best path. bot.py: prefer ranked path, fall back to Dijkstra when scorer finds none.

  5. start.py / options.py: new --live flag switches to screen-capture mode; -m/-reg control the capture region; -exec/-delay control shot execution.

  6. requirements.txt: pin mss, pyautogui, opencv-python-headless, numpy.

https://claude.ai/code/session_019wN53sCVTU15P3MRGVMb3d

claude added 2 commits May 17, 2026 06:58
1. video_analysis.py: add analyse_live() using mss to capture the screen
   frame-by-frame instead of reading an MP4 file.

2. input_executor.py (new): translates the chosen shot (white-ball and
   target-hit positions) into a pyautogui click-drag to control the game.

3. shot_scorer.py (new): heuristic ranker that scores every valid shot by
   cue-ball travel distance, pocket distance, and cue/target alignment
   angle, then returns the lowest-cost candidate.

4. ball_path.py: add find_ranked_path() that enumerates all geometrically
   valid shots, scores them with ShotScorer, and returns the best path.
   bot.py: prefer ranked path, fall back to Dijkstra when scorer finds none.

5. start.py / options.py: new --live flag switches to screen-capture mode;
   -m/-reg control the capture region; -exec/-delay control shot execution.

6. requirements.txt: pin mss, pyautogui, opencv-python-headless, numpy.

https://claude.ai/code/session_019wN53sCVTU15P3MRGVMb3d
…ay, fix aiming

- requirements.txt: opencv-python replaces opencv-python-headless so
  cv2.imshow works on Windows (Snapdragon X compatible).

- video_analysis.py analyse_live(): remove all drawing/imshow code.
  The live loop now only does capture → detect holes (once) → detect
  balls → find path → execute shot. No display window needed.

- input_executor.py: redesign shot execution for desktop 8 Ball Pool.
  Step 1: hover mouse to the aim position (AIM_DISTANCE px behind white
  ball, opposite to shot direction) so the game registers the cue angle.
  Step 2: mouseDown → drag further back proportional to shot distance →
  mouseUp to release the shot.

https://claude.ai/code/session_019wN53sCVTU15P3MRGVMb3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants