Energy question

I found jaggil posted a function to reset energy here