Advertisement
Guest User

Untitled

a guest
Apr 27th, 2012
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. '''
  2. Once the script runs, you get 5 seconds to get to the zerg rush game.
  3. Then it starts clicking like mad. thats it.
  4. '''
  5. waitTime = 5 #number of seconds to wait before starting to click
  6. clickCycles = 30000 #number of times to click
  7.  
  8. import win32api, win32con, time
  9.  
  10. #Clicks a location
  11. def click(x,y):
  12.     win32api.SetCursorPos((x,y))
  13.     win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
  14.     win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
  15.  
  16. i = 0
  17. print "starting in "+str(waitTime)+" seconds"
  18. time.sleep(waitTime)
  19.  
  20. #clicks 30000 times... so a couple minutes.            
  21. while(i< clickCycles):
  22.     x,y = win32api.GetCursorPos()
  23.     click(x,y)
  24.     time.sleep(0.01)    #don't want to blow up the computer
  25.     i = i + 1
  26.     print i
  27.    
  28. print "DONE!!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement