Twitch Auto Receive Drops

Twitch 自動收取 Drops , 自訂檢查間隔

当前为 2023-09-08 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name                Twitch Auto Receive Drops
// @name:zh-TW          Twitch 自動收取 Drops
// @name:en             Twitch Auto Receive Drops
// @version             0.0.1
// @author              HentaiSaru
// @description         Twitch 自動收取 Drops , 自訂檢查間隔
// @description:zh-TW   Twitch 自動收取 Drops , 自訂檢查間隔
// @description:en      Twitch automatically collects Drops, custom check interval

// @match        https://www.twitch.tv/drops/inventory*
// @icon         https://cdn-icons-png.flaticon.com/512/8214/8214044.png

// @license      MIT
// @namespace    https://greasyfork.org/users/989635

// @run-at       document-end
// ==/UserScript==

(function() {
    const custom = {
        button: "button.ScCoreButton-sc-ocjdkq-0.ScCoreButtonPrimary-sc-ocjdkq-1",
        CheckInterval: 60, // 檢查間隔 (seconds / 秒數)

    }, observer = new MutationObserver(() => {
        const claimButton = document.querySelector(custom.button);
        claimButton ? (observer.disconnect(), claimButton.click()) : null;
    });
    observer.observe(document.body, {childList: true, subtree: true});
    setInterval(()=> {location.reload()}, 1000 * custom.CheckInterval);
})();