Before running the script, go to https://www.reddit.com/prefs/apps/ to create an app.
Fill in the client_id, client_secret, password and username. All the information is stored locally in the script.
The script works better with CronTab on UNIX/Linux based systems
Crontab Example: */3 * * * * /path/to/the/script >> /path/to/logfile #Will run the script every 3 minutes.