Created
April 25, 2022 10:00
-
-
Save mikhailsdv/76f2026de783f259f64b430ef8df9978 to your computer and use it in GitHub Desktop.
Hack Random for castlots.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hack Random for castlots.org | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://castlots.org/generator-sluchajnyh-chisel/ | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=castlots.org | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const numbers = [11, 12, 13, 14, 15]; | |
const el = document.querySelector(".number2"); | |
let i = 0; | |
const observer = new MutationObserver(() => { | |
el.childNodes[1].replaceData(0, 99, numbers[i++] || Math.round(Math.random() * 100)) | |
}); | |
observer.observe(el, {attributes: true, childList: true, subtree: true}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment