Created
May 11, 2018 14:47
-
-
Save davidsaccavino/c134fc6e77f4678a852709faac4bd374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let fs = require('fs'); | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
let dateTimeNow = new Date(); | |
applicationList = ['C:\\Program Files\\Epic Games\\Fortnite\\FortniteGame\\Binaries\\Win64\\FortniteLauncher', 'C:\\Program Files (x86)\\Adobe\\Adobe Sync\\CoreSync\\CoreSync'] | |
while(true){ | |
for(app in applicationList){ | |
currentApp = applicationList[app]; | |
if(fs.existsSync(`${currentApp}.exe`)) | |
{ | |
if(dateTimeNow.getHours() >=22 && dateTimeNow.getDay() < 6) | |
{ | |
fs.renameSync(`${currentApp}.exe`, `${currentApp}.old`); | |
} | |
else if(dateTimeNow.getHours() >=9 && dateTimeNow.getHours() < 14 && dateTimeNow.getDay() < 6) | |
{ | |
fs.renameSync(`${currentApp}.exe`, `${currentApp}.old`); | |
} | |
} | |
else | |
{ | |
if(!(dateTimeNow.getHours() >= 22 && dateTimeNow.getDay() < 6)) | |
{ | |
fs.renameSync(`${currentApp}.old`, `${currentApp}.exe`); | |
} | |
else if(!(dateTimeNow.getHours() >=9 && dateTimeNow.getHours() < 14 && dateTimeNow.getDay() < 6)) | |
{ | |
fs.renameSync(`${currentApp}.old`, `${currentApp}.exe`); | |
} | |
} | |
} | |
sleep(30000) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment