This simple script sounds an alarm seconds before the next tick of energy generation.
It is useful in case of scenario such as you can cook/process and lie on the bed before the energy tick occurs. Because the +2 energy rate of the bed only happens when the energy ticks – you don’t have to be on the bed the entire 3 minutes.