Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name minesweeper solver
- // @namespace http://tampermonkey.net/
- // @version 2025-12-27
- // @description try to take over the world!
- // @author You
- // @match https://cult-prove-boating-non.trycloudflare.com/user/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=minesweeper.online
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- let intervalId = setInterval(convert, 1000);
- })();
- var storedLink = "";
- var doOnce = false;
- let buttonMemory;
- function convert() {
- var gridElementA = document.getElementById("game-grid");
- var mines = 25;
- let result = "";
- let rows = 12
- var cells = 12
- var columns = 144 / rows
- for (var i = 0; i < 144; i++)
- {
- console.log('rofl');
- var bFound = false;
- if(i % rows == 0 && i !== 0) {
- result += ":"
- }
- if (gridElementA.children[i].classList.contains("flagged"))
- {
- result += '!';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("number-1"))
- {
- result += '1';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("number-2"))
- {
- result += '2';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("number-3"))
- {
- result += '3';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("number-4"))
- {
- result += '4';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("number-5"))
- {
- result += '5';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("number-6"))
- {
- result += '6';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("number-7"))
- {
- result += '7';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("number-8"))
- {
- result += '8';
- bFound = true;
- }
- if (gridElementA.children[i].classList.contains("revealed"))
- {
- if(!bFound)
- {
- result += '.';
- bFound= true;
- }
- }
- if(!bFound)
- {
- result += 'x';
- bFound = true;
- }
- }
- var link = `https://mrgris.com/projects/minesweepr/demo/analyzer/?w=12&h=12&mines=25&board=${result}`;
- console.log(link);
- if(!doOnce)
- {
- var ifrm = document.createElement("iframe");
- ifrm.setAttribute("src", link);
- ifrm.id = "IFRA_XD";
- ifrm.style.width = "800px";
- ifrm.style.height = "800px";
- buttonMemory = document.createElement('button');
- buttonMemory.id = "XD";
- buttonMemory.innerHTML = 'Click me';
- buttonMemory.onclick = function() {
- let div3 = document.getElementById('IFRA_XD');
- div3.src = storedLink;
- };
- let div2 = document.getElementById('error-container');
- div2.appendChild(ifrm);
- div2.appendChild(buttonMemory);
- doOnce = true;
- }
- if(doOnce)
- {
- storedLink = link;
- }
- if(!document.getElementById('IFRA_XD'))
- {
- doOnce = false;
- }
- }
- function getNumberFromClassName(className) {
- let match = className.match(/hd_top-area-num(\d)/);
- return match ? parseInt(match[1]) : 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment