Skip to content

Overlay dos brasileiros, a partir do Discord, no r/place 2022

License

Notifications You must be signed in to change notification settings

Tetizera-zz/place-rbrasil2022

Repository files navigation

[Instruction available in English below] - Instruções de uso do overlay do r/brasil no r/place 2022

INSTRUÇÕES PARA USAR O OVERLAY:

// ==UserScript==
// @name         Brasil r/place Template
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the canvas!
// @author       oralekin, LittleEndu
// @match        https://hot-potato.reddit.com/embed*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant        none
// ==/UserScript==
if (window.top !== window.self) {
    window.addEventListener('load', () => {
        document.getElementsByTagName("mona-lisa-embed")[0].shadowRoot.children[0].getElementsByTagName("mona-lisa-canvas")[0].shadowRoot.children[0].appendChild(
            (function () {
                const i = document.createElement("img");
                i.src = "https://raw.githubusercontent.com/Tetizera/place-rbrasil2022/main/image.png";
                i.onload = () => {
                    if (i.width === i.height) {
                        i.style = "position: absolute;left: 0;top: 0;image-rendering: pixelated;width: 1000px;height: 1000px;";
                    } else {
                        i.style = "position: absolute;left: 0;top: 0;image-rendering: pixelated;width: 2000px;height: 1000px;";
                    }
                };
                return i;
            })())
    }, false);
}

Note que o script pode ser atualizado por vários motivos, então pra garantir, entre no Discord e veja TUDO no #rplace-anúncios. Aliás, procure um emoji de bandeira do Brasil e clique nele para receber anúncios dos mods e responsáveis.

  • Se tiver dúvidas, pingue @Tet#0001 ou envia uma DM para @Tet#0001

This is a simple overlay made by r/brasil Discord users to make our life easier when coordinating actions.

INSTRUCTIONS:

// ==UserScript==
// @name         Brasil r/place Template
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the canvas!
// @author       oralekin, LittleEndu
// @match        https://hot-potato.reddit.com/embed*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant        none
// ==/UserScript==
if (window.top !== window.self) {
    window.addEventListener('load', () => {
        document.getElementsByTagName("mona-lisa-embed")[0].shadowRoot.children[0].getElementsByTagName("mona-lisa-canvas")[0].shadowRoot.children[0].appendChild(
            (function () {
                const i = document.createElement("img");
                i.src = "https://raw.githubusercontent.com/Tetizera/place-rbrasil2022/main/image.png";
                i.onload = () => {
                    if (i.width === i.height) {
                        i.style = "position: absolute;left: 0;top: 0;image-rendering: pixelated;width: 1000px;height: 1000px;";
                    } else {
                        i.style = "position: absolute;left: 0;top: 0;image-rendering: pixelated;width: 2000px;height: 1000px;";
                    }
                };
                return i;
            })())
    }, false);
}

FYI: The script's code may be changed for a variety of reasons. Because of that, our "diplomats" (Mostly Tet#0001), will contact people on their Discords and subreddits in necessary. Feel free to ping me if I'm in your subreddit's server.


the script checks the URL provided, in this case https://raw.githubusercontent.com/Tetizera/place-rbrasil2022/main/image.png, to update the script to all users of the script. It usually takes 5 minutes for the new image to be updated to users, but it is not automatic yet.

.py files explained (python3, pip, numpy, pillow packages required)

  • prepare_place.py
    • adapts the file to be used on the r/place canvas. The config.txt file provided picks the far left corner pixel in the image.
  • dotter.py
    • adds the dots with the color of each pixel in the canvas. When you are on r/place, the pixels with the 'correct' color don't have a dot.

r/place 2022 color HEX codes (as seen on Wikipedia and r/place HTML code).

This is necessary if you wish to copy this code and draw or paint your own pixel art on r/place. The dots made by dotter.py will show up even if you use the right color, but using a different HEX code than the one used by r/place.

image on Wikipedia

red - #FF4500

orange - #FFA800

yellow - #FFD635

dark green - #00A368

light green - #7EED56

dark blue - #2450A4

blue - #3690EA

light blue - #51E9F4

dark purple - #811E9F

purple - #B44AC0

light pink - #FF99AA

brown - #9C6926

black - #000000

dark gray - #898D90

light gray - #D4D7D9

white - #FFFFFF

dark red - #BE0039

green - #00CC78

dark teal - #00756F

teal - #OO9EAA

indigo - #493AC1

periwinkle - #6A5CFF

pink - #FF3881

dark brown - #6D482F


CREDIT

r/Superstonk devs: https://github.com/rplacesuperstonk/rplace-image

About

Overlay dos brasileiros, a partir do Discord, no r/place 2022

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published