Hi. I am trying to make a script to manually calculate the APM (Actions per Minute) of a player and store in a variable.
It's pretty simple to find the average APM of a player. I created a variable "Actions" as an integer with default value 0. Each time a unit is selected or a command is issued to a unit, I increase this variable by 1. The APM can then be calculated as "Actions / Mission Time * 60", in other words the number of actions divided by number of seconds that passed, multiplied by 60 (since there are 60 seconds in a minute)
In the observer / replay interface, each player has 2 types of APM - average APM and current APM.
I want to find the "current" APM of a player, but I actually have no idea how the game calculates it. So does anyone know how to calculate the "current" APM of a player?