I’m trying to create a log of a players actions as they play a game of Spelunky. The easiest I’ve found to do this is to log what keys are pressed at each frame. What I don’t know how to do is how to integrate this with the Game Maker source code of Spelunky.

Is there a specific way to create a script that is checked every frame/tick (don’t know the right term) and a command to find what buttons are pressed?