Compare commits
2 Commits
05b76cec5c
...
046348a71e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
046348a71e | ||
|
|
d0e2ecfdea |
@@ -1,7 +1,11 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name IITC plugin: ResTools BB Watch Reloaded
|
// @name IITC plugin: ResTools BB Watch Reloaded
|
||||||
// @namespace https://git.martinvylet.cz/vykend/ResTools-BB-Watch-Reloaded
|
// @namespace https://git.martinvylet.cz/vykend/ResTools-BB-Watch-Reloaded
|
||||||
|
<<<<<<< HEAD
|
||||||
|
// @version 0.6
|
||||||
|
=======
|
||||||
// @version 0.5.2
|
// @version 0.5.2
|
||||||
|
>>>>>>> 05b76cec5c49b9a62d1b257c90d75c8e9252fb89
|
||||||
// @description Scan window for BBs on ornamented portals, then check results
|
// @description Scan window for BBs on ornamented portals, then check results
|
||||||
// @author vikend
|
// @author vikend
|
||||||
// @icon
|
// @icon
|
||||||
@@ -206,15 +210,16 @@ function wrapper(plugin_info)
|
|||||||
for (let i in results) {
|
for (let i in results) {
|
||||||
let portal = results[i];
|
let portal = results[i];
|
||||||
if (ornamented.find((obj) => obj.Guid === portal.Guid)) {
|
if (ornamented.find((obj) => obj.Guid === portal.Guid)) {
|
||||||
|
var foundObj = ornamented.find((obj) => obj.Guid === portal.Guid);
|
||||||
if (portal.IsWinnerRes) {
|
if (portal.IsWinnerRes) {
|
||||||
resWin++;
|
resWin++;
|
||||||
if (portal.IsVolatile) {
|
if (foundObj.IsVolatile) {
|
||||||
resVolatiles++;
|
resVolatiles++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (portal.IsWinnerEnl) {
|
else if (portal.IsWinnerEnl) {
|
||||||
enlWin++;
|
enlWin++;
|
||||||
if (portal.IsVolatile) {
|
if (foundObj.IsVolatile) {
|
||||||
enlVolatiles++;
|
enlVolatiles++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,13 +240,20 @@ function wrapper(plugin_info)
|
|||||||
{
|
{
|
||||||
let waves = [];
|
let waves = [];
|
||||||
for (let i in window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS) {
|
for (let i in window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS) {
|
||||||
|
var volatiles = 0;
|
||||||
|
|
||||||
|
for (var j = 0; j < window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length; j++) {
|
||||||
|
if (window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0][j].IsVolatile === true) {
|
||||||
|
volatiles++;
|
||||||
|
}
|
||||||
|
}
|
||||||
let results = window.plugin.restoolsBBWatchReloaded.computeBeacons(i);
|
let results = window.plugin.restoolsBBWatchReloaded.computeBeacons(i);
|
||||||
let wave = {
|
let wave = {
|
||||||
WaveNumber: Number(i) +1,
|
WaveNumber: Number(i) +1,
|
||||||
volatilesCount: 0,
|
volatilesCount: volatiles,
|
||||||
beaconCount: window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length,
|
beaconCount: window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length,
|
||||||
PercentageRes: window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length/results.resWin,
|
PercentageRes: (results.resWin/window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length)*100,
|
||||||
PercentageEnl: window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length/results.enlWin,
|
PercentageEnl: (results.enlWin/window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length)*100,
|
||||||
BeaconsWonRes: results.resWin,
|
BeaconsWonRes: results.resWin,
|
||||||
BeaconsWonResVolatiles: results.resVolatiles,
|
BeaconsWonResVolatiles: results.resVolatiles,
|
||||||
BeaconsWonEnl: results.enlWin,
|
BeaconsWonEnl: results.enlWin,
|
||||||
@@ -320,16 +332,16 @@ function wrapper(plugin_info)
|
|||||||
<tr>
|
<tr>
|
||||||
<td>`+ wave.WaveNumber +`</td>
|
<td>`+ wave.WaveNumber +`</td>
|
||||||
<td>`+ wave.beaconCount + " (" + wave.volatilesCount + ")" + `</td>
|
<td>`+ wave.beaconCount + " (" + wave.volatilesCount + ")" + `</td>
|
||||||
<td>`+ wave.PercentageRes +`</td>
|
<td>`+ wave.PercentageRes.toFixed(2) +`</td>
|
||||||
<td>`+ wave.PercentageEnl +`</td>
|
<td>`+ wave.PercentageEnl.toFixed(2) +`</td>
|
||||||
<td>`+ wave.BeaconsWonRes + " (" + wave.BeaconsWonResVolatiles + ")" + `</td>
|
<td>`+ wave.BeaconsWonRes + " (" + wave.BeaconsWonResVolatiles + ")" + `</td>
|
||||||
<td>`+ wave.BeaconsWonEnl + " (" + wave.BeaconsWonEnlVolatiles + ")" + `</td>
|
<td>`+ wave.BeaconsWonEnl + " (" + wave.BeaconsWonEnlVolatiles + ")" + `</td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let bestScore = `<p style="font-weight: bold;">BB SCORING ESTIMATE: RES ` + maxBeaconsWonRes/(maxBeaconsWonRes+maxBeaconsWonEnl) + `:` + maxBeaconsWonEnl/(maxBeaconsWonRes+maxBeaconsWonEnl)+ ` ENL</p>`;
|
let bestScore = `<p style="font-weight: bold;">BB SCORING ESTIMATE: RES ` + (maxBeaconsWonRes/(maxBeaconsWonRes+maxBeaconsWonEnl)*100).toFixed(2) + `:` + (maxBeaconsWonEnl/(maxBeaconsWonRes+maxBeaconsWonEnl)*100).toFixed(2) + ` ENL</p>`;
|
||||||
let bestScoreVolatiles = `<p style="font-weight: bold;">BB SCORING ESTIMATE (including volatiles, speculative): RES ` + (maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)/((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)+(maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave)) + `:` + (maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave)/((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)+(maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave))+ ` ENL</p>`;
|
let bestScoreVolatiles = `<p style="font-weight: bold;">BB SCORING ESTIMATE (including volatiles, speculative): RES ` + ((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)/((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)+(maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave))*100).toFixed(2) + `:` + ((maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave)/((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)+(maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave))*100).toFixed(2)+ ` ENL</p>`;
|
||||||
|
|
||||||
let htmlEnd = `
|
let htmlEnd = `
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user