Add auto-advance: click Next, scroll to top, capture next page
After each capture the controller asks the vision model to locate a 'Next' control (returned as normalized screen coordinates), clicks it via OS input, scrolls to top, and continues the loop. Configurable via SCREEN_LEADS_AUTO_NEXT / _NEXT_LOAD_PAUSE / _MAX_AUTO_NEXT, with a per-run safety cap. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -40,3 +40,18 @@ def scroll_down(amount: int = SCROLL_AMOUNT) -> None:
|
||||
pg = _pyautogui()
|
||||
pg.scroll(-abs(amount))
|
||||
time.sleep(SCROLL_PAUSE)
|
||||
|
||||
|
||||
def click_at_fraction(x_frac: float, y_frac: float) -> None:
|
||||
"""Click at a position given as fractions (0..1) of the logical screen.
|
||||
|
||||
Fractions are resolution- and Retina-independent: pyautogui reports the
|
||||
logical screen size, and the capture covers the same primary display, so a
|
||||
fraction of the screenshot maps directly to a fraction of the screen.
|
||||
"""
|
||||
pg = _pyautogui()
|
||||
w, h = pg.size()
|
||||
x = int(max(0.0, min(1.0, x_frac)) * w)
|
||||
y = int(max(0.0, min(1.0, y_frac)) * h)
|
||||
pg.moveTo(x, y, duration=0.2)
|
||||
pg.click()
|
||||
|
||||
Reference in New Issue
Block a user