Last active
July 15, 2023 20:43
-
-
Save NovaSagittarii/96adec33e450bd98e39578a482867474 to your computer and use it in GitHub Desktop.
show many stats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function overwrite(k, stats) { | |
const labels = ["PPS", "APM", "VS", "APP", "VS/APM", "DSPS", "DSPP", "CI", "GE"]; | |
k.innerHTML = labels.map((l, i) => `<span>${meanstdev(stats.map(x=>x[i]).filter(x=>!isNaN(x)))}</span> <div>${l}</div> `).join('<br>') | |
} | |
function meanstdev(array) { | |
const n = array.length | |
const mean = array.reduce((a, b) => a + b) / n | |
const stdev = Math.sqrt(array.map(x => Math.pow(x - mean, 2)).reduce((a, b) => a + b) / n) | |
return mean.toFixed(2) + " \u00b1 " + stdev.toFixed(2); | |
// https://stackoverflow.com/a/53577159 | |
} | |
[":not(.multilog_result_unavailable) > .multilog_result_self", | |
":not(.multilog_result_unavailable) > .multilog_result_opponent"].forEach((tag, i) => | |
overwrite( | |
document.querySelectorAll(".leagueplayer_extra")[i], | |
[...document.querySelectorAll(tag)] | |
.map(x => [...x.children].map(x => +x.innerText)) | |
.map(x => ((pps, apm, vs) => [ | |
pps, | |
apm, | |
vs, | |
app = apm / 60 / pps, | |
vs / apm, | |
dsps = vs / 100 - apm / 60, | |
dspp = dsps / pps, | |
150 * dspp - 125 * app + 50 * vs / apm - 25, | |
2 * app * dsps / pps | |
])(...x) // https://github.com/Cankyre/TetoStats | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bookmarklet URL
Also you run it on this screen
![image](https://user-images.githubusercontent.com/12877445/253770374-acd54f7c-e231-40a4-a662-0e23737a85a2.png)
Becomes this
![image](https://user-images.githubusercontent.com/12877445/253770378-39b96e86-7f81-417e-93f9-5fe352d733d2.png)