源码
import time from ctypes import * import win32api import win32con import PySimpleGUI as sg def main(x,y): user32 = windll.user32 while True: user32.SetCursorPos(x,y) time.sleep(3) print("开始执行点击操作") win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) time.sleep(0.1) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) print("已经执行点击操作") time.sleep(15) for i in range(610): win32api.keybd_event(88, 0, 0, 0) time.sleep(0.2) win32api.keybd_event(88, 0, win32con.KEYEVENTF_KEYUP, 0) time.sleep(0.1) class PointAPI(Structure): _fields_ = [("x", c_ulong), ("y", c_ulong)] def getpos(): po = PointAPI() windll.user32.GetCursorPos(byref(po)) return int(po.x), int(po.y) if __name__ == '__main__': layout = [ [sg.Text("点开始后两秒内把鼠标移动到 开始匹配 上结束直接点×就行")], [sg.Button('开始')]] window = sg.Window('小修罗天-迷你大乱斗', layout) event, values = window.read() if event in ('开始'): time.sleep(2) x,y=getpos() time.sleep(2) main(x,y) else: window.close() 辅助文件(exe)链接: https://pan.baidu.com/s/18b2tNXeRHzNlBrBZzD3Xow?pwd=svsw 提取码:svsw