Created
December 10, 2024 02:54
-
-
Save michael-kudrik/c8f00e8e7613a4cdab685e14ac0d7276 to your computer and use it in GitHub Desktop.
Zooniverse - Exoasteroids - Automatic Play Clicker
This file contains hidden or 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 New script zooniverse.org | |
| // @namespace Violentmonkey Scripts | |
| // @match https://www.zooniverse.org/projects/exoasteroids/exoasteroids/classify* | |
| // @grant none | |
| // @version 1.0 | |
| // @author - | |
| // @description 12/9/2024, 9:33:09 PM | |
| // ==/UserScript== | |
| // Function to click the target button | |
| // Function to click the target button | |
| // Function to simulate a click on the button | |
| function clickSecretButton() { | |
| const button = document.querySelector('.secret-button.subject-tools__play'); | |
| if (button) { | |
| button.click(); | |
| console.log("Button clicked!"); | |
| } | |
| } | |
| // Observe DOM changes and trigger the click function | |
| const observer = new MutationObserver(() => { | |
| clickSecretButton(); // Try to click the button whenever a mutation is detected | |
| }); | |
| // Configuration for the observer | |
| const config = { | |
| childList: true, // Look for changes in the direct children of the observed node | |
| subtree: true // Also observe the entire subtree | |
| }; | |
| // Start observing the body for changes | |
| observer.observe(document.body, config); | |
| // Initial click attempt in case the button already exists | |
| clickSecretButton(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment