Browse Source

Add files via upload

master
Unbewohnte 4 years ago committed by GitHub
parent
commit
874fc23330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 60
      main.py

60
main.py

@ -1,5 +1,5 @@
import pynput,sys,random,time,pyautogui import pynput,sys,random,time,pyautogui
from pynput import mouse,keyboard from pynput import mouse,keyboard ### keyboard Listener ###Number of clicks (0 - infinite)
import tkinter as tk import tkinter as tk
def main(): def main():
@ -25,6 +25,9 @@ def main():
canvas = tk.Canvas(window,width = 700,height = 320, bg = BACK_CLR) canvas = tk.Canvas(window,width = 700,height = 320, bg = BACK_CLR)
canvas.pack() canvas.pack()
# #
#listener = keyboard.Listener(on_press= switch_to_start)
#listener.start()
#
global mouse_pos_label global mouse_pos_label
mouse_pos_label = tk.Label(window,text = mouse_c.position,font = 24,bg = BACK_CLR) mouse_pos_label = tk.Label(window,text = mouse_c.position,font = 24,bg = BACK_CLR)
mouse_pos_label.after(100,update_mouse_pos) mouse_pos_label.after(100,update_mouse_pos)
@ -37,8 +40,12 @@ def main():
time_btwn_clcks.place(x = 5,y = 0,width = 200) time_btwn_clcks.place(x = 5,y = 0,width = 200)
# #
global start_bttn global start_bttn
start_bttn = tk.Button(window,text = "Start", command = switch_to_stop,bg = BACK_CLR, font = 20) start_bttn = tk.Button(window,text = "Start",bg = BACK_CLR, font = 20) #, command = switch_to_stop
start_bttn.place(x = 0, y = 270, width = 60, height = 50) start_bttn.place(x = 5, y = 268, width = 100, height = 50)
global stop_bttn
stop_bttn = tk.Button(window, text = "Stop" , bg = BACK_CLR, font = 20, state = "disabled") #, command = switch_to_start
stop_bttn.place(x = 110, y = 268, width = 100, height = 50)
# #
location_choose = tk.Label(window, text = "Mouse location", font = 20, bg = BACK_CLR) location_choose = tk.Label(window, text = "Mouse location", font = 20, bg = BACK_CLR)
location_choose.place(x = 360,y =5, width = 160, height = 30) location_choose.place(x = 360,y =5, width = 160, height = 30)
@ -68,31 +75,32 @@ def main():
mouse_pos_label.after(100,update_mouse_pos) mouse_pos_label.after(100,update_mouse_pos)
pass pass
def switch_to_stop(): # def switch_to_stop():
STARTED = True # STARTED = True
# #
# start_bttn.destroy()
# global stop_bttn
# stop_bttn = tk.Button(window,text = "Stop", command = switch_to_start, bg = BACK_CLR, font = 20)
# stop_bttn.place(x = 0, y = 270, width = 60, height = 50)
# #
# time_btwn_clcks_value = float(time_btwn_clcks.get())
# if location_x == '' and location_y == '':
# location_x_value = float(location_x.get())
# location_y_value = float(location_y.get())
# else:
# print("No values for mouse mos")
# #
start_bttn.destroy() # print("Starded : ",STARTED)
global stop_bttn # print("Got value from time_btwn_clcks : {} \n".format(time_btwn_clcks_value))
stop_bttn = tk.Button(window,text = "Stop", command = switch_to_start, bg = BACK_CLR, font = 20) # pass
stop_bttn.place(x = 0, y = 270, width = 60, height = 50)
# #
time_btwn_clcks_value = float(time_btwn_clcks.get()) # def switch_to_start():
if location_x == '' and location_y == '': # STARTED = False
location_x_value = float(location_x.get()) # stop_bttn.destroy()
location_y_value = float(location_y.get()) # start_bttn = tk.Button(window,text = "Start", command = switch_to_stop,bg = BACK_CLR, font = 20)
else: # start_bttn.place(x = 0, y = 270, width = 60, height = 50)
print("No values for mouse mos") # print("Starded : ",STARTED)
print("Starded : ",STARTED) # pass
print("Got value from time_btwn_clcks : {} \n".format(time_btwn_clcks_value))
pass
def switch_to_start():
STARTED = False
stop_bttn.destroy()
start_bttn = tk.Button(window,text = "Start", command = switch_to_stop,bg = BACK_CLR, font = 20)
start_bttn.place(x = 0, y = 270, width = 60, height = 50)
print("Starded : ",STARTED)
pass
### ###

Loading…
Cancel
Save