onemillioncheckboxes

janky checkbox checker for onemillioncheckboxes (it's badly scripted fyi, I stopped caring because it got insanly botted by people more skilled than me, sorry. Feel free to use any part of this code)

2024-06-29 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         onemillioncheckboxes
// @namespace    onemillioncheckboxeschecker
// @version      0.2
// @description  janky checkbox checker for onemillioncheckboxes (it's badly scripted fyi, I stopped caring because it got insanly botted by people more skilled than me, sorry. Feel free to use any part of this code)
// @author       YOU (idc tbh)
// @license      MIT
// @match        https://onemillioncheckboxes.com/
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
    let isSelecting=false;let startX,startY,endX,endY;let selectionBox;let startTime;
    function isElementInViewport(el){const rect=el.getBoundingClientRect();return(rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth))}
    function clickCheckbox(checkbox){if(!checkbox.checked){checkbox.click()}}
    function selectCheckboxesInArea(startX, startY, endX, endY) {
    const allCheckboxes=document.querySelectorAll('input[type="checkbox"]');const checkboxesToCheck=[];allCheckboxes.forEach((checkbox)=>{if(!checkbox.checked&&isElementInViewport(checkbox)){const checkboxRect=checkbox.getBoundingClientRect();const checkboxX=checkboxRect.left+window.scrollX;const checkboxY=checkboxRect.top+window.scrollY;if(checkboxX>=startX&&checkboxX<=endX&&checkboxY>=startY&&checkboxY<=endY){checkboxesToCheck.push(checkbox)}}});checkboxesToCheck.forEach((checkbox,index)=>{const delay=Math.floor(index/7)*1310;setTimeout(()=>clickCheckbox(checkbox),delay)})}
    function startSelection(){isSelecting=!0;document.body.style.cursor='crosshair';selectionBox=document.createElement('div');selectionBox.style.position='absolute';selectionBox.style.border='2px solid red';selectionBox.style.pointerEvents='none';document.body.appendChild(selectionBox);addSelectionListeners()}
    function handleMouseDown(event){if(isSelecting){startX=event.pageX;startY=event.pageY;selectionBox.style.left=startX+'px';selectionBox.style.top=startY+'px';selectionBox.style.width='0';selectionBox.style.height='0';selectionBox.style.display='block'}}
    function handleMouseMove(event){if(isSelecting){endX=event.pageX;endY=event.pageY;const boxWidth=Math.abs(endX-startX);const boxHeight=Math.abs(endY-startY);selectionBox.style.width=boxWidth+'px';selectionBox.style.height=boxHeight+'px';selectionBox.style.left=Math.min(endX,startX)+'px';selectionBox.style.top=Math.min(endY,startY)+'px'}}
    function handleMouseUp(){if(isSelecting){isSelecting=!1;document.body.style.cursor='default';selectionBox.style.display='none';selectCheckboxesInArea(Math.min(startX,endX),Math.min(startY,endY),Math.max(startX,endX),Math.max(startY,endY));removeSelectionListeners()}}
    function addSelectionListeners(){document.addEventListener('mousedown',handleMouseDown);document.addEventListener('mousemove',handleMouseMove);document.addEventListener('mouseup',handleMouseUp)}
    function removeSelectionListeners(){document.removeEventListener('mousedown',handleMouseDown);document.removeEventListener('mousemove',handleMouseMove);document.removeEventListener('mouseup',handleMouseUp)}
    document.addEventListener('keydown',function(event){if(event.altKey&&event.key==='x'){startSelection()}})
})();