2 Star 2 Fork 6

xyf007/namerena_scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_all.html 2.00 KB
一键复制 编辑 原始数据 按行查看 历史
xyf007 提交于 2020-10-27 16:27 . fix the wrong output.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>&#x5355;&#x4EBA;&#x666E;&#x8BC4;+&#x666E;&#x5355;+&#x5F3A;&#x8BC4;+&#x5F3A;&#x5355;</title>
</head>
<body>
<pre>
const stk = document.querySelector('#textdiv>textarea').value.split('\n');
let is = 0;
let nowType = 4;
let res = '&#x4F7F;&#x7528;&#x5B8C;&#x4E86;&#x8BB0;&#x5F97;&#x5237;&#x65B0;';
const testType = ['!test!\n\n', '!test!\n!\n\n'];
let s = '';
stk.reverse();
/**
* Get the scores of a name.
*/
function chk() {
if (is === 0) {
if (nowType === 4) {
console.log(res);
nowType = 1;
if (stk.length !== 0) {
s = stk[stk.length - 1];
while (s === '') {
stk.pop();
s = stk[stk.length - 1];
}
res = `| ${s} | `;
document.querySelector('#textdiv>textarea').value = testType[parseInt(
nowType / 2)] + s;
document.querySelector('.goBtn').click();
is = 1;
stk.pop();
} else {
alert('&#x6D4B;&#x8BD5;&#x5DF2;&#x5B8C;&#x6210;');
clearInterval(si);
}
} else {
if (nowType % 2 === 1) {
document.querySelector('#textdiv>textarea').value =
`${testType[parseInt(nowType / 2)]}${s}\n${s}`;
} else {
document.querySelector('#textdiv>textarea').value =
`${testType[parseInt(nowType / 2)]}${s}`;
}
document.querySelector('.goBtn').click();
is = 1;
nowType++;
}
} else {
const a = cw().document.querySelectorAll('span.u');
const n = a.length;
let kkk = 0;
let loc;
if (n > 100) {
for (let i = 100; i < n; i++) {
if (cw().document.querySelectorAll('span.u')[i].textContent.split(' ')[
0] === '&#x300B;') {
kkk = 1;
loc = i;
break;
}
}
}
if (kkk) {
res += cw().document.querySelectorAll('span.u')[loc].textContent.split(
' ')[2] + ' | ';
is = 0;
}
}
}
const si = setInterval(function() {
chk();
}, 1000);
</pre>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/xyf0076/namerena_scripts.git
git@gitee.com:xyf0076/namerena_scripts.git
xyf0076
namerena_scripts
namerena_scripts
master

搜索帮助