import time import random from pynput import keyboard, mouse from start import get_start import threading import pyautogui from collect import collect, get_all_target pyautogui.FAILSAFE = True pyautogui.PAUSE = 0.02 SOURCE = (490, 400) def rep(): for x, y in get_all_target(): # 鼠标移动到SOURCE pyautogui.moveTo(SOURCE[0], SOURCE[1], random.random() / 5) time.sleep(random.random() / 30) # 右键 pyautogui.rightClick() time.sleep(random.random() / 30) # 放到 x, y pyautogui.moveTo(x, y, random.random() / 5) time.sleep(random.random() / 30) # 左键 pyautogui.leftClick() while True: if get_start() == False: continue rep() collect() collect()