EnableHeroAI(heroName,false)
heroName is internal name of the hero controlled by computer
Second argument takes values true (enable) or false (disable).
Function returns console error as if there was no value of “false” variable. Of course it makes no sense in terms of logic and should be ignored, function does work as desired nontheless.
This function disables and enables AI for the specified computer-controlled hero and returns error when invoked for human player. Disabled heroes not only don’t take any actions, but even do not rearrange their armies and artifacts.
This is very useful for singleplayer maps, as makes the AI pass its turn fast, also allows to exactly adjust enemy tactics with no risk of merging stacks or switching artifacts. Not to mention placing static hero as a border guard is an interesting option.
The behaviour of hero can still be controlled by script commands such as MoveHero() or MoveHeroRealTime().