How to do a while true loop to look with an if

I need help figuring out how to put a while true loop with a if 25 mana code at the end. then after that I need help getting the if to place a different tower each time.

    if(hero.mana >=25){
       //run through a sequence of isolating the individual levels of towers and then comparing them.