Update 'RestoolsBBWatchReloaded.js'

This commit is contained in:
2023-06-15 17:06:08 +02:00
parent 73583be671
commit ca6e5a485f

View File

@@ -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.5 // @version 0.5.1
// @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
@@ -85,8 +85,8 @@ function wrapper(plugin_info)
const timezoneOffsetHours = window.plugin.restoolsBBWatchReloaded.timezone; // Assuming the offset is stored in hours const timezoneOffsetHours = window.plugin.restoolsBBWatchReloaded.timezone; // Assuming the offset is stored in hours
const offsetMilliseconds = timezoneOffsetHours * 60 * 60 * 1000; // Convert offset to milliseconds const offsetMilliseconds = timezoneOffsetHours * 60 * 60 * 1000; // Convert offset to milliseconds
const currentTimeWithOffset = new Date(currentTime.getTime() + offsetMilliseconds); const currentTimeWithOffset = new Date(currentTime.getTime() + offsetMilliseconds);
const currentTimeString = currentTimeWithOffset.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); const currentTimeString = currentTimeWithOffset.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false });
const currentTimePlus5Minutes = (new Date(currentTimeWithOffset.getTime() + 5 * 60000)).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); const currentTimePlus5Minutes = (new Date(currentTimeWithOffset.getTime() + 5 * 60000)).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false });
let currentWave = 0; let currentWave = 0;
let battleOver = false; let battleOver = false;
@@ -154,7 +154,7 @@ function wrapper(plugin_info)
console.log("BBWatchReloaded: According to timetable anomaly haven't started yet, skipping"); console.log("BBWatchReloaded: According to timetable anomaly haven't started yet, skipping");
return; return;
} }
if (waveNo > 7) { if (waveNo >= 7) {
console.log("BBWatchReloaded: According to timetable anomaly already ended, skipping"); console.log("BBWatchReloaded: According to timetable anomaly already ended, skipping");
return; return;
} }