Update 'RestoolsBBWatchReloaded.js'
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// ==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
|
||||||
// @version 0.7
|
// @version 0.8
|
||||||
// @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
|
||||||
@@ -165,11 +165,14 @@ function wrapper(plugin_info)
|
|||||||
//this should record all ornamented portals in each wave.
|
//this should record all ornamented portals in each wave.
|
||||||
//plugin considers 5-minute-window at the end of each wave (or before start of the next one) as window where to check for BBs results
|
//plugin considers 5-minute-window at the end of each wave (or before start of the next one) as window where to check for BBs results
|
||||||
// = records ornamented portals to another array
|
// = records ornamented portals to another array
|
||||||
|
if (!waveBattleOver) {
|
||||||
if(portal.IsOrnamented) {
|
if(portal.IsOrnamented) {
|
||||||
if (!(window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[waveNo][waveBattleOver].find((obj) => obj.Guid === portal.Guid))) {
|
if (!(window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[waveNo][0].find((obj) => obj.Guid === portal.Guid))) {
|
||||||
portalsToBeAdded.push(portal);
|
portalsToBeAdded.push(portal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else { //battle over
|
||||||
|
|
||||||
//if ornaments disappear too quickly, it is needed to add 2nd check
|
//if ornaments disappear too quickly, it is needed to add 2nd check
|
||||||
//has the portal winners beacon?
|
//has the portal winners beacon?
|
||||||
@@ -177,7 +180,7 @@ function wrapper(plugin_info)
|
|||||||
|
|
||||||
if(portal.IsWinnerRes || portal.IsWinnerEnl) {
|
if(portal.IsWinnerRes || portal.IsWinnerEnl) {
|
||||||
//check if portal wasnt already added in previous waves
|
//check if portal wasnt already added in previous waves
|
||||||
if (!(window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[waveNo][waveBattleOver].find((obj) => obj.Guid === portal.Guid))) {
|
if (!(window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[waveNo][1].find((obj) => obj.Guid === portal.Guid))) {
|
||||||
|
|
||||||
//check if portal isn't already in portalsToBeAdded
|
//check if portal isn't already in portalsToBeAdded
|
||||||
if (!(portalsToBeAdded.find((obj) => obj.Guid === portal.Guid))) {
|
if (!(portalsToBeAdded.find((obj) => obj.Guid === portal.Guid))) {
|
||||||
@@ -191,6 +194,7 @@ function wrapper(plugin_info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[waveNo][waveBattleOver] = window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[waveNo][waveBattleOver].concat(portalsToBeAdded);
|
window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[waveNo][waveBattleOver] = window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[waveNo][waveBattleOver].concat(portalsToBeAdded);
|
||||||
window.plugin.restoolsBBWatchReloaded.saveStorage(window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS);
|
window.plugin.restoolsBBWatchReloaded.saveStorage(window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS);
|
||||||
console.log("BBWatchReloaded: Portals updated");
|
console.log("BBWatchReloaded: Portals updated");
|
||||||
|
|||||||
Reference in New Issue
Block a user