Sorry, that was a bad example; I'd been trying many different specfuncts on mobs of all different levels and hadn't seen any results at all.
This morning I got spec_cast_mage to sort of
work: I made a mage and another mob for it to fight and gave them both an extremely good AC and an extremely bad thac0 to make the fight last as long as possible. Under those conditions, my 100th level mage did
cast some spells -- three of them, in 144 rounds of combat. (I got tired of counting after that.)
Is that the way spec_cast_mage is supposed to work? Cast one spell every 50 rounds or so? I statted the mage after each casting and it had plenty of mana, so it's not like it was waiting to recharge or anything.