Skip to content

Instantly share code, notes, and snippets.

@fuvvy
Created August 8, 2012 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fuvvy/3297658 to your computer and use it in GitHub Desktop.
Save fuvvy/3297658 to your computer and use it in GitHub Desktop.
48 points in Google Doodles basketball
# This should yield 48 points
# 1) Goto https://www.google.com/doodles/basketball-2012
# 2) Run script
# 3) Alt-Tab back to browser. The script will start the game.
# EDIT: Auto start-game only works from the retry screen
import time
import win32api, win32con
def space_delay(delay=None):
win32api.keybd_event(0x20, 0, 0, 0)
if delay:
time.sleep(delay)
win32api.keybd_event(0x20, 0, win32con.KEYEVENTF_KEYUP, 0)
def wait_for_game():
time.sleep(2)
space_delay(.25)
def shoot(t, prime):
for i in range(t):
space_delay(prime)
time.sleep(.75)
def play():
wait_for_game()
shoot(5, .32)
shoot(4, .48)
shoot(5, .66)
shoot(3, .84)
shoot(2, .98)
play()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment