Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import threading
- from tkinter import *
- import pyautogui
- import random
- import keyboard
- root = Tk()
- root.title("AutoAvailable 1.5")
- root.geometry("360x160")
- root.resizable(True, True)
- screen_width, screen_height = pyautogui.size()
- radio_var = StringVar()
- time.sleep(0.5)
- stop = False
- def on_radio_select():
- selected_optionm = radio_var.get()
- def button_stop_command():
- global stop
- stop = True
- def button_start_command():
- global stop
- stop = False
- time.sleep(2)
- pyautogui.hotkey('win', 'd')
- while True and not stop:
- MouseX = random.randint(0, screen_width)
- MouseY = random.randint(0, screen_height)
- if radio_var.get() == "Slow":
- MouseMovement = random.randint(1, 2)
- MouseSleep = random.randint(20, 30)
- elif radio_var.get() == "Medium":
- MouseMovement = random.randint(1, 2)
- MouseSleep = random.randint(10, 20)
- elif radio_var.get() == "Fast":
- MouseMovement = random.randint(1, 2)
- MouseSleep = random.randint(1, 5)
- pyautogui.moveTo(MouseX, MouseY, duration=MouseMovement)
- pyautogui.click()
- time.sleep(MouseSleep)
- def button_starter():
- t = threading.Thread(target=button_start_command)
- t.start()
- label = Label(root, text="AutoAvailable Utility", font=("Helvetica", 12, "bold"))
- label.pack(anchor='w', pady=5, padx=5)
- label = Label(root, text="Random mouse movements & clicks", font=("Helvetica", 8))
- label.pack(anchor='w', padx=5)
- label = Label(root, text="All windows will be minimised on Start", font=("Helvetica", 8))
- label.pack(anchor='w', padx=5)
- button_start = Button(root, text="START", command=button_starter, width = 15)
- button_start.pack(side="left", padx=10)
- button_stop = Button(root, text="STOP", command=button_stop_command, width = 15)
- button_stop.pack(side="left", padx=10)
- radio_button1 = Radiobutton(root, text="Fast", variable=radio_var, value="Fast", command=on_radio_select)
- radio_button2 = Radiobutton(root, text="Medium", variable=radio_var, value="Medium", command=on_radio_select)
- radio_button3 = Radiobutton(root, text="Slow", variable=radio_var, value="Slow", command=on_radio_select)
- # Pack the radio buttons
- radio_button1.pack(anchor='w', padx=10)
- radio_button2.pack(anchor='w', padx=10)
- radio_button3.pack(anchor='w', padx=10)
- # Set a default value
- radio_var.set("Medium")
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement