Improved AI support

Now you can automate AI's!
Check the example AI to see what you need.