您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically clicks elements on Kick.com to keep the chat or other elements active, with a pause feature using the Delete key.
- // ==UserScript==
- // @name Never Let Chat Pause
- // @namespace https://greasyfork.org/en/users/1200587-trilla-g
- // @version 5.0
- // @description Automatically clicks elements on Kick.com to keep the chat or other elements active, with a pause feature using the Delete key.
- // @author Trilla_G
- // @match *://*.kick.com/*
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function () {
- 'use strict';
- // Define the selector for the target element
- const targetSelector = '.betterhover\\:hover\\:bg-surface-higher';
- // State to track whether the script is paused
- let scriptPaused = false;
- // Set up an observer to watch for the target entering the viewport
- const observer = new IntersectionObserver(entries => {
- if (!scriptPaused) {
- entries.forEach(entry => {
- if (entry.isIntersecting) {
- entry.target.click();
- }
- });
- }
- });
- // Function to monitor and observe the target
- function observeTarget() {
- if (scriptPaused) return; // Skip functionality when paused
- const target = document.querySelector(targetSelector);
- if (target) {
- observer.observe(target);
- }
- }
- // Set up a MutationObserver to detect changes in the page and find the target
- const mutationObserver = new MutationObserver(() => {
- if (!scriptPaused) observeTarget();
- });
- mutationObserver.observe(document.body, { childList: true, subtree: true });
- // Automatic clicking every 15 seconds
- const autoClickInterval = setInterval(() => {
- if (!scriptPaused) {
- const target = document.querySelector(targetSelector);
- if (target) {
- target.click();
- }
- }
- }, 15000); // 15 seconds
- // Pause the script for 15 seconds when the Delete key is pressed
- document.addEventListener('keydown', (event) => {
- if (event.key === 'Delete' && !scriptPaused) {
- console.log('Script paused for 15 seconds.');
- scriptPaused = true;
- // Disconnect observers and pause automatic actions
- observer.disconnect();
- mutationObserver.disconnect();
- // Resume script after 15 seconds
- setTimeout(() => {
- console.log('Script resumed.');
- scriptPaused = false;
- // Reconnect observers
- observeTarget();
- mutationObserver.observe(document.body, { childList: true, subtree: true });
- }, 15000);
- }
- });
- // Initial observation
- observeTarget();
- })();