Writing custom AI scripts for AoE1 was possibly the first type of "game development" I ever did. It was fun trying to squeeze out the personality of a specific opponent/theme. Great system that was extended for AoE2 I believe.
The computer AI in Age of Empires II was in two parts. The more difficult part was how the units marched, gathered resources, assembled into formations, and so forth. This was entirely done by the coders, bless their hearts.
But there was also a simpler scrip which determined which buildings, units, and upgrades an enemy chose. Mario Grimani created the scripting program and I wrote all the scripts.
The scripts were ENTIRELY "If Then" statements. Like, "If Food > 500 Research Feudal Age" or "If Feudal Age Researched Build Barracks". Stuff like that. I originally only had 1000 If-Then statements allowed, but kept pushing it as my scripts got more involved, until eventually it was around 3500 statements or more.
I could even write in cheating parts, like "If (Food < 1000 AND Imperial not Researched) Gift Self 1000 Food) I only did this for the most difficult AIs. You may say, "Why did you make it cheat, Sandy?" All I can say is, "YOU try to create a strategic AI with if-thens and see when you crack."
I am sure every line of it has been replaced by new code by now. I also wrote the excuses that the computer gives when it loses a game.