Skip to content

Instantly share code, notes, and snippets.

@happiness801
Last active July 4, 2024 17:19
Show Gist options
  • Save happiness801/3abf5f2ae628abbd36fa69c33abee23b to your computer and use it in GitHub Desktop.
Save happiness801/3abf5f2ae628abbd36fa69c33abee23b to your computer and use it in GitHub Desktop.
OneMillionCheckboxes.com checker
// ==UserScript==
// @name Check boxes on OneMillionCheckboxes.com
// @namespace http://onai.net/
// @version 0.1
// @description Checks boxes on onemillioncheckboxes.com
// @author Kevin Gwynn
// @match https://onemillioncheckboxes.com/*
// @grant none
// ==/UserScript==
// var kagStart = 380380;
if (typeof kagTimeout == 'undefined') var kagTimeout = null;
// Disable window alerts
window.alert = function() {};
//var kagTimeout = null;
checkOne = () => {
// Select all checkboxes on the page
const checkboxes = document.querySelectorAll('input[type="checkbox"]');
let i = 0;
// Loop through each checkbox in reverse order
for (i = checkboxes.length - 50; i >= 0; i--) {
// Check if the checkbox is not already checked
if (!checkboxes[i].checked) {
// Emulate a click on the checkbox
checkboxes[i].click();
// Exit the loop after clicking the first unchecked checkbox
break;
}
}
let delay = (Math.random() * 200) + 180;
console.log('KAG: clicked #' + i + ', delay = ' + delay);
kagTimeout = setTimeout(kagTrigger, delay);
};
clearTimeout(kagTimeout);
kagTrigger = () => { checkOne(); };
kagTrigger();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment