Advertisement
182days

AutoAvailable 1.5 (GUI)

Dec 7th, 2023
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.34 KB | None | 0 0
  1. import time
  2. import threading
  3. from tkinter import *
  4. import pyautogui
  5. import random
  6. import keyboard
  7.  
  8. root = Tk()
  9. root.title("AutoAvailable 1.5")
  10. root.geometry("360x160")
  11. root.resizable(True, True)
  12. screen_width, screen_height = pyautogui.size()
  13. radio_var = StringVar()
  14. time.sleep(0.5)
  15. stop = False
  16.  
  17. def on_radio_select():
  18.   selected_optionm = radio_var.get()
  19.  
  20. def button_stop_command():
  21.   global stop
  22.   stop = True
  23.  
  24. def button_start_command():
  25.   global stop
  26.   stop = False
  27.   time.sleep(2)
  28.   pyautogui.hotkey('win', 'd')
  29.   while True and not stop:
  30.     MouseX = random.randint(0, screen_width)
  31.     MouseY = random.randint(0, screen_height)
  32.     if radio_var.get() == "Slow":
  33.       MouseMovement = random.randint(1, 2)
  34.       MouseSleep = random.randint(20, 30)
  35.     elif radio_var.get() == "Medium":
  36.       MouseMovement = random.randint(1, 2)
  37.       MouseSleep = random.randint(10, 20)
  38.     elif radio_var.get() == "Fast":
  39.       MouseMovement = random.randint(1, 2)
  40.       MouseSleep = random.randint(1, 5)
  41.     pyautogui.moveTo(MouseX, MouseY, duration=MouseMovement)
  42.     pyautogui.click()
  43.     time.sleep(MouseSleep)
  44.    
  45. def button_starter():
  46.   t = threading.Thread(target=button_start_command)
  47.   t.start()
  48.  
  49. label = Label(root, text="AutoAvailable Utility", font=("Helvetica", 12, "bold"))
  50. label.pack(anchor='w', pady=5, padx=5)
  51. label = Label(root, text="Random mouse movements & clicks", font=("Helvetica", 8))
  52. label.pack(anchor='w', padx=5)
  53. label = Label(root, text="All windows will be minimised on Start", font=("Helvetica", 8))
  54. label.pack(anchor='w', padx=5)
  55.  
  56. button_start = Button(root, text="START", command=button_starter, width = 15)
  57. button_start.pack(side="left", padx=10)
  58.  
  59. button_stop = Button(root, text="STOP", command=button_stop_command, width = 15)
  60. button_stop.pack(side="left", padx=10)
  61.  
  62. radio_button1 = Radiobutton(root, text="Fast", variable=radio_var, value="Fast", command=on_radio_select)
  63. radio_button2 = Radiobutton(root, text="Medium", variable=radio_var, value="Medium", command=on_radio_select)
  64. radio_button3 = Radiobutton(root, text="Slow", variable=radio_var, value="Slow", command=on_radio_select)
  65.  
  66. # Pack the radio buttons
  67. radio_button1.pack(anchor='w', padx=10)
  68. radio_button2.pack(anchor='w', padx=10)
  69. radio_button3.pack(anchor='w', padx=10)
  70.  
  71. # Set a default value
  72. radio_var.set("Medium")
  73.  
  74. root.mainloop()
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement