Clicks a button at random intervals
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.org/scripts/494463/1373518/Master%20File%20Random%20AM%20Button%20Clicker.js
// ==UserScript==
// @name Master File Random AM Button Clicker
// @namespace https://greasyfork.org/master-file-random-Am-button-clicker
// @version 3.0
// @description Clicks a button at random intervals
// @license MIT
// @match https://*.apple.com/*
// @grant none
// @downloadURL https://update.greasyfork.org/
// @updateURL https://update.greasyfork.org/
// ==/UserScript==
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min);
}
function doSomething() {
// Find the "Next" button using its class
var nextButton = document.querySelector('amp-playback-controls-item-skip.next');
if (nextButton) {
nextButton.click();
} else {
console.log("Next button not found.");
}
}
(function loop() {
var rand = getRandomInt(35000, 45000);
console.log(rand);
setTimeout(function() {
doSomething();
loop();
}, rand);
})();