OSX - Button spam help? I want to be able to spam the jump button without having to hit the space bar multiple times, and I have a line of code but I'm not too sure what it is doing. 

tell application "System Events" 
    key down "space" 
    delay 10 
    key up "space" 
end tell 


I'm new to coding so it is kind of confusing, I want to be able to be in game, hold space bar, make it spam space, when I let go, it stops. (Without having to tab out)
It looks like there's an app that does what you want. Keyboard Maestro allows you to set one key to repeat, a configurable delay and a second key to configure to stop the automation.


http://leancrew.com/all-this/2016/03/dont-forget-simple-automation/ 


The link above is how to configure the app for paging through a 2,000 page long PDF and stop when a key is pressed, but you could easily adopt that workflow for your game I think.