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==
// @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 = `
<div class="restoolsBBWatchReloadedDialog">
<a onclick="window.plugin.restoolsBBWatchReloaded.openPreferences()" title="Settings">Settings</a>
<table class="styled-table">
<thead>
<tr>
@@ -345,7 +345,7 @@ function wrapper(plugin_info)
}
window.plugin.restoolsBBWatchReloaded.openPreferences = function() {
var html =
var html =
'<div>' +
'<table>';
@@ -358,7 +358,7 @@ function wrapper(plugin_info)
'<input id="timezone_input" size="10" type="number" value="'+ window.plugin.restoolsBBWatchReloaded.timezone + '"/>' +
'</td>' +
'</tr>' ;
html +=
'</table>' +
'</div>' +
@@ -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 ---