NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Perculus Auto attendance // @namespace http://tampermonkey.net/ // @version 0.1 // @description Never click that damned button again // @author You // @match https://*.perculus6.com/app/* // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net // @grant none // @copyright 2023, alaula (https://openuserjs.org/users/alaula) // @license MIT // ==/UserScript== function waitForElm(selector) { return new Promise(resolve => { if (document.querySelector(selector)) { return resolve(document.querySelector(selector)); } const observer = new MutationObserver(mutations => { if (document.querySelector(selector)) { resolve(document.querySelector(selector)); observer.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true }); }); } while (true) { // wait for attendance button const elm = await waitForElm('button.response-button'); //save it let clone = elm.parentElement.parentElement.cloneNode(3); //click attendance check elm.click(); if(clone.querySelector("span.score")) { console.debug(clone.querySelector("span.score").textContent); } }