What would be a proper solution for automated decision making in a PHP script, like a game? That is, without an external application, or any human input. For example, any random event that happens when the player is away from the game. How would one go about implementing that?