Browse Source

Add files via upload

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

38
main.py

@ -1,5 +1,5 @@
import pynput,sys,random,time,pyautogui import pynput,sys,random,time,pyautogui
from pynput import mouse,keyboard ### keyboard Listener ###Number of clicks (0 - infinite) from pynput import mouse,keyboard ### Take current mouse mos and put it in the entries, entries.bind()
import tkinter as tk import tkinter as tk
def main(): def main():
@ -14,9 +14,9 @@ def main():
global window global window
window = tk.Tk() window = tk.Tk()
window.title('Clicker') window.title('Clicker')
window.geometry(("700x300")) window.geometry(("300x200"))
window.minsize(700,320) window.minsize(500,200)
window.maxsize(700,320) window.maxsize(500,200)
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()
# #
@ -26,42 +26,42 @@ def main():
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)
mouse_pos_label.place(x = 400,y = 300, width = 100, height = 20) mouse_pos_label.place(x = 380,y = 180, width = 100, height = 20)
# #
global time_btwn_clcks global time_btwn_clcks
time_btwn_clcks = tk.Scale(window, orient = "horizontal", resolution = -1,length = 10000, time_btwn_clcks = tk.Scale(window, orient = "horizontal", resolution = -1,length = 9999999,
from_ = 0.05, to = 500 ,bg = BACK_CLR, font = 20, from_ = 0.005, to = 500 ,bg = BACK_CLR, font = 20,
label = "Click interval (seconds)") label = "Click interval (seconds)")
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",bg = BACK_CLR, font = 20, command = start) #, command = switch_to_stop start_bttn = tk.Button(window,text = "Start",bg = BACK_CLR, font = 20, command = start) #, command = switch_to_stop
start_bttn.place(x = 5, y = 268, width = 100, height = 50) start_bttn.place(x = 5, y = 147, width = 135, height = 50)
global stop_bttn # global stop_bttn
stop_bttn = tk.Button(window, text = "Stop" , bg = BACK_CLR, font = 20, state = "disabled", command = stop) #, command = switch_to_start # stop_bttn = tk.Button(window, text = "Stop" , bg = BACK_CLR, font = 20, state = "disabled", command = stop) #, command = switch_to_start
stop_bttn.place(x = 110, y = 268, width = 100, height = 50) # 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 = 220,y =5, width = 160, height = 30)
global location_x global location_x
location_x_label = tk.Label(window, text = "X",bg = BACK_CLR) location_x_label = tk.Label(window, text = "X",bg = BACK_CLR)
location_x_label.place(x = 380, y = 40,height = 18) location_x_label.place(x = 230, y = 40,height = 18)
location_x = tk.Entry(window,justify = "right") location_x = tk.Entry(window,justify = "right")
location_x.insert(0,0) location_x.insert(0,0)
location_x.place(x = 395,y = 40, width = 50) location_x.place(x = 250,y = 40, width = 50)
global location_y global location_y
location_y_label = tk.Label(window, text = "Y",bg = BACK_CLR) location_y_label = tk.Label(window, text = "Y",bg = BACK_CLR)
location_y_label.place(x = 450, y = 40,height = 18) location_y_label.place(x = 305, y = 40,height = 18)
location_y = tk.Entry(window, justify = "right") location_y = tk.Entry(window, justify = "right")
location_y.insert(0,0) location_y.insert(0,0)
location_y.place(x = 465,y = 40, width = 50) location_y.place(x = 320,y = 40, width = 50)
entry_cleaner = tk.Button(window,text = "Clear",font = 14, command = clean_entries) entry_cleaner = tk.Button(window,text = "Clear",font = 14, command = clean_entries)
entry_cleaner.place(x = 520, y = 40 , width = 100, height = 20) entry_cleaner.place(x = 380, y = 40 , width = 100, height = 20)
# #
#pretender = tk.Checkbutton(window,text = "Pretend to be online",bg = BACK_CLR) #pretender = tk.Checkbutton(window,text = "Pretend to be online",bg = BACK_CLR)
#pretender.place(x = 350, y = 5) #pretender.place(x = 350, y = 5)
@ -85,13 +85,13 @@ def main():
def stop(): def stop():
print("Stopped \n") print("Stopped \n")
start_bttn["state"] = "normal" start_bttn["state"] = "normal"
stop_bttn["state"] = "disabled" #stop_bttn["state"] = "disabled"
pass pass
def start(): def start():
print("Started") print("Started")
start_bttn["state"] = "disabled" start_bttn["state"] = "disabled"
stop_bttn["state"] = "normal" #stop_bttn["state"] = "normal"
time_btwn_clcks_value = float(time_btwn_clcks.get()) time_btwn_clcks_value = float(time_btwn_clcks.get())
try: try:

Loading…
Cancel
Save