BMO BOT

BMO MAKER

Version vom 14.08.2023. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         BMO BOT
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  BMO MAKER
// @author       Bambi
// @match        https://pixelplace.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pixelplace.io
// @run-at       document-start
// @grant        none
// @license MIT
// ==/UserScript==
function fix(a, b) {
    Object.defineProperty(window.console, a, {configurable:false,enumerable:true,writable:false,value:b});
}

fix('log', console.log);
fix('warn', console.warn);
fix('error', console.error);
fix('info', console.info);
const originalWebSocket = window.WebSocket;
var socket;

class WebSocketHook extends originalWebSocket {
    constructor(a, b) {
        super(a, b);
        socket = this;
    }
}

window.WebSocket = WebSocketHook;

document.addEventListener('keydown', function(event) {
    // Check if the pressed key is 'j'
    if (event.key === 'j') {
        // Get the element with the id "coordinates"
        var coordinatesElement = document.getElementById('coordinates');
        var coordinatesValue = coordinatesElement.textContent;
        // Split the coordinates value into x and y parts
        var [x, y] = coordinatesValue.split(',');
        // Call the BMO function with the extracted x and y values
        console.log(parseInt(x), parseInt(y));
        BMO(parseInt(x), parseInt(y));
    }
});

function placePix(x, y, col) {
    socket.send(`42["p",[${x},${y},${col},1]]`);
}

function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

async function BMO(SX, SY) {
    const pixelArray = [
       [0 ,0 ,0 ,0 ,0 ,37 ,37, 37, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36],//1
 [0, 0, 0, 0, 0, 37, 48, 48, 48, 48, 48, 48, 48, 37, 36, 36, 36, 36, 36],//2
 [0, 0, 0, 0, 0, 37, 48, 5, 48, 48, 48, 5, 48, 37, 36, 36, 36, 36, 36],//3
 [0, 0, 0, 0, 0, 37, 48, 48, 48, 48, 48, 48, 48, 37, 36, 36, 36, 36, 36],//4
 [0, 0, 0, 0, 0, 37, 48, 5, 5, 5, 5, 5, 48, 37, 36, 36, 36, 36 ,36],//5
 [0, 37, 0, 0, 0, 37, 48, 48, 5, 5, 5, 48, 48, 37, 36, 36, 36, 36, 36],//6
 [0, 37, 0, 0, 0, 37, 48, 48, 48, 48, 48, 48, 48, 37, 36, 36, 36, 36, 36],//7
 [0, 0, 37, 0, 0, 37, 37, 37, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36],//8
 [0, 0, 0, 37, 37, 37, 3, 3, 3, 3, 3, 37, 44, 37, 36, 47, 36, 36, 36],//9
 [0, 0, 0, 0, 0, 37, 37, 37, 37, 37, 37, 37, 37, 37, 36, 47, 36, 36, 36],//10
 [0, 0, 0, 0, 0, 37, 37, 11, 37, 37, 37, 37, 37, 37, 36, 47, 36, 36, 36],//11
 [0, 0, 0, 0, 0, 37, 11, 11, 11, 37, 37, 37, 37, 37, 36, 47, 36, 36, 36],//12
 [0, 0, 0, 0, 0, 37, 37, 11, 37, 37, 37, 32, 37, 37, 36, 47, 36, 36, 36],//13
 [0, 0, 0, 0, 0, 37, 37, 37, 37, 37, 20, 37, 7, 37, 36, 36, 36, 36, 36],//14
 [0, 0, 0, 0, 0, 37, 37, 37, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36],//15
 [0, 0, 0, 0, 0, 37, 37, 37, 37, 37, 37, 37, 37, 37, 36, 36, 36, 36, 36],//16
 [0, 0, 0, 0, 0, 0, 0, 37, 36, 0, 0, 0, 0, 0, 37, 36, 0, 0, 0, 0],//17
 [0, 0, 0, 0, 0, 0, 0, 37, 36, 0, 0, 0, 0, 0, 37, 36, 0, 0, 0, 0],//18
 [0, 0, 0, 0, 0, 0, 0, 37, 36, 0, 0, 0, 0, 0, 37, 36, 0, 0, 0, 0],//19
        // Add more rows as needed
    ];
    for (let y = 0; y < pixelArray.length; y++) {
        for (let x = 0; x < pixelArray[y].length; x++) {
            const col = pixelArray[y][x];
            placePix(SX + x, SY + y, col);
            await sleep(100);
        }
    }
}