-
Notifications
You must be signed in to change notification settings - Fork 2
/
remote.py
67 lines (51 loc) · 1.75 KB
/
remote.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import time
print("Welcome to the Bad Apple remote!")
print("")
print("What would you like to do?")
print("1. Pause the program")
print("2. resume the program")
print("3. disable the music")
print("4. move the playhead to a certain time")
print("5. loop a section of the video")
print("6. exit")
def pause():
# We will send a PAUSE.truconf
with open("PAUSE.truconf", 'w') as f:
f.write("null")
def resume():
with open("UNPAUSE.truconf", 'w') as f:
f.write("null")
def disable():
print("This will FULLY disable the music! In order to start it again you will need to rerun launcher.py!!!")
check = input("To disable to music type YES in all caps otherwise just press enter >>> ")
if check != "YES":
exit()
with open("DISABLE.truconf", 'w') as f:
f.write("null")
def move():
print("What second mark should the playhead move to?\
(if time in minutes convert to seconds)")
time = int(input("Time (in seconds) >>> "))
with open("MOVE.truconf", 'w') as f:
f.write(f"{time}")
def loop():
start = int(input("Where should the loop start?? "))
end = int(input("Where should the loop end?? "))
times = int(input("How many times should it loop? -1 for infinity "))
if times != -1:
for i in range(times):
with open("MOVE.truconf", 'w') as f:
f.write(f"{start}")
time.sleep(end-start)
if times == -1:
while 1:
with open("MOVE.truconf", 'w') as f:
f.write(f"{start}")
time.sleep(end-start)
def adios():
print("See ya")
exit(0)
my_dict = {"1": pause, "2": resume, "3": disable, "4": move, "5": loop, '6': adios}
while 1:
remote = input("Remote >>> ")
my_dict[remote]()