我想通过点击特定的键来破坏我的代码,因为用鼠标是不可能的(程序正在使用鼠标)。在
import pyautogui
import time
from mss import mss
start_x = 610
start_y = 600
cords_x = [0, 140, 280, 420]
bbox = (start_x, start_y, start_x + 500, start_y + 1)
def start():
with mss() as sct:
while True:
img = sct.grab(bbox)
for cord in cords_x:
if img.pixel(cord, 0)[0] < 80:
pyautogui.click(start_x + cord, start_y)
time.sleep(5)
start()
你只需要下载键盘模块并像这样导入它
相关问题 更多 >
编程相关推荐