-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjarvis.py
More file actions
41 lines (36 loc) · 1.13 KB
/
Copy pathjarvis.py
File metadata and controls
41 lines (36 loc) · 1.13 KB
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
import threading
from Brain.gpt_brain import ask_gpt
from internet_check import is_Online
from Alert import Alert
from Data.DLG_Data import online_dlg,offline_dlg
import random
from co_brain import Jarvis
from Brain.personality import jarvis_speak
from Automation.Battery import check_plug
from Time_Operations.throw_alert import check_schedule,check_Alam
from os import getcwd
import os
Alam_path = os.path.join(getcwd(), "Alam_data.txt")
file_path = os.path.join(getcwd(), "schedule.txt")
ran_online_dlg = random.choice(online_dlg)
ran_offline_dlg = random.choice(offline_dlg)
def main():
if is_Online():
t1 = threading.Thread(target=jarvis_speak,args=(ran_online_dlg,))
t3 = threading.Thread(target=check_plug)
t4 = threading.Thread(target=check_schedule,args=(file_path,))
t5 = threading.Thread(target=Jarvis)
t6 = threading.Thread(target=check_Alam,args=(Alam_path,))
t1.start()
t1.join()
t3.start()
t4.start()
t5.start()
t6.start()
t3.join()
t4.join()
t5.join()
t6.join()
else:
Alert(ran_offline_dlg)
main()