Read the product documentation. If you expect us to write a complete tutorial for AHK, sorry.
Oh wait, you just want to tap keys.. fine.
I'll just give you the necessary functions. Read those up.
first WinActivate. activate the game window.
next SendInput. that sends the keys. If it doesnt work use Send.
next Sleep. that pauses in between keystrokes.
Put the above inside a Loop for the no. of keypresses to simulate. And put the loop inside a function. Next use Hotkey to assign the function to some hotkey. eg: press space repetitively for 30 times when you press F1 or something.
I'm making sure im not spoonfeeding. Read those up and do it yourself. If your code doesnt work, post it here.