Fantastic to see that you worked it out.
There seems to be something still missing though as there is a difference of almost 10k Alive Power with your numbers compared to what Hive-engine shows on our tribe interface, and I get the same number as they do with my script.
!ALIVE
RE: ALIVE weekly tokenomics