Advertisement
Peaser

Mouse fidget - windows

Jul 2nd, 2014
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1. import win32gui, win32api, win32con, random
  2. from time import sleep as s
  3. from os import system as cmd
  4.  
  5. window = win32gui.GetForegroundWindow()
  6.  
  7. def minimize():
  8.     win32gui.ShowWindow(window, win32con.SW_MINIMIZE)
  9. def restore():
  10.     win32gui.ShowWindow(window, win32con.SW_RESTORE)
  11.  
  12. methods=[-1,0,1]
  13.  
  14. def move(x,y):
  15.     win32api.SetCursorPos((x,y))
  16.  
  17. def clickme(amount=100,time=0.02,multiple=1):
  18.     for i in range(amount):
  19.         value1,value2 = random.choice(methods),random.choice(methods)
  20.         move(win32gui.GetCursorPos()[0]+value1*multiple,win32gui.GetCursorPos()[1]+value2*multiple)
  21.         s(time)
  22.  
  23. def start(timew8=1):
  24.     print "Mouse fidget version 1\n\n"
  25.     amounts = raw_input("\n\nPlease enter desired: amount/time/multiple with a comma LIKE THIS:\n\n\t\t100,0.02,1\n\n(These are defaults leave blank for these.)\n\n")
  26.     if amounts != "":
  27.         amt = amounts.split(',')
  28.         a5 = int(amt[0])
  29.         if '.' in amt[1]:
  30.             a6 = float(amt[1])
  31.         else:
  32.             a6 = int(amt[1]) #allowing floats and ints
  33.         a7 = int(amt[2])
  34.     else:
  35.         a5 = 100
  36.         a6 = 0.02
  37.         a7 = 1
  38.     print("\nWill now fuck with your mouse.\n")
  39.     cmd("pause")
  40.     minimize()
  41.  
  42.     clickme(a5,a6,a7)
  43.  
  44.     restore()
  45.     print "\n\nOperation complete.\n"
  46.     cmd("pause")
  47.     cmd("cls")
  48.     start()
  49. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement