I honestly believe that Autoit3 is a lot easier to learn and much more readable to start your programming with and don't let the number of extra functions/UDF's overwhelm you.
Programming is much about "trail and error" too. just start with simple things and expand on that.
It will take time but will be easier as you progress.
I tried to write the above snippet with basic logic in mind so study it and make sure you understand it, only then you will progress.
Enjoy,
Jos