Greasy Fork

Greasy Fork is available in English.

OP.GG 自动点击脚本

自动点击 OP.GG 网站上的「录制」或「观看」按钮

当前为 2024-09-14 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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);
})();