定时轮询开箱
// ==UserScript==
// @name 虎牙自动领宝箱
// @namespace https://greasyfork.org/
// @version 2.1
// @description 定时轮询开箱
// @author Cosil
// @include *www.huya.com/*
// ==/UserScript==
$(function() {
var t2 = setInterval(function(){
//console.log("t2 is live");
var box = $(".player-box-stat3");
if($(box[5]).parent().children("p")[3].innerHTML == ""){
box.each(function(){
if(this.style.visibility=="visible"){
this.click();
$("#player-box")[0].style.display="none";
}
});
}else{
clearInterval(t2);
console.log("宝箱已领取完毕");
}
}, 10000);
})