#Include #include #include #include HotKeySet("{ESC}", "MyExit") HotKeySet("{SPACE}", "AtoT") HotKeySet("{F9}", "stop") Global $voice = ObjCreate("SAPI.SpVoice") Global $Paused AtoT() Do until @HotKeyPressed="{SPACE}" Func reply() Select Case StringInStr($spoken,"google");;;;;;;;;OPENS GOOGLE IN DEFAULT BROWSER ShellExecute("https://www.google.com") Case StringInStr($spoken,"youtube");;;;;;;;;OPENS YOUTUBE IN DEFAULT BROWSER ShellExecute("https://www.youtube.com") Case StringInStr($spoken,"mail");;;;;;;;;;;;OPENS GMAIL IN DEFAULT BROWSER ShellExecute("https://www.gmail.com") Case StringInStr($spoken,"notepad");;;;;;;;;;OPENS NOTEPAD Run("notepad.exe") Case StringInStr($spoken,'computer');;;;;;;;;OPENS MY COMPUTER FOLDER Send("{LWINDOWN}e{LWINUP}") Case StringInStr($spoken,'bye');;;;;;;;;;;;;;CLOSES THE PROGRAM speak('Goodbye sir!') Sleep(2000) Exit case StringInStr($spoken,'Sleep');;;;;;;;;;;;;PROGRAM SLEEPS UNTILL YOU PRESS SPACE Send("{F9}") Send("{F9}") Send("{F9}") case StringInStr($spoken,'close');;;;;;;;;;;;;CLOSES THE ACTIVE WINDOWS Send("!{F4}") Case StringInStr($spoken,'time') speak('time') Case StringInStr($spoken,'date') speak('date') EndSelect EndFunc Func stop() EndFunc Func AtoT() speak('How may i help you sir?') Do $h_Context = ObjCreate("SAPI.SpInProcRecoContext") $h_Recognizer = $h_Context.Recognizer $h_Grammar = $h_Context.CreateGrammar(1) $h_Grammar.Dictationload $h_Grammar.DictationSetState(1) $h_Category = ObjCreate("SAPI.SpObjectTokenCategory") $h_Category.SetId("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput\TokenEnums\MMAudioIn\") $h_Token = ObjCreate("SAPI.SpObjectToken") $h_Token.SetId("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput\TokenEnums\MMAudioIn\") $h_Recognizer.AudioInput = $h_Token $h_ObjectEvents = ObjEvent($h_Context, "SpRecEvent_") Until @HotKeyPressed= "{F9}" speak('press button space if you want me back any time.') ToolTip("I WILL WAIT",0,0) Sleep(2000) $h_ObjectEvents = Null $h_Context= Null $h_Recognizer= Null $h_Grammar= Null $h_Category= Null $h_Token= Null EndFunc Func SpRecEvent_Recognition($StreamNumber, $StreamPosition, $RecognitionType, $Result) Global $spoken=$Result.PhraseInfo.GetText ToolTip($spoken,0,0) reply() Global $spoken="" Sleep(2000) ToolTip("") EndFunc ;==>SpRecEvent_Recognition Func MyExit() sleep(100) ToolTip('Script is "terminated"',0,0) sleep(500) FileDelete("my.vbs") Exit ToolTip("") EndFunc Func speak($speak) If $speak='time' Then $t='speaks=hour(time) & "hour" & minute(time) & "minutes" & second(time) & "seconds"'&@CRLF&'set speech= CreateObject("sapi.spvoice")'&@CRLF&'speech.Rate = -3'&@CRLF&'speech.Speak speaks' FileWrite("t.vbs",$t) RunWait('cscript.exe "t.vbs"',"",@SW_MINIMIZE) FileDelete('t.vbs') ElseIf $speak='date' Then $d='speaks=date'&@CRLF&'set speech= CreateObject("sapi.spvoice")'&@CRLF&'speech.Rate = -3'&@CRLF&'speech.Speak speaks' FileWrite("d.vbs",$d) RunWait('cscript.exe "d.vbs"',"",@SW_MINIMIZE) FileDelete('d.vbs') Else $Voice.Speak($speak,11) Sleep(500) EndIf EndFunc