Created
August 8, 2012 15:14
-
-
Save 74togo/3295804 to your computer and use it in GitHub Desktop.
It beats the basketball Google doodle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import win32api, win32con | |
t=0.5 | |
def play(): | |
time.sleep(1) | |
s = time.time() | |
throws=0 | |
while throws < 10: | |
win32api.keybd_event(0x20, 0,0) | |
time.sleep(t-0.25) | |
win32api.keybd_event(0x20,0 ,win32con.KEYEVENTF_KEYUP ,0) | |
throws += 2 | |
time.sleep(0.77) | |
while throws < 18: | |
win32api.keybd_event(0x20, 0,0) | |
time.sleep(t-0.05) | |
win32api.keybd_event(0x20,0 ,win32con.KEYEVENTF_KEYUP ,0) | |
throws += 2 | |
time.sleep(0.77) | |
while throws < 30: | |
win32api.keybd_event(0x20, 0,0) | |
time.sleep(t+0.13) | |
win32api.keybd_event(0x20,0 ,win32con.KEYEVENTF_KEYUP ,0) | |
throws += 3 | |
time.sleep(0.77) | |
while throws < 41: | |
win32api.keybd_event(0x20, 0,0) | |
time.sleep(t+0.3) | |
win32api.keybd_event(0x20,0 ,win32con.KEYEVENTF_KEYUP ,0) | |
throws += 3 | |
time.sleep(0.77) | |
while time.time() - s < 30: | |
win32api.keybd_event(0x20, 0,0) | |
time.sleep(t+0.43) | |
win32api.keybd_event(0x20,0 ,win32con.KEYEVENTF_KEYUP ,0) | |
throws += 2 | |
time.sleep(0.77) | |
play() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment