-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb2b.user.js
48 lines (47 loc) · 5.25 KB
/
bb2b.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// ==UserScript==
// @name BB2B
// @version Pre-alpha2
// @description bilibili赛事竞猜辅助插件
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAACHNJREFUWAntWEtvU0cUPn4ljp3YTuLIwXk0Cogk1BIJm/Ioyy6qdtMuskFdICF2VSsh8SMqVSpih5BYVGyyaDetumBJIVuQUoiAJiEmJQ9I7Dh++9r9vmPPzbUTHqGqxIJRbubemTPnfHOeMxb50P6bBlzvuvzmzZvduVzui1qt9hl4DOOJ4z1Ofi6X6x90fJbxfisQCPx+7ty5Lc4dtB0Y4LVr174CkG8h6Cwe71sKrIDuNsBevXjx4q9vuUbJ3hrg9evXz1Sr1R8A7vRBBLTSAuRdt9t9+cKFC3da5/b7fiPAmZkZTyqV+hHAvtuPwbuOAeiVSCRyaXp62nodj9cCvHHjRqRcLs8AHP1sT+vp6ZkfGBhY7ezsDHs8nggI+lzikprIRq1WTe3s7KSTyWT/5ubm+J7FGKB/+ny+6fPnz6f2m+fYKwE2wN0FuInWxcPDw7N4Ypgb9fv9EggGxefxisfrEaIrW2WplCqSzWWlWCyK1+tdePr06RqeU628APIhQJ5+Fch9ATbM+ker5oLBYPL48eNpCEx0d3dLV1eXtLW1qUwIapKNtcKHAOEiktnOiFW15u7fvx/OZrNDTmJqEub+fD9zu52E5r3hc01m7evruzc1NRWMdHcnBgcHJRqN2uC4Do5Pk+nDdzZ+U8P9/f0SH4hzQ4nJyakgeSlB4x8VQZnOMfPevG2MMloty/rTELDv7e29l0gkPsYufaFwWNwNIAQAJaHVFIy+cQB/1VqVn9rAT7VJjW5vbwt8s/zgw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ilibili.com/v/game/match/*
// @run-at document-end
// ==/UserScript==
(function(){
'use strict';
console.log('网页加载中..');
})();
window.onload = function(){
setTimeout(function(){
if (location.href == 'https://www.bilibili.com/v/game/match/competition'){
document.getElementsByClassName('time-contain')[0].style.cssText = 'background-color:white'
var sshi = $(".competition-list")[0].children;
var sshititle = $(".part-title")
for (var i = 0; i < sshi.length; i++) {
sshi[i].style.backgroundColor = '#fff'; // 修复bilibili Evolved和其他类似插件的夜间模式对竞猜页面不适配的问题
sshititle[i].children[0].style.cssText = 'color: black !important;';
for (var n=0;n<2;n++) {
sshi[i].getElementsByClassName("competition-option")[n].addEventListener("click",function(){
var dom = this.getElementsByClassName('competition-option-input-group')[0].children[0]
var evt = new InputEvent('input', {
inputType: 'insertText',
data: '10',
dataTransfer: null,
isComposing: false
});// 模拟输入
dom.value = '10';
dom.dispatchEvent(evt);
this.getElementsByClassName('checkbox-bwxr')[0].classList.remove('active')
})
}
// 默认下注10个币
team1 = sshi[i].getElementsByClassName('how-pay')[0].innerText.substring(5,9)
team2 = sshi[i].getElementsByClassName('how-pay')[1].innerText.substring(5,9)
if (Math.abs(team1-team2)>=0.5){
if (team1>team2){winner=1} else {winner=0}
sshi[i].getElementsByClassName('competition-option-content')[winner].style.cssText= 'border: 1px solid #fb72994d;border-left-width: 4px;background: #fb729933;'
}
else{}
}
}
},2000);
}