Manual and automatic mode

I found a code on the internet

So many beginners think that finding a code is a good starting point for a project. But as you have found out it is simply a waste of time if you have not yet acquired the skill to read and understand code. You are trying to run before you can crawl. It is like taking a five year old's reading book off them and giving them a copy of "A short history of time" to read instead.