Accuracy calculation that works for all heroes?

Right now I am tracking ‘is firing primary’ and ‘even damage’ and adding 1 to a variable each time. Then I divide shots hit by shots fired and put that in one variable. Then I multiply that variable. That works just fine for widowmaker, mccree, etc, but it can go past 100%? I am not sure how.

If you hold down left click it only counts you as firing once but you keep shooting. You would need to loop as long as firing primary = true with a wait time equal to the fire rate.

so I need rules for almost every hero? damn…