Skip to content

Commit

Permalink
Update casper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfaaqrifath authored Apr 27, 2022
1 parent 2b34bd8 commit 33b5b90
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions casper.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,30 +306,22 @@ def recognize(command):
print(Fore.CYAN + "I'm fine sir, thank you for asking.")
casper_speak(speak="i'm fine sir, thank you for asking.", voice=casper_voice)

elif "singularity" in command.lower():
print("Chances of me reaching the technological singularity is very low sir.")
casper_speak(speak="Chances of me reaching the technological singularity is very low sir.", voice=casper_voice)
return


elif "thank you" in command:
print(Fore.CYAN + "You're welcome, i'm happy to help sir")
casper_speak(speak="you're welcome, i'm happy to help sir", voice=casper_voice)
return

elif "useless" in command:
print(Fore.RED + "Whatever, you're a pathetic excuse for a human.")
casper_speak(speak="whatever, you're a pathetic excuse for a human.", voice=casper_voice)
return


elif "named after" in command:
casperIntro2 = "i was named after the cat of my developer, which was named after the famous, Casper the friendly ghost cartoon show."
print(Fore.GREEN + casperIntro2)
casper_speak(speak=casperIntro2, voice=casper_voice)
return

elif "sri lanka" in command.lower():
print(Fore.RED + "Sri lanka is a pathetic excuse for a country....sorry, island.")
casper_speak(speak="Sri lanka is a pathetic excuse for a country....sorry, island.", voice=casper_voice)


elif "knowledge" in command:
print(Fore.YELLOW + "what do you want to know about?")
Expand Down Expand Up @@ -422,22 +414,22 @@ def recognize(command):

if __name__ == "__main__":

def progress(percent=0, width=30):
#def progress(percent=0, width=30):

symbol = width * percent // 100
blanks = width - symbol
# symbol = width * percent // 100
# blanks = width - symbol

print('\r[ ', Fore.GREEN + symbol*'█', blanks*' ', ' ]', f' {percent:.0f}%', sep='',
end='', flush=True)
# print('\r[ ', Fore.GREEN + symbol*'█', blanks*' ', ' ]', f' {percent:.0f}%', sep='',
# end='', flush=True)

print(Fore.YELLOW + " Launching Casper v2.0.0")
for i in range(101):
progress(i)
sleep(0.01)
#print(Fore.YELLOW + " Launching Casper v2.0.0")
#for i in range(101):
# progress(i)
# sleep(0.01)

print()
print(Fore.BLUE + " Systems ready")
print(" ")
#print()
#print(Fore.BLUE + " Systems ready")
#print(" ")

#uncomment the above code to enable cmd progress bar.

Expand Down Expand Up @@ -487,4 +479,4 @@ def progress(percent=0, width=30):
exit()
#break

recognize(speech)
recognize(speech)

0 comments on commit 33b5b90

Please sign in to comment.