Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

enduity/r-place-script-2022-eesti

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reddit Place Script 2022

Code style: black

About

This is a script to help draw r/Eesti imagery to r/place.

Features

  • Support for multiple accounts
  • Determines the cooldown time remaining for each account
  • Detects existing matching pixels on the r/place map and skips them
  • Automatically converts colors to the r/place color palette
  • Automatically pulls the most recent r/Eesti jpg from a central server

Requirements

How to Get App Client ID and App Secret Key

You need to generate an app client id and app secret key for each account in order to use this script.

Steps:

  1. Visit https://www.reddit.com/prefs/apps
  2. Click "create (another) app" button at very bottom
  3. Select the "script" option and fill in the fields with anything

If you don't want to create a development app for each account, you can add each username as a developer in the developer app settings. You will need to duplicate the client ID and secret in .env, though.

Python Package Requirements

Install requirements from 'requirements.txt' file.

pip3 install -r requirements.txt

Get Started

Create a file called '.env'

Put in the following content:

ENV_PLACE_USERNAME='["developer_username"]'
ENV_PLACE_PASSWORD='["developer_password"]'
ENV_PLACE_APP_CLIENT_ID='["app_client_id"]'
ENV_PLACE_SECRET_KEY='["app_secret_key"]'
  • ENV_PLACE_USERNAME is an array of usernames of developer accounts
  • ENV_PLACE_PASSWORD is an array of the passwords of developer accounts
  • ENV_PLACE_APP_CLIENT_ID is an array of the client ids for the app / script registered with Reddit
  • ENV_PLACE_SECRET_KEY is an array of the secret keys for the app / script registered with Reddit

Run the Script

python3 main.py

Multiple Workers

If you want two threads drawing the image at once you could have a setup like this:

ENV_PLACE_USERNAME='["developer_username_1", "developer_username_2"]'
ENV_PLACE_PASSWORD='["developer_password_1", "developer_password_2"]'
ENV_PLACE_APP_CLIENT_ID='["app_client_id_1", "app_client_id_2"]'
ENV_PLACE_SECRET_KEY='["app_secret_key_1", "app_secret_key_2"]'

The same pattern can be used for multiple drawing at once. Note that the "ENV_PLACE_USERNAME", "ENV_PLACE_PASSWORD", "ENV_PLACE_APP_CLIENT_ID", "ENV_PLACE_SECRET_KEY" variables MUST be string arrays of the same size.

Thread start delay

If you want threads to start at a delay, add another variable (in seconds):

ENV_THREAD_DELAY='15'

 

If you'd like, you can enable Verbose Mode by editing the Python file. This will output a lot more information, and not neccessarily in the right order, but it is useful for development and debugging.

About

Script to draw an image onto r/place (https://www.reddit.com/r/place/)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%