You're welcome :)
Added 1 minute ago
Here's another question: how can I prevent the AI from buying an army in a Castle and recruiting creatures from dwellings? So that it just stays in the Castle?
EnableHeroAI("heroname", nil), where heroname is the script name of the hero.