Giter Site home page Giter Site logo

iamsiddhant05 / reddit-placebot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zequez/reddit-placebot

0.0 0.0 0.0 3.5 MB

A bot that paints on Reddit /r/place. Works with multiple accounts, and can work with a remote target file for multiple people with the same objective.

License: MIT License

JavaScript 99.18% Batchfile 0.42% Shell 0.40%

reddit-placebot's Introduction

Reddit Placebot

Anything that can be automated should be automated

Place has ended. It was a good run, thanks everyone that supported the project!


This is a bot I made for the Reddit /r/place event of 2017 April Fools Day. I just wanted to make a simple quick script because I expected it to last until April 2nd. It lasted a total of 72 hours.

Originally made this bot to protect our national flag on /r/argentina. But you can use it for your artwork or evil deeds, with your own account, your other 4 throwaways, or the 1000 accounts dump you found on Pastebin. The Placebot is impartial and doesn't discriminate.

The /r/place final board

Non-tech install

These are the step-by step instructions for non-tech people:

  • Go to nodejs.org and download and install the latest version
  • On this page, click the green Clone or download button and then on Download ZIP
  • Uncompress the downloaded zip file
  • Go to the uncompressed folder
  • Rename the users.example.json to users.json and open it up to put your Reddit user names and passwords in the same format the examples (and erase the examples)
  • Run one time: install.bat (Windows) or install.sh (Linux or Mac) and wait until it finishes
  • Run every time you want to use it: start.bat (Windows) or start.sh (Linux or Mac)
  • Configure stuff if you need to on config.json, or open the start scripts and add command line arguments there

Para la imagen oficial de Argentina usen start_argentina.bat o start_argentina.sh

Installation

You need to have NodeJS installed

git clone https://github.com/zequez/reddit-placebot
cd reddit-placebot
npm install

Users

Change users.example.json to users.json and add your username and password of your account and all your throwaways.

Usage

Any command line options will override the options on config.json:

  npm run start
  npm run start --remote --target <REMOTE_TARGET_URL>
  npm run start --target <LOCAL_TARGET_FILE>
  npm run start --target <LOCAL_TARGET_FILE> --startX <targetStartX> --startY <targetStartY>

Target Oficial Argentino

Este comando es nosotros boludo:

npm run start --argentinaTarget

This uses the file at: https://raw.githubusercontent.com/Zequez/placebot-argentina-target/master/official_target.png

Configuration

The Target Image File

It can be a PNG, JPG or BMP file of any size or compression.

To change the position of the board you want to paint the target in:

  • targetStartX: 0-999
  • targetStartY: 0-999

Transparent pixels are just transparent pixels in PNG, or #ff00ff (for legacy reasons) and will be ignored by the bot.

Colors

You can use any colors and will try to find the closest match. The available board colors are visible in the file /src/colors.js. But it's better if you use and eyedropper tool from a board image.

Target Location

The bot downloads the board each time it's time to draw, so it only changes the necessary pixels that don't match the target.

Remote (for multiple people)

You can configure the target to be downloaded from a remote URL:

  • useRemoteTarget: true
  • REMOTE_TARGET_URL: "http://example.com/remote_target.png"

The image will be downloaded before painting and saved to images/remote_target.

Local (just for your own bots)

images/target.png

  • useRemoteTarget: false
  • LOCAL_TARGET_FILE: __dirname + '/images/target.png'

Bundle up changes

If you want to wait until multiple users are available to paint and do the changes all at the same time, change the config:

  • bundleAccounts: <Number 1-Infinity> (default = 8)

Drawing Mode

  • drawMode: <mode> (default = 'RANDOM')
    • 'LEFTTOP': Will draw from left to right and top to bottom
    • 'RANDOM': Will draw at random points

Testing

LOL

My initial intention was to make a simple script, didn't expect it to last, so testing manually was feasible. Now I should be writing tests, because it's getting tedious, but I don't know how long will /r/place last for.

Other Projects

Thanks to trosh/rplace to figure out how to actually read the bitmap from the server. I just ported that to Node.

Thanks oliver-moran/jimp for a Node image processing library without any kind of binary dependencies.

Thanks dtao/nearest-color for the nearest color matching.

License

The Reddit Placebot is released under the MIT License.

reddit-placebot's People

Contributors

zequez avatar ale1 avatar martinrlilja avatar robinflikkema 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.