// ==UserScript== // @name Wplace chunk downloader // @namespace http://tampermonkey.net/ // @version 2.1.5 // @description Easily download chunk images from wplace.live using multi-point selection and highlighting // @author NotNotWaldo // @match https://wplace.live/* // @icon https://www.google.com/s2/favicons?sz=64&domain=wplace.live // @license MIT // @run-at document-end // @grant none // @downloadURL https://update.greasyfork.icu/scripts/546392/Wplace%20chunk%20downloader.user.js // @updateURL https://update.greasyfork.icu/scripts/546392/Wplace%20chunk%20downloader.meta.js // ==/UserScript== // Code below, feel free to read in horror (() => { // Global vals because I'm way too lazy // These variables are for handling the highlighting feature let isHightlightOn = false; let downloadingState = false; // the downloading state ensures that the highlight wont be also printed when downloading the images of chunk // variables for the currently selected chunks let chunkX = null; let chunkY = null; let chunkUrl = null; // for the dragging mechanic let isPointing = false; // just a template for chunk img const chunkTemplateUrl = `https://backend.wplace.live/files/s0/tiles/`; // array for highlighting chunks let highlightedChunksLinksArr = []; // variables for the download bar let currImgsDownloaded = null; let totalImgsToBeDownloaded = null; // the coords of chunks that are selected by the points you've set let mlChunkCoords = { firstChunk: { x: null, y: null }, secondChunk: { x: null, y: null }, }; // for lazily waiting for something const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); let multipleChunksDownloaderElem = document.createElement("div"); multipleChunksDownloaderElem.className = "mulChunksDownloader"; multipleChunksDownloaderElem.innerHTML = `