Neopets - Magma pool helper

Refreshes the page every five minutes until the guard is asleep, then prints the current time

< Feedback de Neopets - Magma pool helper

Avaliação: Bom - o script funciona

§
Publicado em: 03/01/2024

Works good. I combined the original code and the code soph had. It displayed as a pop up and an orange dot on the tab when he was asleep. You'll also want to update the settings and add the site with https in the front so it checks there. Cheers to everyone going forward!
// ==UserScript==
// @name Neopets - Magma pool helper
// @namespace https://greasyfork.org/en/users/58051-roblox
// @description Refreshes the page every five minutes until the guard is asleep, then prints the current time
// @include http://www.neopets.com/magma/pool.phtml
// @version 1
// @grant none
// @downloadURL https://update.greasyfork.org/scripts/34880/Neopets%20-%20Magma%20pool%20helper.user.js
// @updateURL https://update.greasyfork.org/scripts/34880/Neopets%20-%20Magma%20pool%20helper.meta.js
// ==/UserScript==

var strHTML = document.body.innerHTML;
var yourTime = new Date();
var DelayMax = 120000; // 2 minutes
var DelayMin = 480000; // 8 minutes
var time = document.getElementById("nst").textContent;

if(strHTML.indexOf("I'm sorry, only those well-versed in the ways of Moltara are permitted to enter the Pool.") < 0){
alert(yourTime);
} else {
var lastCheck = document.createElement("div");
lastCheck.innerHTML = "Last Check: " + yourTime.toString();
var parent = document.getElementsByClassName("content")[0];
parent.insertBefore(lastCheck, parent.children[1]);
window.setTimeout(function(){window.location.reload() ;},(Math.round(Math.random() * (DelayMax - DelayMin)) + DelayMin)) ;
console.log("Success");
document.title = time;
}
return;

console.log(time);

Enviar resposta

Entre para publicar uma resposta.