Greasy Fork is available in English.
自动点击 OP.GG 网站上的「录制」或「观看」按钮
当前为
// ==UserScript==
// @name OP.GG Auto Clicker
// @name:zh-TW OP.GG 自動點擊腳本
// @name:zh-CN OP.GG 自动点击脚本
// @namespace https://www.youtube.com/c/ScottDoha
// @version 1.0
// @description Automatically clicks "Record" or "Spectate" buttons on OP.GG website
// @description:zh-TW 自動點擊 OP.GG 網站上的「錄製」或「觀看」按鈕
// @description:zh-CN 自动点击 OP.GG 网站上的「录制」或「观看」按钮
// @author Scott
// @match *://*.op.gg/summoners/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// 每60秒刷新頁面
setInterval(function() {
location.reload();
}, 60000); // 60000ms = 60s
// 檢查是否存在錄制或觀看按鈕,並點擊
function clickButton() {
const recordButton = document.querySelector('button[type="button"].css-6qf538'); // 錄制按鈕
const spectateButton = document.querySelector('button.spectate'); // 觀看按鈕
if (recordButton) {
recordButton.click();
} else if (spectateButton) {
spectateButton.click();
}
}
// 初始運行一次,之後每2秒檢查一次是否有按鈕出現
clickButton();
setInterval(clickButton, 2000);
})();