Code for automatic robot