// ==UserScript== // @author DreamChaser // @description 快速下注、自动签到、自动抢分、查看积分详情、查看地图详情、查看竞猜信息、快速压鱼丸、快速发弹幕、去广告、极简模式、挂机模式、自动领观看鱼丸、自动领观看鱼丸。 // @icon https://apic.douyucdn.cn/upload/avatar/002/86/30/15_avatar_big.jpg // @name 超级小桀房间小助手 // @version 1.5.7 // @match https://www.douyu.com/* // @grant GM_xmlhttpRequest // @grant GM_setValue // @grant GM_getValue // @grant GM_notification // @namespace https://greasyfork.org/zh-CN/users/285196-dreamchaser // @require https://code.jquery.com/jquery-2.1.4.min.js // @connect xiaojie666.com // @connect open.douyucdn.cn // @downloadURL none // ==/UserScript== var $ = window.jQuery; var x,y; var dragFlag = false,sighInFlag = true,giftFlag=true,activateFlag=false,loopFlag=false,closeFlag=false; var lastText = "",loopText="",text="",lastLog=""; var nickname = decodeURI(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 lastGiftNum=0,giftNum=0,lastBetCount=-1,betSelect,ywSelected,color,giftStatusCheck,giftOpen,qf,exqf,creditQf,chatSendClick; var mapsJSON,creditJSON,onlineJSON; var fullTailText=GM_getValue('fullTailText', ''),tailFlag=1; var lastCredit=GM_getValue('lastCredit',-1),lastMaxCredit=GM_getValue('lastMaxCredit',-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 loopInterval,intervalTime=3000; var pathName=window.location.pathname; var height; var div = document.createElement('div'); var dragDiv=document.getElementById("drag"); div.setAttribute('id', 'newDiv'); div.style.setProperty('position', 'fixed'); div.style.setProperty('height', height+'px'); div.style.setProperty('width', '258px'); div.style.setProperty('background', 'rgba(222, 222, 222, 0.8)'); div.style.setProperty('left', '3%'); 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'); div.innerHTML = (function(){/* 超级小桀房间小助手 个人信息 地图信息 功能指令 弹幕发送 抢分签到 竞猜信息 日志信息 完整模式 极简模式 挂机模式 #1 #2 压1/5 压1/4 压1/3 压一半 全压了 Enter发送 循环发送 随机数 普通弹幕 高级弹幕 上电视 蓝 绿 粉 橙 紫 红 抢分/签到+小尾巴 抢分/签到+小尾巴+时间 抢分/签到+时间+小尾巴 自动抢分 自动签到 在播通知 左边 右边 100 1000 10000 ALL IN 左边 右边 100 1000 10000 ALL IN 左边 右边 100 1000 10000 ALL IN */}).toString().split('/*')[1].split('*/')[0].replace(/[\n]/g, ''); document.body.appendChild(div); div.style.left = GM_getValue('left','3%'); 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","#抢分","#入团","#购买会员"); for (var i=0;i<3;i++){ addEvent(arr[i],arr[i+3]) } var creditRankJSON,myCreditRank="",myMaxCreditRank=""; creditRank("credit","myCreditRank",lastCredit); creditRank("maxCredit","myMaxCreditRank",lastMaxCredit); var lastWatch=GM_getValue('lastWatch', '完整模式'); if (lastWatch=="极简模式"){ $("#watchstyle").val("极简模式"); } else if (lastWatch=="挂机模式"){ $("#watchstyle").val("挂机模式"); } watchStyle(); $(document).ready(function (){ recoverStatus(); activate(); creditMess(); mapsMess(); betMess(); online(); notify(); var clearAD = setInterval(function(){ removeAD(); },1000); setTimeout(function(){ clearInterval(clearAD); },10000); var Reward = setInterval(function (){ if($('span.RewardModule-notify').length!=0){ getReward(); } if($('RewardModule-iconnew.done').length!=0){ clearInterval(Reward); } },60000); creditQf = setInterval(function (){ creditMess(); },30000); setInterval(function(){ mapsMess(); logMess(); online(); if(document.getElementById("autoqd").checked) { sighIn(); } },5000); loopInterval=setInterval(loopDanmu,3000); setInterval(function(){ if (pathName=="/74751"){ 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 removeAD(){ $("div.Bottom-ad").hide(); $("div.SignBaseComponent-sign-ad").remove(); $("div.SignBaseComponent-sign-box.RoomChat.Barrage-chat-ad").remove(); $("div.SysSign-Ad").remove(); $("div.GuessGameAdContainer").remove(); $("div.PlayerToolbar-signCont").remove(); $("div[class*='recommendAD']").remove(); $("div[class*='recommendApp']").remove(); $("div.YzMakeFriends.is-active").remove(); } function watchStyle(){ var watch=$("#watchstyle").find("option:selected").text(); if(watch=='完整模式'){ $("aside#js-aside.layout-Aside").show(); $("div#js-bottom.layout-Bottom").show(); $("div#js-player-title.layout-Player-title").show(); $("header#js-header.layout-Header").show(); $("main.layout-Main").removeAttr("style"); $("section.layout-Container").removeAttr("style"); $("div#js-background-holder.Background-holder").show(); $("div.layout-Main").removeAttr("style"); $("div#js-ad-map.layout-Bottom-forDiy").show(); $("div#js-room-activity").show(); $("div[class*='wfs-']").click(); $("div[class*='wfs-exit-']").click(); } else if(watch=='极简模式'){ $("aside#js-aside.layout-Aside").hide(); $("div#js-bottom.layout-Bottom").hide(); $("div#js-player-title.layout-Player-title").hide(); $("header#js-header.layout-Header").hide(); $("main.layout-Main").css("cssText","max-width:100%;width:100%;margin:0px;padding:0px;"); $("section.layout-Container").css("padding","0px"); $("div#js-background-holder.Background-holder").hide(); $("div.layout-Main").css("cssText","max-width:100%!important;width:100%!important;"); $("div#js-ad-map.layout-Bottom-forDiy").hide(); $("div#js-room-activity").hide(); $("div[class*='bc-wrapper']").hide(); $('div.layout-Main').parent("div[class*='bc-wrapper']").attr('style','display:block;'); $('section.layout-Container').attr('style','padding-top:0px;background:none;'); $("div[class*='wfs-']").click(); $("div[class*='wfs-exit-']").click(); } else{ var count=1; var srcRemove=setInterval(function(){ if($("video[id*='__video']").length!=0){ setTimeout(function(){ $("video[id*='__video']").attr("src", ""); $("div.layout-Player-videoMain").remove(); },1000) console.log("blocked live stream") clearInterval(srcRemove); } if(count>30){ clearInterval(srcRemove); } count++; },500); $("div.layout-Player-videoMain").hide(); $("aside#js-aside.layout-Aside").hide(); $("div#js-bottom.layout-Bottom").hide(); $("div#js-player-title.layout-Player-title").hide(); $("header#js-header.layout-Header").hide(); $("div#js-player-guessgame.layout-Player-guessgame").hide(); $("div#js-player-toolbar.layout-Player-toolbar").hide(); $("main.layout-Main").css("cssText","max-width:100%;width:100%;margin:0px;padding:0px;"); $("section.layout-Container").css("padding","0px"); $("div#js-background-holder.Background-holder").hide(); $("div.layout-Main").css("cssText","max-width:100%!important;width:100%!important;"); $("div#js-room-activity").hide(); $("div#js-ad-map.layout-Bottom-forDiy").hide(); $("div[class*='bc-wrapper']").hide(); $('div.layout-Main').parent("div[class*='bc-wrapper']").attr('style','display:block;'); $('section.layout-Container').attr('style','padding-top:0px;background:none;'); } if (watch!=lastWatch){ if(lastWatch=="挂机模式"){ window.location.reload(); } lastWatch=watch; GM_setValue('lastWatch', lastWatch); }; } 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++){ if (pathName=="/74751"){ 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(); } } if(betcount!=0 || !f){ trueheight += 5; } $("#newDiv").css("height",trueheight); } function addEvent(id,str) { document.getElementById(id).addEventListener('click', function (event) { danmu(str); }, false); } function renew() { creditMess(); mapsMess(); betMess(); online(); } function getReward() { $('div.RewardModule-toggle').click(); $('div.RewardModal.super').hide(); var n=('span.RewardM-text.enable').length for(var i=0;i30){ clearInterval(close); close=null; closeFlag=false; } },1000); count++; } } 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 + " 排名:" + myMaxCreditRank + "\n当前积分:" + creditJSON.credit + " 排名:" + myCreditRank + "\n会员到期时间:"+ showvipdate); if(lastMaxCredit < creditJSON.maxCredit){ myMaxCreditRank=creditRank("maxCredit","myMaxCreditRank",creditJSON.maxCredit); GM_setValue('lastMaxCredit', creditJSON.maxCredit); lastMaxCredit=GM_getValue('lastMaxCredit', 0); } if(lastCredit!=creditJSON.credit && giftStatusCheck == 0){ myCreditRank=creditRank("credit","myCreditRank",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 creditRank(myCreditClass,myRankClass,myCredit) { var i; GM_xmlhttpRequest({ method: "GET", url: "http://api.xiaojie666.com/xiaojie/credit/rank.do?order="+myCreditClass, onload:function(response) { creditRankJSON = JSON.parse(response.responseText); var length=creditRankJSON.length; if(myRankClass=="myCreditRank"){ console.log("当前积分排名中") if(myCredit>=creditRankJSON[length-1].credit){ for(i=0;i=creditRankJSON[length-1].maxCredit){ console.log((i+1)+":"+creditRankJSON[i].nickName) for(i=0;i5){ clearInterval(qf); qf=null; } },1500); } } 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; } },1500); } 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); console.log("今天相对上次使用本插件时("+str+")"+diffCredit+"积分 当前积分为:"+lastCredit+"\n"+nowYMD+"\n"); 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{ console.log("今天相对上次使用本插件时("+str+")积分无变化,当前积分为:"+lastCredit+"\n"+nowYMD+"\n"); log="今天相对上次使用本插件时("+str+")积分无变化,当前积分为:"+lastCredit+"\n"+nowYMD+"\n\n"+log; } } } function danmu(str){ if($('.ChatSend-button.is-gray').length!=0){ var reconnectFlag=true; var n=$('.Barrage-text.Barrage-notice--red').length-1 if($("a.js-danmu-reconnect.Barrage-notice--red").eq(n).text()=="点击重新连接弹幕"){ $('a.js-danmu-reconnect.Barrage-notice--red').eq(n)[0].click(); } } if($('div.ChatSend-button').text()=='发送'||$('div.ChatSend-button').text()=='开火'){ if(document.getElementById("random").checked){ str = (str == lastText ?str + " " + (Math.ceil(Math.random()*10)-1):str); } $(".ChatSend-txt").val(str); if(reconnectFlag){ chatSendClick=setInterval(function(){ $('div.ChatSend-button').click(); if($('.ChatSend-txt').text().length==0){ clearInterval(chatSendClick); } },3000); } else{ $('div.ChatSend-button').click(); } lastText = str; getNow(); log=nowHMS+" 发送:"+lastText+"\n"+log; console.log(nowHMS+" 发送:"+lastText+"\n"); } } function loopDanmu(){ if(document.getElementById("loop").checked&&loopFlag){ clearInterval(loopInterval); loopInterval=null; intervalTime=Math.ceil(Math.random()*10); intervalTime=intervalTime >= 5 ? (intervalTime-5)*1000 : intervalTime*1000; console.log("下次发送间隔:"+(intervalTime+3000)/1000 + "秒"); log=("下次发送间隔:"+(intervalTime+3000)/1000) + "秒\n"+log; setTimeout(function (){ text = GM_getValue('loopText',"小助手NB"); danmu(text); loopInterval=setInterval(loopDanmu,3000); },intervalTime); } else{ loopFlag=false; } } function getCookie(cname){ var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i
超级小桀房间小助手
个人信息 地图信息 功能指令
弹幕发送 抢分签到 竞猜信息
日志信息 完整模式 极简模式 挂机模式
Enter发送 循环发送 随机数
抢分/签到+小尾巴 抢分/签到+小尾巴+时间 抢分/签到+时间+小尾巴
自动抢分 自动签到 在播通知