Created
April 1, 2024 13:27
-
-
Save ultimateshadsform/ea1b2b6a2c5135bcbb2684ce020fc983 to your computer and use it in GitHub Desktop.
This file contains 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 Auto Click "Boop" Spans and "Boop" Button | |
// @namespace tampermonkey.net | |
// @version 1.0 | |
// @description Automatically clicks on the provided button and then clicks the second button every 1 second after that | |
// @author You | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Function to handle clicking on elements | |
function clickElement(element) { | |
if (element) { | |
element.click(); | |
} | |
} | |
// Function to click the provided button | |
function clickFirstButton() { | |
const firstButton = document.querySelector('button[aria-label="Boop"]'); | |
clickElement(firstButton); | |
} | |
// Function to click the second button | |
function clickSecondButton() { | |
const secondButton = document.querySelector('button.TRX6J[aria-label="boop"]'); | |
clickElement(secondButton); | |
} | |
// Function to run the script every 1 second | |
function runScript() { | |
// Click the provided button | |
clickFirstButton(); | |
// Wait for a short delay before clicking the second button | |
setTimeout(clickSecondButton, 300); | |
} | |
// Run the script initially | |
runScript(); | |
// Run the script every 1 second | |
setInterval(runScript, 300); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment