WORKING VERSION!
This update fixes any bugs the last one had.
Also, for the newbies, this is used by opening developer tools (on basically any browser) then pasting it into the console.
setInterval(function() {
try {
// Locate the "Run Script" button
const runScriptButton = document.querySelector("#HashDice-control-2 > div.game-control-panel > div > div.sqshipa.scripts-inputs > div.actions > button.ui-button.button-normal.s-conic2");
// Check if the button exists and has the correct text content
if (runScriptButton && runScriptButton.textContent.trim() === "Run Script") {
// Click the "Run Script" button
runScriptButton.click();
console.log("Clicked 'Run Script' button automatically.");
// Flag to track successful "Run Script" button click
let runScriptClicked = true;
// Only proceed to look for the confirmation button if the "Run Script" button was successfully clicked
if (runScriptClicked) {
setTimeout(function() {
try {
// Locate the confirmation button
const confirmationButton = document.querySelector("#root > div.wdcb8sn.ui-pop-overlayer > div > div > div.btns > button.ui-button.button-normal.s-conic.light > div");
// Click the confirmation button if it exists
if (confirmationButton) {
confirmationButton.click();
console.log("Clicked confirmation button automatically.");
} else {
console.log("Confirmation button not found.");
}
} catch (error) {
console.error("Error attempting to click the confirmation button:", error);
}
}, 3000);
}
} else {
console.log("'Run Script' button not found or not displaying correct text.");
}
} catch (error) {
console.error("Error attempting to click the 'Run Script' button:", error);
}
}, 30000); // Check every 30 seconds