From ed918a74ae65dbdfbc63341e11c653e82b0e903d Mon Sep 17 00:00:00 2001 From: Cesium Date: Sat, 8 Nov 2025 19:24:33 -0500 Subject: [PATCH] replace organizedCrime with unavailableOC, and make it reset the timer to 24hrs ago when all conditions are fulfilled so its ready to go next time conditions are not met --- tasks/{organizedCrime.js => unavailableOC.js} | 6 ++++++ 1 file changed, 6 insertions(+) rename tasks/{organizedCrime.js => unavailableOC.js} (86%) diff --git a/tasks/organizedCrime.js b/tasks/unavailableOC.js similarity index 86% rename from tasks/organizedCrime.js rename to tasks/unavailableOC.js index 736be59..086322d 100644 --- a/tasks/organizedCrime.js +++ b/tasks/unavailableOC.js @@ -53,6 +53,12 @@ module.exports = async (client, torn, config, state) => { state.ocAlertLast = now.toISOString(); fs.writeFile('./state.json', JSON.stringify(state, null, 4), err => {if (err) {console.error(err)}}); } + } else { + const now = new Date(); + const twentyFourHoursAgo = new Date(now.getTime() - 24 * 60 * 60 * 1000); + state.ocAlertLast = twentyFourHoursAgo.toISOString(); + fs.writeFile('./state.json', JSON.stringify(state, null, 4), err => {if (err) {console.error(err)}}); + } }); };