first commit

This commit is contained in:
2026-02-26 03:40:19 +01:00
commit 2885768c45
4 changed files with 84 additions and 0 deletions

25
detector.py Normal file
View File

@@ -0,0 +1,25 @@
import pyautogui
import keyboard
import time
print("Listo. Pulsa 'P' para imprimir posición y color. Ctrl+C para salir.")
def obtener_pixel_mouse():
# Posición actual del ratón
x, y = pyautogui.position()
# Captura solo 1x1 px (eficiente)
img = pyautogui.screenshot(region=(x, y, 1, 1))
color = img.getpixel((0, 0))
print(f"Posición: ({x}, {y}) | Color RGB: {color}")
while True:
if keyboard.is_pressed("p"):
obtener_pixel_mouse()
# Anti-rebote para no spamear mientras mantienes la tecla
time.sleep(0.3)
time.sleep(0.05)