Created
July 28, 2022 13:33
-
-
Save zdunecki/5e2e3ca300e0d4b35b192e7aefebc7e9 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 timer = null | |
function unlock(index = 0) { | |
document.querySelectorAll("form select")[index].removeAttribute("disabled") | |
document.querySelectorAll("form button")[index].removeAttribute("disabled") | |
} | |
function submit(index) { | |
document.querySelectorAll("form button")[index].click() | |
} | |
function job(t = "16:00:00", index = 0) { | |
const condition = new Date().toLocaleTimeString('pl-PL') >= t | |
if (condition) { | |
clearInterval(timer) | |
unlock(index) | |
submit(index) | |
} | |
} | |
function doJob(t, index) { | |
timer = setInterval(() => job(t, index), 100) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment