First time using this sort of stuff. I play this text-based RPG called Sryth and when you create a character you can continuously roll stats until you're satisfied with what you roll but it is quite tasking when you don't get what you want. So I googled "Sryth Stat Roller" and came across a script for it already but it no longer works.

enter image description here

Basically, what I am trying to do is to get a script to auto click the "REROLL STATS" until it his a specified number of stats. I'd like to be able to search for a stat range for all the stats marked by the yellow dots. The red dots do not matter as much but when rolling for a character they are important but only whenever 25+. The 2 stats marked with red dots can go over 20 while the stats marked with yellow dots are maxed out at 20.

Example of what I'm shooting for in stats.
Might - 20
Agility - 20
Body - 18
Mind - 18
Spirit - 18
Aura - 18
Luck - 19

Now "Avg. Stats" doesn't really matter all that much when looking for specific stats but if I weren't looking for any specific stats then it would matter because I would try as hard as possible to get the Avg. Stats at 19/20.