Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import time
- import pyatspi
- VK_CODE = { "spacebar" : 65 }
- def press(x,t):
- pyatspi.Registry.generateKeyboardEvent( VK_CODE[ x ], None, pyatspi.KEY_PRESS )
- time.sleep( t )
- pyatspi.Registry.generateKeyboardEvent( VK_CODE[ x ], None, pyatspi.KEY_RELEASE )
- def play():
- time.sleep( 1 )
- s = time.time()
- while time.time() - s < 25:
- if time.time() - s <= 4.7:
- press( "spacebar", .27 ) # free throw
- elif time.time() - s <= 11:
- press( "spacebar", .48 ) # top of key
- elif time.time() - s <= 16.7:
- press( "spacebar", .75 ) # 3 pointer
- elif time.time() - s <= 18:
- press( "spacebar", 1 ) # moving 3 pointer
- elif time.time() - s <= 22:
- press( "spacebar", 1.6 ) # long 3 pointer
- else:
- press( "spacebar", 1.75 ) # swish
- play()
Add Comment
Please, Sign In to add comment