I want to make a robot advanced enough to overthrow the current government and eventually take over the world, but still not be smart enough to turn against me.

I learn some BASIC robot programming in school last year, but it was only boring things like move foward and stay still; and we ran out of time to learn what I wanted.

Can anyone help?