Greasy Fork

Greasy Fork is available in English.

超级小桀房间小助手

快速下注,自动签到,查看积分,自动抢积分,查看地图详情,查看竞猜信息,快速压鱼丸、快速发弹幕。

当前为 2019-04-25 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @author DreamChaser
// @description 快速下注,自动签到,查看积分,自动抢积分,查看地图详情,查看竞猜信息,快速压鱼丸、快速发弹幕。
// @icon https://apic.douyucdn.cn/upload/avatar/002/86/30/15_avatar_big.jpg
// @name 超级小桀房间小助手
// @version 1.5.4
// @match https://www.douyu.com/cave
// @match https://www.douyu.com/0*
// @match https://www.douyu.com/1*
// @match https://www.douyu.com/2*
// @match https://www.douyu.com/3*
// @match https://www.douyu.com/4*
// @match https://www.douyu.com/5*
// @match https://www.douyu.com/6*
// @match https://www.douyu.com/7*
// @match https://www.douyu.com/8*
// @match https://www.douyu.com/9*
// @match https://www.douyu.com/topic/*
// @grant GM_xmlhttpRequest
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_notification
// @namespace http://greasyfork.icu/zh-CN/users/285196-dreamchaser
// @require https://code.jquery.com/jquery-2.1.4.min.js
// @connect xiaojie666.com
// @connect open.douyucdn.cn
// ==/UserScript==


var x,y;
var dragFlag = false,sighInFlag = true,giftFlag=true,activateFlag=false,loopFlag=false,qfFlag=false,closeFlag=false;
var lastText = "",loopText="",text="",lastLog="";
var nickname = getCookie('acf_nickname');
//var acf_did = getCookie('acf_did');
//var acf_uid = getCookie('acf_username');
//var acf_ltkid = getCookie('acf_ltkid');
//var acf_stk = getCookie('acf_stk');
var n=3,lastGiftNum=0,giftNum=0,lastBetCount=-1,betSelect,ywSelected,color,giftStatusCheck,giftOpen,qf,exqf;
var mapsJSON,creditJSON,onlineJSON;
var fullTailText=GM_getValue('fullTailText', ''),tailFlag=1;
var lastCredit=GM_getValue('lastCredit',-1),myCredit=GM_getValue('myCredit',-1);
var log=GM_getValue('log','');
var year,month,date,h,m,s,now,nowYMD,nowHMS;
var roomStatus=GM_getValue('lastRoomStatus',0),lastRoomStatus=GM_getValue('lastRoomStatus',-1);
var notifyText;

var div = document.createElement('div');
var dragDiv=document.getElementById("drag");
div.setAttribute('id', 'newDiv');
div.style.setProperty('position', 'fixed');
div.style.setProperty('width', '258px');
div.style.setProperty('background', 'rgba(222, 222, 222, 0.8)');
div.style.setProperty('left', '75%');
div.style.setProperty('top', '10%');
div.style.setProperty('border', '1px solid #96c2f1');
div.style.setProperty('z-index', '999');
div.style.setProperty('box-shadow', '0 1px 5px 4px #888888');
document.body.appendChild(div);

div.style.left = GM_getValue('left','75%');
div.style.top = GM_getValue('top','10%');
$("#autoqf").prop("checked",GM_getValue('autoqf',false));
$("#autoqd").prop("checked",GM_getValue('autoqd',false));
$("#enter").prop("checked",GM_getValue('enter',false));
$("#onlinenotify").prop("checked",GM_getValue('onlineNotify',false));

$(document).keypress(function(event){
    if(event.keyCode ==13&&document.getElementById("enter").checked){
        $("#bnt_chatsend").trigger("click");
    }
});

var arr=new Array("bnt_getcredit","bnt_joingroup","bnt_vip","#抢分","#入团","#购买会员");

betMess();
creditMess();
mapsMess();
online();
notify();

var intervalTime=3000;
$(document).ready(function (){
    setInterval(function(){
        creditMess();
        mapsMess();
        logMess();
        online();
        if(document.getElementById("autoqd").checked) {
            sighIn();
        }
        if(document.getElementById("loop").checked&&loopFlag){
            loopDanmu();
        }
        else{
            loopFlag=false;
        }
    },5000);
    setInterval(function(){
        if(document.getElementById("loop").checked&&loopFlag){
            loopDanmu();
        }
        else{
            loopFlag=false;
        }
    },intervalTime);
    setInterval(function(){
        GM_setValue('autoqf', document.getElementById("autoqf").checked);
        GM_setValue('autoqd', document.getElementById("autoqd").checked);
        GM_setValue('enter', document.getElementById("enter").checked);
        GM_setValue('loop', document.getElementById("loop").checked);
        GM_setValue('random', document.getElementById("random").checked);
        GM_setValue('onlineNotify', document.getElementById("onlinenotify").checked);
        giftStatusCheck=$('div.TreasureStatus-text').length;
        giftOpen=$('.TreasureStatus-bg.is-open').length;
        if(giftStatusCheck==0){
            giftFlag = true;
        }
        if( document.getElementById("autoqf").checked) {
            exGiftCheck();
            if (giftFlag){
                giftCheck();
            }
        }
        betMess();
    },1000);
});

function getNow() {
    function fix (s){
        return s < 10 ? '0' + s: s;
    }
    var myDate = new Date();
    year=myDate.getFullYear();
    month=fix(myDate.getMonth()+1);
    date=fix(myDate.getDate());
    h=fix(myDate.getHours());
    m=fix(myDate.getMinutes());
    s=fix(myDate.getSeconds());
    now=year+'-'+month+"-"+date+" "+h+':'+m+":"+s;
    nowYMD=year+'-'+month+"-"+date;
    nowHMS=h+':'+m+":"+s;
}

function notify() {
    var notificationDetails={
        text: (function(){
            /* *人 @绝版石头 *嘉嘉 @苹果DY 匿名大佬 *玮灏 *超群 *友 *迪鑫 *永寿
点我查看新版本预告、tips、支持!*/}).toString().split('/*')[1].split('*/')[0],
        title: "感谢以下水友对本插件的支持",
        image: "https://apic.douyucdn.cn/upload/avatar/002/86/30/15_avatar_big.jpg",
        onclick: function () {
            window.open("https://note.youdao.com/ynoteshare1/index.html?id=a667b6a4cf64b3c053ee091d448f2891&type=note");
        }
    }
    var lastDate=GM_getValue('date', 0);
    getNow();
    GM_setValue('date', nowYMD);
    if(nowYMD != lastDate){
        GM_notification(notificationDetails);
        compareCredit(lastDate);
        lastRoomStatus=-1;
    }
}

function hide(){
    var a=document.getElementById("hidecredit").checked,b=document.getElementById("hidemaps").checked,c=document.getElementById("hideinstructions").checked,d=document.getElementById("hidedanmu").checked,e=document.getElementById("hideqfqd").checked,f=document.getElementById("hidebet").checked,g=document.getElementById("hidelog").checked;
    var arr1=new Array(a,b,c,d,e,f,g,"credit","maps","instructions","danmu","qfqd","bet","log");
    var arr2=new Array(a,b,c,d,e,f,g,"#hidecredit","#hidemaps","#hideinstructions","#hidedanmu","#hideqfqd","#hidebet","#hidelog");
    var trueheight=$('section#drag').outerHeight(true)+$('section#hide').outerHeight(true),height;
    for (var i=0;i<7;i++){
        GM_setValue(arr2[i+7], arr2[i]);
        var name="section#"+arr1[i+7]
        height=$(name).outerHeight(true);
        if(arr1[i]&&height!=null){
            $(name).show();
            trueheight+=height;
        }
        else{
            $(name).hide();
        }
    }
    $("#newDiv").css("height",trueheight+7);
}

function addEvent(id,str) {
    document.getElementById(id).addEventListener('click', function (event) { danmu(str); }, false);
}

function renew() {
    creditMess();
    mapsMess();
    betMess();
    online();
}

function online(){
    GM_xmlhttpRequest({
        method: "GET",
        url:"http://open.douyucdn.cn/api/RoomApi/room/74751",
        onload:function(response){
            onlineJSON=JSON.parse(response.responseText);
            roomStatus=onlineJSON.data.room_status;
            if(onlineJSON.data.room_status =="1"){
                $('span#online').text('直播中');
                $('span#online').css('color','red');
            }
            else{
                $('span#online').text('已下播');
                $('span#online').css('color','blue');
            }
        }
    })
    if(roomStatus!=lastRoomStatus){
        if(roomStatus==1){
            if(document.getElementById("onlinenotify").checked){
                notifyText={
                    text: (function(){
                        /*超级小桀已开播,点我直达直播间*/}).toString().split('/*')[1].split('*/')[0],
                    title: "超级小桀房间小助手提醒",
                    image: "https://apic.douyucdn.cn/upload/avatar/002/86/30/15_avatar_big.jpg",
                    onclick: function () {
                        window.open("https://www.douyu.com/74751");
                    }
                };
                GM_notification(notifyText);
            }
        }
        else{
            var close=setInterval(function(){
                if(($('span.dy-ModalRadius-close-x').length!=0)){
                    $('span.dy-ModalRadius-close-x').click();
                    closeFlag=true;
                }
                else {
                    if(closeFlag){
                        clearInterval(close);
                        close=null;
                        closeFlag=false;
                    }
                }
            },3000);
        }
    }
    GM_setValue('lastRoomStatus', roomStatus);
    lastRoomStatus=roomStatus;
};

function creditMess() {
    if(nickname.length== 0){
        $("#showcredit").val( "个人信息:\n暂未查询到您的个人信息。\n请登录您的斗鱼帐号!");
    }
    else{
        GM_xmlhttpRequest({
            timeout:5000,
            method: "GET",
            url: "http://api.xiaojie666.com/xiaojie/credit/query.do?nickName="+nickname ,
            ontimeout:function(response){
                $("#showcredit").val( "个人信息:\n当前网络异常或服务器异常,请检查当前网络或登录xiaojie666.com查询服务器状态。" );
            },
            onload: function(response) {
                creditJSON = JSON.parse(response.responseText);
                var viptime=new Date(creditJSON.vipDate),showvipdate;
                var year = viptime.getFullYear();
                var month = viptime.getMonth()+1;
                var date = viptime.getDate();
                if (year == 1970) {
                    showvipdate = '未购买';
                }
                else {
                    showvipdate = year + "年" + month+"月" + date+"日";
                }
                $("#showcredit").val( "个人信息:\n昵称:" + creditJSON.nickName + "\n总赚得积分:" + creditJSON.earnedCredit + "\n历史最高积分:" + creditJSON.maxCredit + "\n当前积分:" + creditJSON.credit+ "\n会员到期时间:"+ showvipdate);
                if(lastCredit!=creditJSON.credit){
                    var diffCredit=creditJSON.credit-lastCredit;
                    diffCredit>0 ? diffCredit="+"+diffCredit :diffCredit;
                    getNow();
                    GM_setValue('lastCredit', creditJSON.credit);
                    lastCredit=GM_getValue('lastCredit', 0);
                    log=nowHMS+" "+diffCredit+"积分 当前积分为:"+creditJSON.credit+"\n"+log;
                }
            },
        });
    }
}

function mapsMess() {
    GM_xmlhttpRequest({
        timeout:5000,
        method: "GET",
        url: "http://api.xiaojie666.com/xiaojie/levelrecord/list.do?page=0&rows=1",
        ontimeout:function(response){
            $("#showmaps").val( "地图信息:\n当前网络异常或服务器异常,请检查当前网络或登录xiaojie666.com查询服务器状态。" );
        },
        onload:function(response) {
            mapsJSON = JSON.parse(response.responseText);
            var lifetime=mapsJSON.levelRecords[0].lifeTime,showpassdate;
            if (lifetime == null) {
                showpassdate = '未知';
            }
            else {
                var min= parseInt(lifetime/60);
                var sec= lifetime%60;
                showpassdate = min+ "分" + sec+"秒";
            }
            $("#showmaps").val("地图信息:\nID:" + mapsJSON.levelRecords[0].levelId  + "\n国家:"+ mapsJSON.levelRecords[0].creator_ntd_origin_zh + "\n尝试次数:"+mapsJSON.levelRecords[0].attempts + "\n通过率:"+(mapsJSON.levelRecords[0].clearrate * 100).toFixed(2) + "%"+ "\n地图名:" + mapsJSON.levelRecords[0].name_zh + "\n通关用时:" +showpassdate);
        }
    });
}

function logMess() {
    if(log!=lastLog)
    {
        lastLog=log;
        GM_setValue('log', log);
    }
    $("textarea#log").val("日志信息:\n"+log);
}

function cleanLog() {
    GM_setValue('log', '');
    log="";
    logMess();
}

function fullMapsMess(){
    window.open("https://supermariomakerbookmark.nintendo.net/courses/"+ mapsJSON.levelRecords[0].levelId);
}

function donate(){
    window.open("http://note.youdao.com/noteshare?id=a667b6a4cf64b3c053ee091d448f2891&sub=EDF425F0960048C798AE3FAD1F4B20D6");
}

function help(){
    alert((function(){
        /*       显示:将你要显示的功能模块旁边的勾选框打上√,则会显示相应的功能模块,反之则隐藏。
       #签到:输入签到可以获得一定积分,具体获得的积分数量与斗鱼等级,是否加入粉丝团以及是否购买会员有关,每天整点例如5点的前后5分钟可以签到,每半小时可以签到一次。
       #抢分:有散分或者直播间有飞机以上的礼物的时候, 可以输入此命令来随机获得一定的积分。
       #入团:在主播开启一轮新团战之前可以输入此命令,会随机挑选99个水友ID参战,获胜的ID会增加积分,使用此命令不消耗积分。
       #购买会员:购买会员需要消耗5000积分一次,持续时间1个月,可以多次重复购买,重复购买相当于自动续费,会员期间内,你的签到和送礼获得的积分是直接翻倍的。
       #1 5000:1代表投票一号阵营,5000代表下注5000分,#2同理,封盘后不可再压。
       普通弹幕:在直播间发送普通弹幕,与在斗鱼聊天框发送内容无区别,不消耗积分。
       高级弹幕:在直播间发送从左至右移动的彩色弹幕,需要200积分发能发一次,并且需要历史最高积分大于50000。
       上电视:在直播间发送彩色弹幕,一般在屏幕左下角弹出,只有在主播切换到室内镜头画面时才开启这个功能(一般为中午吃饭时),每条消耗10积分。
       小尾巴:在自动签到抢分的时候加上自定义内容,如:“抢分/签到+小尾巴+时间 主播你真丑”则每次自动签到的内容为:“#抢分 主播你真丑 2019-4-9 5:00:00”抢分亦如此。PS:小尾巴可以为空。
       日志:记录使用插件发送的内容和分数变化情况,每天会有与上次使用插件时的积分对比。
       循环发送:重复发送文本框的内容,5S一次,建议配合随机数一起使用。
       随机数:当发送内容与上次发送内容重复时,在内容后加入随机数,建议打开此选项,以免发送过快,被误封。
       清空日志:仅清除当前日志信息,不会影响对比记录分析。*/}).toString().split('/*')[1].split('*/')[0]);
}

function sendColor(){
    color = $("#color").find("option:selected").text();
    switch (color){
        case '蓝':$("#bnt_chatsend").css("color","blue");break;
        case '绿':$("#bnt_chatsend").css("color","green");break;
        case '粉':$("#bnt_chatsend").css("color","pink");break;
        case '橙':$("#bnt_chatsend").css("color","orange");break;
        case '紫':$("#bnt_chatsend").css("color","purple");;break;
        case '红':$("#bnt_chatsend").css("color","red");break;
    }
}

function danmuSelect(){
    var danmuselect=$("#danmuselect").find("option:selected").text();
    if(danmuselect=='普通弹幕'){
        $('#color').attr("disabled","disabled");
        $("#bnt_chatsend").css("color","black");
    }
    else{
        $("#color").removeAttr("disabled");
        sendColor();
    }
}

function chatSend(){
    var c;
    var danmuselect=$("#danmuselect").find("option:selected").text();
    text = $('#write').val();
    color = $("#color").find("option:selected").text();
    if(danmuselect=='普通弹幕'){
        c = '';
    }
    else if(danmuselect=='高级弹幕'){
        c = '#'+color+ ' ';
    }
    else{
        c = '#上电视 '+ color + '色 ';
    }
    if (text.length==0)
    {
        alert(`输入内容为空,请重新输入`);
        return;
    }
    else{
        text=c+text;
        danmu(text);
    }
    if(document.getElementById("loop").checked){
        loopFlag=true;
        GM_setValue('loopText',text);
    }
    else{
        loopFlag=false;
    }
    $('#write').val('');
}

function select(){
    betSelect=$("#betselect").find("option:selected").text();
    if(betSelect=='#1'){
        $("#bnt_confirm").css("color","red");
    }
    else{
        $("#bnt_confirm").css("color","blue");
    }
}

function betCredit(){
    betSelect=$("#betselect").find("option:selected").text();
    var betcredit=$("#betcredit").find("option:selected").text();
    var num;
    switch (betcredit){
        case '全压了':;case '压一半':num='老子'+betcredit;break;
        case '压1/3':num = parseInt(creditJSON.credit/3);break;
        case '压1/4':num = parseInt(creditJSON.credit/4);break;
        case '压1/5':num = parseInt(creditJSON.credit/5);break;
    }
    danmu(betSelect + " " + num);

}

function ywSelect(set,bnt){
    ywSelected=$("#"+set).find("option:selected").text();
    if(ywSelected=='左边'){
        $("#"+bnt).css("color","red");
    }
    else{
        $("#"+bnt).css("color","blue");
    }
}

function betYw(set,num,bnt){
    var ywnum = $("#"+num).find("option:selected").text();
    ywSelected=$("#"+set).find("option:selected").text();
    if(ywSelected=='左边'){
        switch (bnt){
            case 'bnt_ywconfirm':$('div.GuessContItem.is-left:eq(0)').click();break;
            case 'bnt_ywconfirm1':$('div.GuessContItem.is-left:eq(1)').click();break;
            case 'bnt_ywconfirm2':$('div.GuessContItem.is-left:eq(2)').click();break;
        }
    }
    else{
        switch (bnt){
            case 'bnt_ywconfirm':$('div.GuessContItem.is-right:eq(0)').click();break;
            case 'bnt_ywconfirm1':$('div.GuessContItem.is-right:eq(1)').click();break;
            case 'bnt_ywconfirm2':$('div.GuessContItem.is-right:eq(2)').click();break;
        }
    }
    switch (ywnum){
        case '100':$('.chooseOption:eq(1)').click();break;
        case '1000':$('.chooseOption:eq(2)').click();break;
        case '10000':$('.chooseOption:eq(3)').click();break;
        case 'ALL IN':$('.chooseOption:eq(4)').click();break;
    }
    $('div.guessGame--btn.guessGame--btn--sizeM').click();
}

function recoverStatus() {
    var qf=GM_getValue('autoqf',false),qd=GM_getValue('autoqd',false),et=GM_getValue('enter',false),lp=GM_getValue('loop',false),rm=GM_getValue('random',true),oy=GM_getValue('onlineNotify',true);
    var a=GM_getValue('#hidecredit',true),b=GM_getValue('#hidemaps',true),c=GM_getValue('#hideinstructions',true),d=GM_getValue('#hidedanmu',true),e=GM_getValue('#hideqfqd',true),f=GM_getValue('#hidebet',true),g=GM_getValue('#hidelog',true);
    var arr=new Array(a,b,c,d,e,f,g,qf,qd,et,lp,rm,oy,"#hidecredit","#hidemaps","#hideinstructions","#hidedanmu","#hideqfqd","#hidebet","#hidelog",'#autoqf','#autoqd',"#enter","#loop","#random","#onlinenotify");
    for (var i=0;i<13;i++){
        if(arr[i])
        {
            $(arr[i+13]).prop("checked",true);
        }
        else
        {
            $(arr[i+13]).prop("checked",false);
        }
    }
    hide();
}

function betMess() {
    var betcount=$('.GuessGameBox').length;
    var height,i;
    if(betcount!=lastBetCount){
        if(betcount==0)
        {
            div.style.setProperty('height', height+'px');
            div.innerHTML = (function(){/*
<section id="drag" readonly="value" style="background:white">
  <p style="font-weight: bold;height: 30px;text-align: left;margin-left: 7px;margin-right: 7px;"><a href="https://www.douyu.com/74751">超级小桀</a>房间小助手
    <span id="online"></span>
      <input type="button" id="bnt_donate" style="width: 65px;margin-top: 4px;margin-left: 27px;font-weight: bold;color:red;" value="支持一下"></p>
</section>
<section id="hide" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidecredit" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;个人信息&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hidemaps" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;地图信息&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hideinstructions" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;功能指令</p>
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidedanmu" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;弹幕发送&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hideqfqd" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;抢分签到&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hidebet" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;竞猜信息</p>
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidelog" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;日志信息&nbsp;&nbsp;&nbsp;
    <input type="button" id="bnt_hide" style="width: 65px;float:right;margin-right:1px;" value="显示"></p>
    </section>
<section id="credit" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <textarea id="showcredit" style="height:96px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
</section>
<section id="maps" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <textarea id="showmaps" style="height:112px;width: 237px;line-height:12pt;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
</section>
<section id="instructions" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <input type="button" id="bnt_fullmapsmess" style="width:75px;" value="地图详情">
  <input type="button" id="bnt_help" style="width:75px;margin-left: 5px;margin-right: 6px;" value="帮助">
  <input type="button" id="bnt_renew" style="width:75px;" value="刷新">
  <input type="button" id="bnt_getcredit" style="width:75px;" value="#抢分">
  <input type="button" id="bnt_joingroup" style="width:75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;" value="#入团">
  <input type="button" id="bnt_vip" style="width:75px;" value="#购买会员">
  <select id="betselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">#1</option>
    <option style="color:blue">#2</option></select>
  <select id="betcredit" style="height:22px;width:75px;margin-top:5px;margin-left: 5px;margin-right: 6px;background-color:hsla(0,0%,100%,.4);">
    <option>压1/5</option>
    <option>压1/4</option>
    <option>压1/3</option>
    <option>压一半</option>
    <option>全压了</option></select>
  <input type="button" id="bnt_confirm" style="height: 22px;width: 75px;color: red;" value="压分">
</section>
<section id="danmu" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="write" style="float: left;height: 47px;width: 153px;margin-right: 9px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" placeholder="请输入要发送的弹幕内容"></textarea>
  <p>
    <input class="magic-checkbox" type="checkbox" id="enter" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;Enter发送
    <input class="magic-checkbox" type="checkbox" id="loop" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;循环发送
    <input class="magic-checkbox" type="checkbox" id="random" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;随机数</p>
  <select id="danmuselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option>普通弹幕</option>
    <option>高级弹幕</option>
    <option>上电视</option></select>
  <select id="color" style="height:22px;width:75px;margin-top:5px;margin-left: 5px;margin-right: 6px;background-color:hsla(0,0%,100%,.4);" disabled="disabled">
    <option style="color:blue">蓝</option>
    <option style="color:green">绿</option>
    <option style="color:pink">粉</option>
    <option style="color:orange">橙</option>
    <option style="color:purple">紫</option>
    <option style="color:red">红</option></select>
  <input type="button" id="bnt_chatsend" style="height: 22px;width: 75px;color: black;" value="发送">
</section>
<section id="qfqd" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;display: block;">
  <p style="height: 27px;">
    <select id="formatselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
      <option>抢分/签到+小尾巴</option>
      <option>抢分/签到+小尾巴+时间</option>
      <option>抢分/签到+时间+小尾巴</option></select>
    <textarea id="tail" style="height: 16px;width: 69px;margin-left: 5px;margin-right: 6px;line-height:12pt;overflow:hidden;resize:none;vertical-align: bottom;background-color:hsla(0,0%,100%,.4);" placeholder="小尾巴"></textarea>
    <input type="button" id="bnt_tailsave" style="width:75px;margin-right: auto;" value="保存"></p>
    <p>
    <input class="magic-checkbox" type="checkbox" id="autoqf" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;自动抢分&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="autoqd" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;自动签到&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="onlinenotify" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;在播通知</p>
</section>
<section id="log" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="log" style="height:96px;width: 237px;line-height:12pt;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <input type="button" id="bnt_cleanlog" style="width: 65px;" value="清空日志">
</section>
		*/}).toString().split('/*')[1].split('*/')[0].replace(/[\n]/g, '');
            lastBetCount=betcount;
            for (i=0;i<n;i++){
                addEvent(arr[i],arr[i+n])
            }
            activate();
        }
        else if(betcount==1){
            div.style.setProperty('height', height+'px');
            div.innerHTML =(function(){/*
<section id="drag" readonly="value" style="background:white">
  <p style="font-weight: bold;height: 30px;text-align: left;margin-left: 7px;margin-right: 7px;"><a href="https://www.douyu.com/74751">超级小桀</a>房间小助手
    <span id="online"></span>
      <input type="button" id="bnt_donate" style="width: 65px;margin-top: 4px;margin-left: 27px;font-weight: bold;color:red;" value="支持一下"></p>
</section>
<section id="hide" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidecredit" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;个人信息&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hidemaps" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;地图信息&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hideinstructions" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;功能指令</p>
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidedanmu" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;弹幕发送&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hideqfqd" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;抢分签到&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hidebet" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;竞猜信息</p>
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidelog" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;日志信息&nbsp;&nbsp;&nbsp;
    <input type="button" id="bnt_hide" style="width: 65px;float:right;margin-right:1px;" value="显示"></p>
    </section>
<section id="credit" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <textarea id="showcredit" style="height:96px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
</section>
<section id="maps" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <textarea id="showmaps" style="height:112px;width: 237px;line-height:12pt;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
</section>
<section id="instructions" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <input type="button" id="bnt_fullmapsmess" style="width:75px;" value="地图详情">
  <input type="button" id="bnt_help" style="width:75px;margin-left: 5px;margin-right: 6px;" value="帮助">
  <input type="button" id="bnt_renew" style="width:75px;" value="刷新">
  <input type="button" id="bnt_getcredit" style="width:75px;" value="#抢分">
  <input type="button" id="bnt_joingroup" style="width:75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;" value="#入团">
  <input type="button" id="bnt_vip" style="width:75px;" value="#购买会员">
  <select id="betselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">#1</option>
    <option style="color:blue">#2</option></select>
  <select id="betcredit" style="height:22px;width:75px;margin-top:5px;margin-left: 5px;margin-right: 6px;background-color:hsla(0,0%,100%,.4);">
    <option>压1/5</option>
    <option>压1/4</option>
    <option>压1/3</option>
    <option>压一半</option>
    <option>全压了</option></select>
  <input type="button" id="bnt_confirm" style="height: 22px;width: 75px;color: red;" value="压分">
</section>
<section id="danmu" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="write" style="float: left;height: 47px;width: 153px;margin-right: 9px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" placeholder="请输入要发送的弹幕内容"></textarea>
  <p>
    <input class="magic-checkbox" type="checkbox" id="enter" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;Enter发送
    <input class="magic-checkbox" type="checkbox" id="loop" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;循环发送
    <input class="magic-checkbox" type="checkbox" id="random" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;随机数</p>
  <select id="danmuselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option>普通弹幕</option>
    <option>高级弹幕</option>
    <option>上电视</option></select>
  <select id="color" style="height:22px;width:75px;margin-top:5px;margin-left: 5px;margin-right: 6px;background-color:hsla(0,0%,100%,.4);" disabled="disabled">
    <option style="color:blue">蓝</option>
    <option style="color:green">绿</option>
    <option style="color:pink">粉</option>
    <option style="color:orange">橙</option>
    <option style="color:purple">紫</option>
    <option style="color:red">红</option></select>
  <input type="button" id="bnt_chatsend" style="height: 22px;width: 75px;color: black;" value="发送">
</section>
<section id="qfqd" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;display: block;">
  <p style="height: 27px;">
    <select id="formatselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
      <option>抢分/签到+小尾巴</option>
      <option>抢分/签到+小尾巴+时间</option>
      <option>抢分/签到+时间+小尾巴</option></select>
    <textarea id="tail" style="height: 16px;width: 69px;margin-left: 5px;margin-right: 6px;line-height:12pt;overflow:hidden;resize:none;vertical-align: bottom;background-color:hsla(0,0%,100%,.4);" placeholder="小尾巴"></textarea>
    <input type="button" id="bnt_tailsave" style="width:75px;margin-right: auto;" value="保存"></p>
  <p>
    <input class="magic-checkbox" type="checkbox" id="autoqf" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;自动抢分&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="autoqd" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;自动签到&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="onlinenotify" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;在播通知</p>
</section>
<section id="log" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="log" style="height:96px;width: 237px;line-height:12pt;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <input type="button" id="bnt_cleanlog" style="width: 65px;" value="清空日志">
</section>
<section id="bet" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="betmess" style="height:80px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <select id="ywselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">左边</option>
    <option style="color:blue">右边</option></select>
  <select id="ywnum" style="height:22px;width: 75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;background-color:hsla(0,0%,100%,.4);">
    <option>100</option>
    <option>1000</option>
    <option>10000</option>
    <option>ALL IN</option></select>
  <input type="button" id="bnt_ywconfirm" style="height:22px;width:75px;color:red;" value="压鱼丸">
</section>
		*/}).toString().split('/*')[1].split('*/')[0].replace(/[\n]/g, '');
            lastBetCount=betcount;
            for (i=0;i<n;i++){
                addEvent(arr[i],arr[i+n])
            }
            activate();
        }
        else if(betcount==2){
            div.style.setProperty('height', height+'px');
            div.innerHTML = (function(){/*
<section id="drag" readonly="value" style="background:white">
  <p style="font-weight: bold;height: 30px;text-align: left;margin-left: 7px;margin-right: 7px;"><a href="https://www.douyu.com/74751">超级小桀</a>房间小助手
    <span id="online"></span>
      <input type="button" id="bnt_donate" style="width: 65px;margin-top: 4px;margin-left: 27px;font-weight: bold;color:red;" value="支持一下"></p>
</section>
<section id="hide" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidecredit" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;个人信息&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hidemaps" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;地图信息&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hideinstructions" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;功能指令</p>
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidedanmu" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;弹幕发送&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hideqfqd" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;抢分签到&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hidebet" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;竞猜信息</p>
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidelog" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;日志信息&nbsp;&nbsp;&nbsp;
    <input type="button" id="bnt_hide" style="width: 65px;float:right;margin-right:1px;" value="显示"></p>
    </section>
<section id="credit" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <textarea id="showcredit" style="height:96px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
</section>
<section id="maps" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <textarea id="showmaps" style="height:112px;width: 237px;line-height:12pt;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
</section>
<section id="instructions" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <input type="button" id="bnt_fullmapsmess" style="width:75px;" value="地图详情">
  <input type="button" id="bnt_help" style="width:75px;margin-left: 5px;margin-right: 6px;" value="帮助">
  <input type="button" id="bnt_renew" style="width:75px;" value="刷新">
  <input type="button" id="bnt_getcredit" style="width:75px;" value="#抢分">
  <input type="button" id="bnt_joingroup" style="width:75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;" value="#入团">
  <input type="button" id="bnt_vip" style="width:75px;" value="#购买会员">
  <select id="betselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">#1</option>
    <option style="color:blue">#2</option></select>
  <select id="betcredit" style="height:22px;width:75px;margin-top:5px;margin-left: 5px;margin-right: 6px;background-color:hsla(0,0%,100%,.4);">
    <option>压1/5</option>
    <option>压1/4</option>
    <option>压1/3</option>
    <option>压一半</option>
    <option>全压了</option></select>
  <input type="button" id="bnt_confirm" style="height: 22px;width: 75px;color: red;" value="压分">
</section>
<section id="danmu" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="write" style="float: left;height: 47px;width: 153px;margin-right: 9px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" placeholder="请输入要发送的弹幕内容"></textarea>
  <p>
    <input class="magic-checkbox" type="checkbox" id="enter" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;Enter发送
    <input class="magic-checkbox" type="checkbox" id="loop" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;循环发送
    <input class="magic-checkbox" type="checkbox" id="random" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;随机数</p>
  <select id="danmuselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option>普通弹幕</option>
    <option>高级弹幕</option>
    <option>上电视</option></select>
  <select id="color" style="height:22px;width:75px;margin-top:5px;margin-left: 5px;margin-right: 6px;background-color:hsla(0,0%,100%,.4);" disabled="disabled">
    <option style="color:blue">蓝</option>
    <option style="color:green">绿</option>
    <option style="color:pink">粉</option>
    <option style="color:orange">橙</option>
    <option style="color:purple">紫</option>
    <option style="color:red">红</option></select>
  <input type="button" id="bnt_chatsend" style="height: 22px;width: 75px;color: black;" value="发送">
</section>
<section id="qfqd" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;display: block;">
  <p style="height: 27px;">
    <select id="formatselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
      <option>抢分/签到+小尾巴</option>
      <option>抢分/签到+小尾巴+时间</option>
      <option>抢分/签到+时间+小尾巴</option></select>
    <textarea id="tail" style="height: 16px;width: 69px;margin-left: 5px;margin-right: 6px;line-height:12pt;overflow:hidden;resize:none;vertical-align: bottom;background-color:hsla(0,0%,100%,.4);" placeholder="小尾巴"></textarea>
    <input type="button" id="bnt_tailsave" style="width:75px;margin-right: auto;" value="保存"></p>
  <p>
    <input class="magic-checkbox" type="checkbox" id="autoqf" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;自动抢分&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="autoqd" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;自动签到&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="onlinenotify" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;在播通知</p>
</section>
<section id="log" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="log" style="height:96px;width: 237px;line-height:12pt;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <input type="button" id="bnt_cleanlog" style="width: 65px;" value="清空日志">
</section>
<section id="bet" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="betmess" style="height:80px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <select id="ywselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">左边</option>
    <option style="color:blue">右边</option></select>
  <select id="ywnum" style="height:22px;width: 75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;background-color:hsla(0,0%,100%,.4);">
    <option>100</option>
    <option>1000</option>
    <option>10000</option>
    <option>ALL IN</option></select>
  <input type="button" id="bnt_ywconfirm" style="height:22px;width:75px;color:red;" value="压鱼丸">
    <textarea id="betmess1" style="height:80px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <select id="ywselect1" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">左边</option>
    <option style="color:blue">右边</option></select>
  <select id="ywnum1" style="height:22px;width: 75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;background-color:hsla(0,0%,100%,.4);">
    <option>100</option>
    <option>1000</option>
    <option>10000</option>
    <option>ALL IN</option></select>
  <input type="button" id="bnt_ywconfirm1" style="height:22px;width:75px;color:red;" value="压鱼丸">
</section>
		*/}).toString().split('/*')[1].split('*/')[0].replace(/[\n]/g, '');
            lastBetCount=betcount;
            for (i=0;i<n;i++){
                addEvent(arr[i],arr[i+n])
            }
            activate();
        }
        else if(betcount==3){
            div.style.setProperty('height', height+'px');
            div.innerHTML = (function(){/*
<section id="drag" readonly="value" style="background:white">
  <p style="font-weight: bold;height: 30px;text-align: left;margin-left: 7px;margin-right: 7px;"><a href="https://www.douyu.com/74751">超级小桀</a>房间小助手
    <span id="online"></span>
      <input type="button" id="bnt_donate" style="width: 65px;margin-top: 4px;margin-left: 27px;font-weight: bold;color:red;" value="支持一下"></p>
</section>
<section id="hide" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidecredit" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;个人信息&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hidemaps" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;地图信息&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hideinstructions" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;功能指令</p>
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidedanmu" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;弹幕发送&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hideqfqd" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;抢分签到&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="hidebet" style="height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;竞猜信息</p>
  <p style="height: 22px;">
    <input class="magic-checkbox" type="checkbox" id="hidelog" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;日志信息&nbsp;&nbsp;&nbsp;
    <input type="button" id="bnt_hide" style="width: 65px;float:right;margin-right:1px;" value="显示"></p>
    </section>
<section id="credit" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <textarea id="showcredit" style="height:96px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
</section>
<section id="maps" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <textarea id="showmaps" style="height:112px;width: 237px;line-height:12pt;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
</section>
<section id="instructions" style="margin-top: 3px;margin-left: 7px;margin-right: 7px;">
  <input type="button" id="bnt_fullmapsmess" style="width:75px;" value="地图详情">
  <input type="button" id="bnt_help" style="width:75px;margin-left: 5px;margin-right: 6px;" value="帮助">
  <input type="button" id="bnt_renew" style="width:75px;" value="刷新">
  <input type="button" id="bnt_getcredit" style="width:75px;" value="#抢分">
  <input type="button" id="bnt_joingroup" style="width:75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;" value="#入团">
  <input type="button" id="bnt_vip" style="width:75px;" value="#购买会员">
  <select id="betselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">#1</option>
    <option style="color:blue">#2</option></select>
  <select id="betcredit" style="height:22px;width:75px;margin-top:5px;margin-left: 5px;margin-right: 6px;background-color:hsla(0,0%,100%,.4);">
    <option>压1/5</option>
    <option>压1/4</option>
    <option>压1/3</option>
    <option>压一半</option>
    <option>全压了</option></select>
  <input type="button" id="bnt_confirm" style="height: 22px;width: 75px;color: red;" value="压分">
</section>
<section id="danmu" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="write" style="float: left;height: 47px;width: 153px;margin-right: 9px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" placeholder="请输入要发送的弹幕内容"></textarea>
  <p>
    <input class="magic-checkbox" type="checkbox" id="enter" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;Enter发送
    <input class="magic-checkbox" type="checkbox" id="loop" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;循环发送
    <input class="magic-checkbox" type="checkbox" id="random" style="height:17px;width:17px;vertical-align: bottom;">&nbsp;随机数</p>
  <select id="danmuselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option>普通弹幕</option>
    <option>高级弹幕</option>
    <option>上电视</option></select>
  <select id="color" style="height:22px;width:75px;margin-top:5px;margin-left: 5px;margin-right: 6px;background-color:hsla(0,0%,100%,.4);" disabled="disabled">
    <option style="color:blue">蓝</option>
    <option style="color:green">绿</option>
    <option style="color:pink">粉</option>
    <option style="color:orange">橙</option>
    <option style="color:purple">紫</option>
    <option style="color:red">红</option></select>
  <input type="button" id="bnt_chatsend" style="height: 22px;width: 75px;color: black;" value="发送">
</section>
<section id="qfqd" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;display: block;">
  <p style="height: 27px;">
    <select id="formatselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
      <option>抢分/签到+小尾巴</option>
      <option>抢分/签到+小尾巴+时间</option>
      <option>抢分/签到+时间+小尾巴</option></select>
    <textarea id="tail" style="height: 16px;width: 69px;margin-left: 5px;margin-right: 6px;line-height:12pt;overflow:hidden;resize:none;vertical-align: bottom;background-color:hsla(0,0%,100%,.4);" placeholder="小尾巴"></textarea>
    <input type="button" id="bnt_tailsave" style="width:75px;margin-right: auto;" value="保存"></p>
  <p>
    <input class="magic-checkbox" type="checkbox" id="autoqf" style="height:17px;width:17px;vertical-align: middle;" checked="checked">&nbsp;自动抢分&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="autoqd" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;自动签到&nbsp;&nbsp;&nbsp;&nbsp;
    <input class="magic-checkbox" type="checkbox" id="onlinenotify" style="margin-left: 7xp;height:17px;width:17px;vertical-align: text-top;" checked="checked">&nbsp;在播通知</p>
</section>
<section id="log" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="log" style="height:96px;width: 237px;line-height:12pt;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <input type="button" id="bnt_cleanlog" style="width: 65px;" value="清空日志">
</section>
<section id="bet" style="margin-top: 5px;margin-left: 7px;margin-right: 7px;">
  <textarea id="betmess" style="height:80px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <select id="ywselect" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">左边</option>
    <option style="color:blue">右边</option></select>
  <select id="ywnum" style="height:22px;width: 75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;background-color:hsla(0,0%,100%,.4);">
    <option>100</option>
    <option>1000</option>
    <option>10000</option>
    <option>ALL IN</option></select>
  <input type="button" id="bnt_ywconfirm" style="height:22px;width:75px;color:red;" value="压鱼丸">
    <textarea id="betmess1" style="height:80px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <select id="ywselect1" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">左边</option>
    <option style="color:blue">右边</option></select>
  <select id="ywnum1" style="height:22px;width: 75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;background-color:hsla(0,0%,100%,.4);">
    <option>100</option>
    <option>1000</option>
    <option>10000</option>
    <option>ALL IN</option></select>
  <input type="button" id="bnt_ywconfirm1" style="height:22px;width:75px;color:red;" value="压鱼丸">
      <textarea id="betmess2" style="height:80px;width: 237px;line-height:12pt;overflow:hidden;resize:none;background-color:hsla(0,0%,100%,.4);" readonly="value"></textarea>
  <select id="ywselect2" style="height:22px;width:75px;background-color:hsla(0,0%,100%,.4);">
    <option style="color:red">左边</option>
    <option style="color:blue">右边</option></select>
  <select id="ywnum2" style="height:22px;width: 75px;margin-left: 5px;margin-right: 6px;margin-top: 5px;background-color:hsla(0,0%,100%,.4);">
    <option>100</option>
    <option>1000</option>
    <option>10000</option>
    <option>ALL IN</option></select>
  <input type="button" id="bnt_ywconfirm2" style="height:22px;width:75px;color:red;" value="压鱼丸">
</section>
		*/}).toString().split('/*')[1].split('*/')[0].replace(/[\n]/g, '');
            lastBetCount=betcount;
            for (i=0;i<n;i++){
                addEvent(arr[i],arr[i+n])
            }
            activate();
        }
        recoverStatus();
    }
    switch(betcount){
        case 3:
            $("#betmess2").val("竞猜信息:     "+$('span.GuessMainPanelBoxRight-rightBar:eq(2)').text()+"\n" + $('div.boxLeft:eq(2)').text() + "\n左边:" + $('p.GuessContItem-itemTitle:eq(4)').text() + "   "  + $('p.GuessContItem-itemLoss:eq(4)').text() + "\n右边:" + $('p.GuessContItem-itemTitle:eq(5)').text() +  "   "  + $('p.GuessContItem-itemLoss:eq(5)').text() +  "\n"   +  $('.bidNumLeft:eq(2)').text()  + " VS " + $('.bidNumRight:eq(2)').text());
        case 2:
            $("#betmess1").val("竞猜信息:     "+$('span.GuessMainPanelBoxRight-rightBar:eq(1)').text()+"\n" + $('div.boxLeft:eq(1)').text()  + "\n左边:" + $('p.GuessContItem-itemTitle:eq(2)').text() + "   "  + $('p.GuessContItem-itemLoss:eq(2)').text() + "\n右边:" + $('p.GuessContItem-itemTitle:eq(3)').text() +  "   "  + $('p.GuessContItem-itemLoss:eq(3)').text() +  "\n" +  $('.bidNumLeft:eq(1)').text()  + " VS " + $('.bidNumRight:eq(1)').text());
        case 1:
            $("#betmess").val("竞猜信息:     "+$('span.GuessMainPanelBoxRight-rightBar:eq(0)').text()+"\n" + $('div.boxLeft:eq(0)').text()  + "\n左边:" + $('p.GuessContItem-itemTitle:eq(0)').text() + "   "  + $('p.GuessContItem-itemLoss:eq(0)').text() + "\n右边:" + $('p.GuessContItem-itemTitle:eq(1)').text() +  "   "  + $('p.GuessContItem-itemLoss:eq(1)').text() +  "\n"  +  $('.bidNumLeft:eq(0)').text()  + " VS " + $('.bidNumRight:eq(0)').text());break;
    }
}

function tail(){
    var tailText = $('#tail').val();
    var formatselect = $("#formatselect").find("option:selected").text();
    getNow();
    if(formatselect=='抢分/签到+小尾巴'){
        fullTailText=tailText;
        tailFlag=1;
    }
    else if (formatselect=='抢分/签到+小尾巴+时间'){
        if (tailText.length==0){
            fullTailText=nowHMS;
        }
        else {
            fullTailText=tailText+" "+nowHMS;
        }
        tailFlag=2;
    }
    else {
        if (tailText.length==0){
            fullTailText=nowHMS;
        }
        else{
            fullTailText=nowHMS+" "+tailText;
        }
        tailFlag=3;
    }
    GM_setValue('tailText',tailText);
    GM_setValue('tailFlag',tailFlag);
    $('#tail').val('');
    alert("保存成功,当前格式为:#抢分/签到 "+fullTailText);
}

function fullTail(danmu){
    var tailText = GM_getValue('tailText','');
    getNow();
    if (tailText.length==0){
        if(GM_getValue('tailFlag',tailFlag)==1){
            return (danmu);
        }
        else {
            return(danmu+" "+nowHMS);
        }
    }
    else{
        if(GM_getValue('tailFlag',tailFlag)==1){
            return (danmu+" "+tailText);
        }
        else if (GM_getValue('tailFlag',tailFlag)==2){
            return(danmu+" "+tailText+" "+nowHMS);
        }
        else {
            return(danmu+" "+nowHMS+" "+tailText);
        }
    }
}

function activate(){
    var betcount=$('.GuessGameBox').length;
    var dragDiv=document.getElementById("drag");
    dragDiv.addEventListener("mouseover", over,false);
    dragDiv.addEventListener('mousedown', down, false);
    dragDiv.addEventListener('mousemove', move, false);
    dragDiv.addEventListener('mouseup', up, false);
    dragDiv.addEventListener("mouseout", out,false);
    document.getElementById('bnt_donate').addEventListener('click', function (event) { donate(); }, false);
    document.getElementById('bnt_fullmapsmess').addEventListener('click', function (event) { fullMapsMess(); }, false);
    document.getElementById('bnt_renew').addEventListener('click', function (event) { renew(); }, false);
    document.getElementById('bnt_confirm').addEventListener('click', function (event) { betCredit(); }, false);
    document.getElementById('bnt_help').addEventListener('click', function (event) { help(); }, false);
    document.getElementById('betselect').addEventListener('click', function (event) { select(); }, false);
    document.getElementById('bnt_chatsend').addEventListener('click', function (event) { chatSend(); }, false);
    document.getElementById('color').addEventListener('click', function (event) { sendColor(); }, false);
    document.getElementById('danmuselect').addEventListener('click', function (event) { danmuSelect(); }, false);
    document.getElementById('bnt_hide').addEventListener('click', function (event) { hide(); }, false);
    document.getElementById('bnt_tailsave').addEventListener('click', function (event) { tail(); }, false);
    document.getElementById('bnt_cleanlog').addEventListener('click', function (event) { cleanLog(); }, false);
    switch(betcount){
        case 3:
            document.getElementById('ywselect2').addEventListener('click', function (event) { ywSelect('ywselect2','bnt_ywconfirm2'); }, false);
            document.getElementById('bnt_ywconfirm2').addEventListener('click', function (event) { betYw('ywselect2','ywnum2','bnt_ywconfirm2'); }, false);
        case 2:
            document.getElementById('ywselect1').addEventListener('click', function (event) { ywSelect('ywselect1','bnt_ywconfirm1'); }, false);
            document.getElementById('bnt_ywconfirm1').addEventListener('click', function (event) { betYw('ywselect1','ywnum1','bnt_ywconfirm1'); }, false);
        case 1:
            document.getElementById('ywselect').addEventListener('click', function (event) { ywSelect('ywselect','bnt_ywconfirm'); }, false);
            document.getElementById('bnt_ywconfirm').addEventListener('click', function (event) { betYw('ywselect','ywnum','bnt_ywconfirm'); }, false);
    }
}

function over(e) {
    div.style.cursor="move"
}

function out(e) {
    div.style.cursor="auto"
}

function down(e) {
    e = e || window.event;
    x = e.clientX - div.offsetLeft;
    y = e.clientY - div.offsetTop;
    dragFlag = true;
}

function move(e) {
    if (dragFlag) {
        div.style.cursor="move"
        e = e || window.event;
        div.style.left = e.clientX - x + 'px';
        div.style.top = e.clientY - y + 'px';
    }
}

function up(e) {
    if (dragFlag) {
        GM_setValue('left',div.style.left);
        GM_setValue('top',div.style.top);
    }
    dragFlag = false;
    div.style.cursor="auto"
}

function sighIn(){
    getNow();
    if(m==0||m==30){
        if (sighInFlag) {
            danmu(fullTail("#签到"));
            sighInFlag = false
        }
    }
    else {
        sighInFlag = true;
    }
}

function giftCheck(){
    if (giftStatusCheck!=0&&giftOpen==0&&$('span.TreasureNum-val').length==0){
        lastGiftNum=1;
        giftFlag = false;
        var i=0;
        danmu(fullTail("#抢分"));
        qf=setInterval(function(){
            danmu(fullTail("#抢分"));
            i++;
            if(i>5){
                clearInterval(qf);
                qf=null;
            }
        },1200);
    }
}

function exGiftCheck(){
    if ($('span.TreasureNum-val').length!=0){
        giftNum=$('span.TreasureNum-val').text();
        if (giftNum>lastGiftNum){
            lastGiftNum=giftNum;
            giftFlag = false;
            clearInterval(qf);
            qf=null;
            clearInterval(exqf);
            exqf=null;
            var i=0;
            danmu(fullTail("#抢分"));
            exqf=setInterval(function(){
                danmu(fullTail("#抢分"));
                i++;
                if(i>5){
                    clearInterval(exqf);
                    exqf=null;
                }
            },1200);
        }
        else{
            lastGiftNum=giftNum;
        }
    }
    else{
        lastGiftNum=1;
    }
}

function compareCredit(str){
    myCredit=GM_getValue('myCredit',-1);
    if(myCredit!=lastCredit){
        var diffCredit=lastCredit-myCredit;
        diffCredit>0 ? diffCredit="+"+diffCredit :diffCredit;
        getNow()
        lastCredit=GM_getValue('lastCredit', 0);
        GM_setValue('myCredit', lastCredit);
        log="今天相对上次使用本插件时("+str+")"+diffCredit+"积分 当前积分为:"+lastCredit+"\n"+nowYMD+"\n\n"+log;
    }
    else{
        if(myCredit==-1){
            log="初次使用,对比记录分析将在次日生成,数据初始化...\n"+nowYMD;
            lastCredit=0;
            creditMess();
            setTimeout(function(){
                GM_setValue('myCredit', lastCredit);
            }, 10000);
        }
        else{
            log="今天相对上次使用本插件时("+str+")"+"积分无变化,当前积分为:"+lastCredit+"\n"+nowYMD+"\n\n"+log;
        }
    }
}

function danmu(str){
    if($('div.ChatSend-button').text()=='发送'||$('div.ChatSend-button').text()=='开火'){
        if(document.getElementById("random").checked){
            str = (str == lastText ?str + " " + Math.ceil(Math.random()*5):str);
        }
        $(".ChatSend-txt").val(str);
        $('div.ChatSend-button').click();
        lastText = str;
        getNow();
        log=nowHMS+" 发送:"+lastText+"\n"+log;
    }
}

function loopDanmu(){
    text = GM_getValue('loopText',"小助手NB");
    danmu(text);
}

function getCookie(cname){
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for(var i=0; i<ca.length; i++){
        var c = ca[i].trim();
        if (c.indexOf(name)==0) return c.substring(name.length,c.length);
    }
    return "";
}