How to compare a value and execute a key
Hello, I would like some help with knowing how to compare a value in a game, for example, health. I already have the offset for the health. I want to read this value, and say if it is below 20% of the max value, I would like it to use a health potion, or if it were simpler, just press the key that the health potion is assigned to. I was thinking this should be done with something like AHK, but I don't know how I could read a value and then execute the AHK script. Thanks for your help! 

