2023-12-06 00:09:16 +01:00

27 lines
730 B
Python

import pyautogui
import keyboard
from time import sleep
#needs opencv-python, keyboard, pyautogui (installed by pip)
delete = "d"
skip = "s"
while True:
if keyboard.read_key() == delete:
x, y = pyautogui.position()
# locatel and press 3 dots
x1, y2 = pyautogui.locateCenterOnScreen("dots.png")
pyautogui.moveTo(x1, y2)
pyautogui.click()
# locate and press bin
sleep(0.15)
x2, y2 = pyautogui.locateCenterOnScreen("bin.png", confidence=0.8)
pyautogui.moveTo(x2, y2)
pyautogui.click()
# move back
pyautogui.moveTo(x, y)
if keyboard.read_key() == skip:
x, y = pyautogui.position()
pyautogui.moveTo(x, y + 100)