From ca6e5a485f7f9b1169ff56c4e53e0dc82235e2dd Mon Sep 17 00:00:00 2001 From: vykend Date: Thu, 15 Jun 2023 17:06:08 +0200 Subject: [PATCH] Update 'RestoolsBBWatchReloaded.js' --- RestoolsBBWatchReloaded.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RestoolsBBWatchReloaded.js b/RestoolsBBWatchReloaded.js index f6e125a..9e61ce9 100644 --- a/RestoolsBBWatchReloaded.js +++ b/RestoolsBBWatchReloaded.js @@ -1,7 +1,7 @@ // ==UserScript== // @name IITC plugin: 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 // @author vikend // @icon @@ -85,8 +85,8 @@ function wrapper(plugin_info) const timezoneOffsetHours = window.plugin.restoolsBBWatchReloaded.timezone; // Assuming the offset is stored in hours const offsetMilliseconds = timezoneOffsetHours * 60 * 60 * 1000; // Convert offset to milliseconds const currentTimeWithOffset = new Date(currentTime.getTime() + offsetMilliseconds); - const currentTimeString = currentTimeWithOffset.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); - const currentTimePlus5Minutes = (new Date(currentTimeWithOffset.getTime() + 5 * 60000)).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', hour12: false }); let currentWave = 0; let battleOver = false; @@ -154,7 +154,7 @@ function wrapper(plugin_info) console.log("BBWatchReloaded: According to timetable anomaly haven't started yet, skipping"); return; } - if (waveNo > 7) { + if (waveNo >= 7) { console.log("BBWatchReloaded: According to timetable anomaly already ended, skipping"); return; } @@ -282,7 +282,7 @@ function wrapper(plugin_info) let htmlBegin = `
Settings - + @@ -345,7 +345,7 @@ function wrapper(plugin_info) } window.plugin.restoolsBBWatchReloaded.openPreferences = function() { - var html = + var html = '
' + '
'; @@ -358,7 +358,7 @@ function wrapper(plugin_info) '' + '' + '' ; - + html += '
' + '
' + @@ -377,7 +377,7 @@ function wrapper(plugin_info) window.plugin.restoolsBBWatchReloaded.timezone = $('#timezone_input').val(); localStorage['window.plugin.restoolsBBWatchReloaded.timezone'] = JSON.stringify(window.plugin.restoolsBBWatchReloaded.timezone); }; - + // --- SETUP ---