|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 KeyError 于 2023-1-12 22:03 编辑
规则是输入点击次数和点击间隔,点击启动后在一秒内移到想要的位置。
在水帖子,效果就不展示了。
圆马:
双层hide,更安心^_^。
[hide=d365]
- import pyautogui as py
- from tkinter import *
- from time import sleep
- root = Tk()
- Label(root, text=" 请 输 入 点 击 的 次 数 : ").grid(row=0, column=0)
- def judg():
- try:
- int(e1.get())
- except:
- return False
- else:
- return True
- def inva():
- e1.delete(0, END)
- e1.insert(0, "0")
- return True
- def judg2():
- try:
- float(e2.get())
- except:
- return False
- else:
- return True
- def inva2():
- e2.delete(0, END)
- e2.insert(0, "0.1")
- return True
- def liandian():
- sleep(1)
- pos = py.position()
- py.click(x=pos.x, y=pos.y, clicks=int(e1.get()), interval=float(e2.get()), button='left')
- e1=Entry(root, validate="focusout", validatecommand=judg, invalidcommand=inva)
- e1.grid(row=0, column=1)
- Label(root, text=" 请 输 入 时 间 间 隔 ( 单 位 为 秒 ) : ").grid(row=1,column=0)
- e2=Entry(root, validate="focusout", validatecommand=judg2, invalidcommand=inva2)
- e2.grid(row=1, column=1)
- Button(root, text=' 启 动 连 点 器 ', command=liandian).grid(row=2, column=0, rowspan=2)
- mainloop()
复制代码
[/hide]
|
|