biliLive click

按键触发-持续点击b站直播间点赞按钮,按小键盘0开始,按小数点结束,默认点击间隔500ms

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

Advertisement:

// ==UserScript==
// @name         biliLive click
// @namespace    http://tampermonkey.net/
// @version      2025-03-21
// @description  按键触发-持续点击b站直播间点赞按钮,按小键盘0开始,按小数点结束,默认点击间隔500ms
// @author       zombiz
// @match        https://live.bilibili.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    // 小键盘0开始
    var startKeyCode = 96;
    //  小数点结束
    var stopKeyCode = 110;
    //  默认点击间隔500ms
    var clickIntervalMs = 500;


    var clicklikeId = null;
    var intervalId = window.setInterval(function() {
        if (document.readyState === "complete") {
            clearInterval(intervalId);

            document.addEventListener("keydown",function(event) {
                if(event.keyCode == startKeyCode ){
                    clearInterval(clicklikeId);
                    clicklikeId = window.setInterval(
                        // 每300ms调用一次 showTime
                        function clickLike(event){
                            console.log("clickLike")
                            var like =document.getElementsByClassName("like-btn")[0]
                            like.click(event)
                        }, clickIntervalMs + Math.floor(Math.random() * 100)
                    )
                }
                if(event.keyCode == stopKeyCode ){
                    clearInterval(clicklikeId);
                }
            })
            // Your code here...
            // 在这里放置你想要延迟执行的油猴脚本代码
        }
    }, 1000);

})();