[Python]快捷键打开式连点器(带窗口)
import threadingimport pynput.keyboard
import pyautogui as auto
import tkinter
bo = 0
def gett():
inter = e1.get()
try:
if inter == "":
return ""
else:
inter = float(inter)
return inter
except:
pass
def win():
global win, e1
win = tkinter.Tk()
win.geometry('350x50')
win.title("连点器")
e1 = tkinter.Entry(win)
inter = e1.get()
print(inter)
e1.pack()
win.mainloop()
def click_():
while True:
if bo == 1:
inte = gett()
if inte == "":
auto.click(interval=0.01)
else:
auto.click(interval=inte)
print(inte)
elif bo == 0:
pass
def on_press(key):
global bo
try:
if key.char == 'f':
if bo == 1:
bo = 0
win.title("STOP")
elif bo == 0:
bo = 1;
win.title("START")
except AttributeError:
pass
def on_release(key):
pass
t1 = threading.Thread(target=click_)
t2 = pynput.keyboard.Listener(on_release=on_release, on_press=on_press)
t3 = threading.Thread(target=win)
threads =
for t in threads:
t.start()
for t in threads:
t.join()
====================================
话说更改interval与MC cps的关系好奇怪
页:
[1]