2 Star 2 Fork 6

xyf007/namerena_scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sieve_by_attributes.html 3.72 KB
一键复制 编辑 原始数据 按行查看 历史
xyf007 提交于 2020-11-01 18:15 . upgrade the generetor.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>&#x7B5B;&#x5C5E;&#x6027;</title>
</head>
<body>
<pre>
const pre = '';
const team = '';
let result = '';
let a;
let b;
let name = '';
let attributes = '';
let maxx;
let minn;
let f98;
let f97;
let HP;
let eight;
let seven;
let names = '';
/**
* Get a random name.
* @return {String} The name.
*/
function getRandomName() {
let s = '';
for (let i = 0; i < 8; i++) {
const val = Math.floor(Math.random() * 36);
if (val < 10) {
s += String.fromCharCode(48 + val);
} else {
s += String.fromCharCode(55 + val);
}
}
return s;
}
/**
* Reload names.
*/
function reload() {
names = team + '\n';
for (let i = 0; i < 10; i++) {
names += ` ${pre}${getRandomName()}\n`;
}
document.querySelector('div>textarea').value = names;
document.querySelector('.goBtn').click();
}
/**
* Search for the special names.
*/
function maint() {
if (cw().document.querySelectorAll('div.name').length < 10) {
setTimeout(function() {
maint();
}, 100);
return;
}
a = cw().document.querySelectorAll('div.name');
for (let i = 10; i < 20; i++) {
name = a[i].textContent.replace(/^\s+|\s+$/g, '');
attributes = a[i].nextSibling.textContent.replace(/^\s+|\s+$/g, '').replace(
'HP ', '') + a[i].nextSibling.nextSibling.textContent.replace(
/^\s+|\s+$/g, '').
replace('&#x653B;', '.').replace(' &#x9632;', '.').
replace(' &#x901F;', '.').replace(' &#x654F;', '.').
replace(' &#x9B54;', '.').replace(' &#x6297;', '.').
replace(' &#x667A;', '.');
b = attributes.split('.');
for (let j = 0; j < b.length; j++) {
b[j] = parseInt(b[j]);
}
maxx = 35;
minn = 99;
f98 = f97 = 0;
HP = b[0];
b[0] = Math.floor(HP / 3);
for (let j = 1; j <= 7; j++) {
if (b[j] > maxx) {
maxx = b[j];
}
if (b[j] < minn) {
minn = b[j];
}
if (b[j] === 98) {
f98 = 1;
}
if (b[j] === 97) {
f97 = 1;
}
}
seven = b[1] + b[2] + b[3] + b[4] + b[5] + b[6] + b[7];
eight = b[0] + seven;
if (eight >= 692 || (eight >= 672 && (b[5] <= 50 || b[1] <= 50 || (b[2] - b[
1] >= 30 && b[5] >= 85 && b[7] >= 85))) || (eight >= 682 && (b[5] <=
55 || b[1] <= 55 || (b[2] - b[1] >= 25 && b[5] >= 85 && b[7] >= 85)))) {
result += `${name} ${eight}\n`;
}
if (HP < 164) {
result += `${name} &#x6700;&#x4F4E;HP!\n`;
}
if (HP > 397) {
result += `${name} &#x6700;&#x9AD8;HP!\n`;
}
if (eight <= 395) {
result += `${name} &#x6700;&#x4F4E;&#x516B;&#x56F4;!\n`;
}
if (eight >= 750) {
result += `${name} &#x8D85;&#x9AD8;&#x516B;&#x56F4;!\n`;
}
if (maxx - minn <= 3 && minn >= 75) {
result += `${name} &#x6574;&#x9F50;&#x516B;&#x56F4;!\n`;
}
if (maxx - minn <= 3 && maxx <= 75) {
result += `${name} &#x6574;&#x9F50;&#x516B;&#x56F4;!\n`;
}
if (minn >= 90) {
result += `${name} &#x5168;90+!\n`;
}
if (seven > 649) {
result += `${name} &#x6700;&#x9AD8;&#x4E03;&#x56F4;!\n`;
}
if (seven < 309) {
result += `${name} &#x6700;&#x4F4E;&#x4E03;&#x56F4;!\n`;
}
if (maxx === 99 && f98 === 1) {
result += `${name} 99+98!\n`;
}
if (maxx === 99 && f98 === 1 && f97 === 1) {
result += `${name} 99+98+97!\n`;
}
}
document.querySelector('textarea#result').value = result;
reload();
setTimeout(function() {
maint();
}, 100);
}
const NW = document.createElement('textarea');
NW.id = 'result';
document.body.appendChild(NW);
NW.setAttribute('readonly', true);
document.getElementsByClassName('mdframe')[0].setAttribute('style',
'display:none;');
reload();
maint();
</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

搜索帮助