-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalpha_main.py
81 lines (72 loc) · 2.68 KB
/
alpha_main.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#Import modules
from winreg import QueryValue
from modules.display import slowprint
from modules.display import ascii
from modules.bootloader import checkuserdata, startup_main
from modules.sense import listen, speak
from modules.chatgpt import chatgpt
from UI import alpha_frontend
from modules.weather import weathermain
from modules.mainsystem import *
import re
import spacy
nlp = spacy.load("en_core_web_sm")
####################################
#INTRO
results=ascii("ALPHA V 5.0")
print(results)
slowprint("Designed by PrivacyRespected in the United Kingdom")
######################################################################################
#GREET
def alpha_main():
startup_main()
mute =0
#######################################################################################
while True:
#reorganise the string into readable format
test = str(listen())
res=re.findall(r'\".*?\"', test)
input = res[1]
input =input.strip('\"')
print(input)
if input.startswith("hello"):
input = input.replace("hello","")
if input=="alpha":
speak("How can I help you?")
else:
if input == "":
continue
else:
print("USER INPUTL: "+ input)
print("Output: ") #comment this line
#### continue all your shit below
if input.startswith("mute"):
mute =1
continue
if "weather" in input:
if "in " in input:
input_city= re.search("^in: (\w+)",input)
target=input_city.groups()
weathermain(target)
else:
weathermain(checkuserdata()[1])
elif "check" and "memory" in input:
checkram()
elif "check" and "cpu" in input:
checkcpu()
elif "check" and "battery" in input:
checkbattery()
elif "check" and "system" in input:
systemstats()
elif "flush" and "dns" in input:
flushdns()
elif input.startswith("shut down"):
speak("Shutdown protocol has been executed")
shutdown_s()
elif "kill program" in input:
kill()
else:
chatgpt(input)
else:
continue
alpha_main()