Hooray, the Bot works, but the script is ugly as fuck.
I tested it on the first level (enemies were disabled) and it found the fastest strat in 35 attempts, which took 5 minutes.
The bot still doesn't find the fastest with enemies enabled.
I still want to have a window where I can type the needed color and the fastest attempt of a level, without changing the script everytime.