eontimer_to_flowtimer.py
· 827 B · Python
Orginalformat
# one of the first python scripts i made yipee
from math import floor
FRAME_RATE = 59.8261
TARGET_SEC = int(input("Target Seconds: "))
TARGET_DELAY = int(input("Target Delay: "))
CALIBRATED_DELAY = int(input("Calibrated Delay: "))
CALIBRATED_SECONDS = int(input("Calibrated Seconds: "))
ONE_MIN = 60000
MINIMUM_TIME_MS = 14000
PRETIMER = 5000
def toms(ms):
return floor(ms / FRAME_RATE)
secondTimer = (toms(TARGET_DELAY * 1000 - CALIBRATED_DELAY * 1000) + CALIBRATED_SECONDS * 1000)
firstTimer = ((TARGET_SEC*1000 - secondTimer) % ONE_MIN + 200 )
secondTimer += 5000
firstTimer += 5000
if firstTimer < MINIMUM_TIME_MS:
firstTimer = firstTimer + ONE_MIN
minutesBefore = floor((firstTimer + secondTimer) / ONE_MIN)
print(f'{secondTimer}/{firstTimer}/{PRETIMER}\nMinutes Before Target: {minutesBefore}')
1 | # one of the first python scripts i made yipee |
2 | |
3 | from math import floor |
4 | |
5 | FRAME_RATE = 59.8261 |
6 | TARGET_SEC = int(input("Target Seconds: ")) |
7 | TARGET_DELAY = int(input("Target Delay: ")) |
8 | CALIBRATED_DELAY = int(input("Calibrated Delay: ")) |
9 | CALIBRATED_SECONDS = int(input("Calibrated Seconds: ")) |
10 | ONE_MIN = 60000 |
11 | MINIMUM_TIME_MS = 14000 |
12 | PRETIMER = 5000 |
13 | |
14 | |
15 | def toms(ms): |
16 | return floor(ms / FRAME_RATE) |
17 | |
18 | |
19 | secondTimer = (toms(TARGET_DELAY * 1000 - CALIBRATED_DELAY * 1000) + CALIBRATED_SECONDS * 1000) |
20 | firstTimer = ((TARGET_SEC*1000 - secondTimer) % ONE_MIN + 200 ) |
21 | secondTimer += 5000 |
22 | firstTimer += 5000 |
23 | |
24 | if firstTimer < MINIMUM_TIME_MS: |
25 | firstTimer = firstTimer + ONE_MIN |
26 | |
27 | |
28 | minutesBefore = floor((firstTimer + secondTimer) / ONE_MIN) |
29 | |
30 | print(f'{secondTimer}/{firstTimer}/{PRETIMER}\nMinutes Before Target: {minutesBefore}') |