Greasy Fork

Greasy Fork is available in English.

斗鱼弹幕助手

自动发弹幕

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         斗鱼弹幕助手
// @namespace    http://tampermonkey.net/
// @version      1.0
// @icon         https://shark.douyucdn.cn/app/douyu/res/com/sg-taskicon.png
// @description  自动发弹幕
// @author       Kevin<[email protected]>
// @match        https://www.douyu.com/485503
// @require      https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    console.log('欢迎使用斗鱼助手');
    var room = document.location.pathname.split('/')[1]
    var re = /^\d+$/;
    if(!re.test(room)){
        console.log('==outdoor==')
    }else{
        setTimeout(function (){
            var s = $('h5.ShieldTool-checkText')[0].innerText='屏蔽';
            var html_comp = "<div class='asst' style='display:inline-block;'><span class='GuessMainPanelHeader-icon myMore'></span></div>";
            var bsl = $('.BarrageSuperLink').after(html_comp);
            var asstBtn = bsl.next();
            $(asstBtn).on('click',function(){
                console.log('clk');
            });
            advsend();
        }, 2000);
    }
    // 自动发送txtList中的弹幕
    function advsend(){
        var txtList = ['💃💃💃💃💃💃💃💃💃','666666666666666','婷婷婷婷婷婷婷婷婷婷婷婷'];
        var len = txtList.length;
        var idx = 0;
        setInterval(function(){
            var timecount = $('.ChatSend-button')[0].innerText;
            if(timecount==='发送'){
                $('.ChatSend-txt').val(txtList[idx++]);
                console.log('t');
                $('.ChatSend-button').click();
                if(idx===len){
                    idx=0;
                }
            }
        },500);
    }
})();