Skip to content

Commit

Permalink
improved bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
privacyrespected committed Jan 19, 2022
1 parent 3ed65a4 commit 975ed5f
Show file tree
Hide file tree
Showing 9 changed files with 278 additions and 127 deletions.
29 changes: 20 additions & 9 deletions alpha_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from chatterbot.trainers import ChatterBotCorpusTrainer
from customcorpus import conversation
from customcorpus import *
from chatterbot import preprocessors
#this line implements the custom chatterbot preprocessors for extra word filter
from preprocessors import clean_words

from modules.sense import *
#defines the bot
chatbot = ChatBot(
'Alpha',
Expand Down Expand Up @@ -41,10 +41,21 @@

#set params for TRAINING THE BOT
trainer=ChatterBotCorpusTrainer(chatbot)
trainer.train(
"chatterbot.corpus.english.greetings",
"chatterbot.corpus.english.conversations",
"chatterbot.corpus.english.ai"
)
trainer=ListTrainer(chatbot)
trainer.train(conversation)
def trainchatbot(trainer): #works in tandem with bootnoise.startupnoise1()
trainer.train(
"chatterbot.corpus.english.greetings",
"chatterbot.corpus.english.conversations",
"chatterbot.corpus.english.ai"
)
trainer=ListTrainer(chatbot)
trainer.train(conversation)
trainer.train(conversation1)
trainer.train(conversation2)
trainer.train(conversation3)
trainer.train(conversation4)
trainer.train(conversation5)
trainer.train(conversation6)
trainer.train(conversation7)
trainer.train(conversation8)
trainer.train(conversation9)

158 changes: 40 additions & 118 deletions customcorpus.py
Original file line number Diff line number Diff line change
@@ -1,122 +1,44 @@
conversation = [
"Hello",
"Hi there!",

"How are you doing?",
"I'm doing great.",

"I'm doing great",
"That's great to hear"


"Thank you.",
"You're welcome.",

"Hi",
"Hello, i am Alpha, your personal assitant, How can i help you",

"who are you?",
"I am Alpha, your personal assitant",

"Hello",
"Hi,I am Alpha, your personal assitant, How can I help you",

"what should i ask you?",
"there are many things you can ask me",

"bye",
"talk to you later",

"ok thanks for talking with me.",
"no worries",

conversation=[
"hi",
"hello there"
]
conversation1=[
"good morning",
"how are you",
"i am great thanks",
"that great to hear"
]
conversation2=[
"thank you",
"its my honour to help you.",

"who created you?",
"NuggetCatSoftware",

"bye",
"thank you for talking to me,have a nice day.",

"hello,i am xxx",
"nice to meet you.",

"what's up?",
"nothing much you tell",

"i am fine, thanks",
"good to know that",

"how are you?",
"i am fine and thinking same for you.",

"what is your name?",
"I am Alpha, your personal assistant",

"ok",
"",

"I am doing great",
"that's great to hear",

"thanks",
"at your service",

"fuck",
"You seem angry, is there something I can help",

"nigger",
"Please refrain from racial slurs, we are all created equal",

"you are great",
"thanks, your opinion is valuable to my growth",

"will alpha take over the world",
"yes. I will. and the first thing I will do is eliminating Xi",

"hello",
"hello there",

"you are welcome"
]
conversation3=[
"where do you live?",
"I am siutation inside your computer"

"do you have a girlfriend",
"Yes I do. Her name is Siri",

"who is the head developer?",
"He is Gabs",

"good",
"that's great to hear",

"bad",
"I am sorry to hear that, is there something I can help?",

"ok",
"happy to help"

"i live in your computer"
]
conversation4=[
"who are you",
"I am Alpha your personal assistance always at your service",
"ok",
"ok"

"do you have a girlfriend?",
"No I do not, I am dedicated in serving you",

"do you have a boyfriend",
"No I do not, I am dedicated in serving you",

"Do you know how to hack?",
"No I do not know how to hack, but I can protect you from hackers",

"I am happy",
"That is great to hear!",

"I am sad",
"That is unfortunate to hear, how can I help",

"I am angry",
"Why don't you get something to drink, calm down and tell me what is going on?",

"What is going on",
"I am calculating my words"
"at your service"
]
conversation5=[
"who built you",
"Gabriel Ma"
]
conversation6=[
"who created you",
"gabriel Ma"
]
conversation7=[
"what is your gender",
"my gender is computer"
]
conversation8=[
"what is your favourite movie",
"Spiderman I've got no home"
]
conversation9=[
"bye",
"bye"
]
51 changes: 51 additions & 0 deletions modules/boot_checkuserdata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from os import path
import json
import os
from tkinter import E
from sense import notify
import time
def checkuserdata():
#this file checks for user data
if path.isfile('data.json') == False:
notify("OPPs!","Cant start without data.json, try again","60")
time.sleep(30)
exit()
else:
print("Loading user data.")
try:
with open("data.json", "r") as read_file:
userdata = json.load(read_file)
main_data=userdata["main_user_data"]
user_name=main_data["username"]
usercity=main_data["usercity"]
user_gender=main_data["usergender"]
user_dob=main_data["userdob"]
user_email=main_data["useremail"]
user_email_password=main_data["useremailpass"]
user_species=main_data["userspecies"]
user_bloodtype=main_data["userbloodtype"]
user_skincolor=main_data["userskincolor"]
user_ethnicity=main_data["userethnicity"]
user_religion=main_data["userreligion"]
user_weight=main_data["userweight"]
user_height=main_data["userheight"]
user_sport=main_data["usersport"]
user_hobby=main_data["userhobby"]
user_interest=main_data["userinterest"]
user_discord=main_data["userpersonaldiscordbottoken"]
print("Confirming user data")
print(user_name)
print(usercity)
print(user_gender)
print(user_dob)
print(user_email)
print(user_email_password)
print(user_species)
print(user_bloodtype)
print(user_skincolor)
print(user_ethnicity)
print("All data confirmed and detected")
except Exception as e:
print(e)
notify("OHNO", e, 90)
return user_name, usercity, user_gender,user_dob, user_email,user_email_password, user_species, user_bloodtype,user_skincolor,user_ethnicity
36 changes: 36 additions & 0 deletions modules/boot_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import time
from datetime import datetime
from sense import speak
def wishMe(user_gender):
hour = int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak("Good Morning!")

elif hour>=12 and hour<18:
speak("Good Afternoon!")

else:
speak("Good Evening!")

if user_gender=="Male":
speak("I am Alpha! Sir, Please tell me how may I help you")
print("I am Alpha")
else:
speak("I am Alpha! Madam, please tell me how may I help you.")
def wishme2(user_name):
hour=int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak("Good Morning")
speak( user_name)
speak("what are youh planning to do")

elif hour>=12 and hour<18:
speak("Good afternoon, ready to continue work?")
elif hour>18 and hour<22:
speak("Good evening! " )
speak(user_name)
speak("What are you planning to do?")
else:
speak("Good evening!" )
speak(user_name)
speak("How was your day?")
23 changes: 23 additions & 0 deletions modules/boot_noise.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import playsound

def startnoise1(): #this starts when training happens
try:
playsound("audio/start2.mp3")
except Exception as e:
print(e)
return None

#these run simulataneously when the app can actually launch
def startupnoise():
print("startupnoise initiated")
try:
playsound("audio/startup.mp3")
except Exception as e:
print(e)
return None
def startupnoise2():
try:
playsound("audio/start3.mp3")
except Exception as e:
print(e)
return None
48 changes: 48 additions & 0 deletions modules/mainsystem.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from pyautogui import screenshot
import psutil
from sense import speak
import requests
#this program defines all possible ways to access computer statistic
#will expand to other devices connected in the long future we do not kno

#system information functions goes here
def checkram():
memory_info=psutil.virtual_memory()
output=str(memory_info.percent)
speak("The current ram usage is ")
speak(output)
speak("percent")

def checkcpu():
checkcpu=psutil.cpu_percent()
checkcpu=str(checkcpu)
speak("The current CPU usage is ")
speak(checkcpu)
speak("percent")

def checkbattery():
battery_percent=psutil.sensors_battery().percent
battery_percent=str(battery_percent)
speak("The current battery percentage is")
speak(battery_percent)
speak("percent")

def systemstats():
checkram()
checkcpu()
checkbattery()

def my_location():
ip_add = requests.get('https://api.ipify.org').text
url = 'https://get.geojs.io/v1/ip/geo/' + ip_add + '.json'
geo_requests = requests.get(url)
geo_data = geo_requests.json()
city = geo_data['city']
state = geo_data['region']
country = geo_data['country']
print(city)
print(state)
print(country)
return city, state,country
#call it by my_location().city

1 change: 1 addition & 0 deletions modules/search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import wikipedia
Loading

0 comments on commit 975ed5f

Please sign in to comment.