Here is an efficient way you can use to make energy generator:
You will need a Trigger and an Item Granter.
Trigger set on “trigger when receive on [x channel]” and “trigger on [x channel] when triggered” with a delay of 1.0 seconds (you can adjust the value to your preferred amount)
For the Item Granter, make it grant a certain amount of energy when receiving on [x channel], for example, 500 energy.
To make the Trigger start looping, wire a button/vending machine (or whatever the device you will use to start the energy generator) to it, and it will constantly send [x channel] with the interval of 1.0 seconds.
If you want to make the consumption of energy bar more realistic, use a Game Overlay (button) wire to Trigger:
Game Overlay (pressed) → Trigger (trigger)
Don’t forget to make Overlay hidden after being pressed using channels.
Additional guide in case you don’t know how to make an energy draining system:
Feel free to ask if you got any more questions.