forked from dodying/UserJs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhvCharacterStats.user.js
43 lines (43 loc) · 1.66 KB
/
hvCharacterStats.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
/* eslint-env browser */
// ==UserScript==
// @name [HV]CharacterStats
// @description
// @include http://alt.hentaiverse.org/
// @include http://alt.hentaiverse.org/?s=Character&ss=ch
// @include http://alt.hentaiverse.org/?s=Battle&ss=ba&encounter=*
// @include http*://hentaiverse.org/
// @include http*://hentaiverse.org/?s=Character&ss=ch
// @include http*://hentaiverse.org/?s=Battle&ss=ba&encounter=*
// @version 1.00a
// @grant none
// @author dodying
// @namespace https://github.com/dodying/
// @supportURL https://github.com/dodying//UserJs/issues
// @icon https://gitee.com/dodying/userJs/raw/master/Logo.png
// @run-at document-end
// ==/UserScript==
(function () {
if (!document.querySelector('img[src="/y/character/inc.png"]')) return;
let plus; let grades; let points; let temp; let
min;
while (document.querySelector('img[src="/y/character/inc.png"]')) {
plus = document.querySelectorAll('#attr_table>tbody>tr>td:nth-child(7)>img');
grades = [];
points = document.querySelectorAll('#attr_table>tbody>tr>td:nth-child(2)>div');
points.forEach((i) => {
if (i.querySelectorAll('div').length > 1) {
temp = '';
i.querySelectorAll('div').forEach((i) => {
temp = String(-parseInt(i.style.backgroundPositionY) / 12) + temp;
});
grades.push(temp * 1);
} else {
grades.push(i.textContent * 1);
}
});
min = Math.min.apply(null, grades);
plus[grades.indexOf(min)].click();
plus = document.querySelectorAll('img[src="/y/character/inc.png"]');
}
document.querySelector('img[src="/y/character/apply.png"]').click();
}());