Giter Site home page Giter Site logo

superdelphi / reddit-place-script-2022 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexander01998/reddit-place-script-2022

0.0 0.0 0.0 125 KB

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

Python 98.61% Shell 1.39%

reddit-place-script-2022's Introduction

Bitcoin r/place bot

About

This is a script to draw Bitcoin's logo into r/place (https://www.reddit.com/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

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

.env is already pre-made with the right coordinates. Just add your accounts as follows:

  • 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
  • ENV_R_START is an array which specifies which x position of the original image to start at while drawing it
  • ENV_C_START is an array which specifies which y position of the original image to start at while drawing it

Note: Multiple fields can be passed into the arrays to spawn a thread for each one.

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"]'
ENV_DRAW_X_START="960"
ENV_DRAW_Y_START="465"
ENV_R_START='["0", "0"]'
ENV_C_START='["0", "50"]'

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", "ENV_R_START", and "ENV_C_START" variables MUST be string arrays of the same size.

Also note that I did the following in the above example:

ENV_R_START='["0", "0"]'
ENV_C_START='["0", "50"]'

In this case, the first worker will start drawing from (0, 0) and the second worker will start drawing from (0, 50) from the input image.jpg file.

This is useful if you want different threads drawing different parts of the image with different accounts.

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.

reddit-place-script-2022's People

Contributors

alexander01998 avatar entropyvalley avatar jakonl avatar marius851000 avatar randomblock1 avatar rdeepak2002 avatar risewill23 avatar rsedxcftvgyhbujnkiqwe avatar superdelphi avatar xfedex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.