Skip to content

Instantly share code, notes, and snippets.

@g8up
Last active March 8, 2020 10:13
Show Gist options
  • Save g8up/2381b7fa69dea8264b4b to your computer and use it in GitHub Desktop.
Save g8up/2381b7fa69dea8264b4b to your computer and use it in GitHub Desktop.
自动点击领取宝箱鱼丸
javascript: void((function() {
/**
* @file 自动点击领取宝箱 v1.5
* @author 死宅程序猿
* @douyu http://douyu.com/duxing
* @remark 苟富贵,勿相忘~
* @desc 在宝箱倒计时剩余1秒时自动点击,每秒点击1000次。 需要[制作成 Chrome 书签](http://pan.baidu.com/s/1skgEosX)。
*/
var peck = document.querySelector('.peck-cdn');
if (!peck) {
log('未找到宝箱');
return;
};
var clickLock = false;
peck.removeEventListener('DOMSubtreeModified');
peck.addEventListener('DOMSubtreeModified', function(e) {
if (clickLock) return;
if (e.srcElement.innerText === '00:00' || e.srcElement.innerText === '领取') {
clickLock = true;
peck.click();
var t = setInterval(function() {
peck.click();
}, 1);
log('正在点击...');
setTimeout(function() {
clearInterval(t);
clickLock = false;
var tip = document.querySelector('.peck-back-tip');
if (tip && tip.length) {
log(tip.innerText);
}
log('解除点击...');
}, 2e3);
}
});
log('launch...');
function log() {
console.log.apply(console, ['%c斗鱼鱼叉', 'background: #ff872e;color:#fff', '自动点击领取宝箱'].concat([].slice.call(arguments)));
}
})());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment