Learn how to program. Learn several different programming languages. Learn C, assembly, Visual-Basic etc. Don’t get stuck thinking you can do everything with one language, no matter how good it is. In fact the less capable the language the better. It forces you to think outside the box. One thing is certain in automation these days, you will be dealing with many different systems, running different types of programming languages, and making them all work and communicate seamlessly together. Learn the structure and logic of programming. Obtain one of the microcontroller based experimental systems that has I/O and learn how to interface and control real world objects. While industrial systems are different, the logic and understanding you’ll gain will go a long way.
Learn different base numbering systems. Binary, octal, hexadecimal, and how to quickly convert between them. Using a calculator and using whatever programming language you’re dealing with.
Somehow you will need to learn ladder logic programming. While there are many supplemental programming systems for PLCs these days, it’s still the core programming language for virtually every PLC in existence. You must know ladder logic programming well.
Learn about computer networking. Actually set up and run some simple computer networks. Everything is networked these days and you must know how to do it.
You will need to learn some basic electrical theory. Most automation and robotics will be done with off the shelf pre-engineered devices so there will be very little, if any, design using discreet components. But you must understand what’s going on behind the scenes and how to apply it all.
What is the end result you are after? What do you hope to accomplish? Robotics and automation are just another tool in your toolbox. Make sure you have plenty of other tools too. Remember, if all you have is a hammer, everything looks like a nail. The fact that you’re coming from a mechanical background first puts you light-years ahead of most other automation experts!