James Posted January 7, 2007 Posted January 7, 2007 (edited) I was just watching WarGames Films like that always get me going with stuff. So I decided to make this, its a command test that I made. You type in the commands: exit notepad paint cmd A voice speaks the command when you have typed it in, thanks to BigDod for that. expandcollapse popup#cs Name: Command Tests Description: Run commands with a voice reader CreditL BugDod - Voice help #ce #include <GUIConstants.au3> Dim $voice = ObjCreate("Sapi.SpVoice") Func Speak($Text, $Rate, $Vol) $voice.Rate = $Rate $voice.Volume = $Vol $voice.Speak($Text) EndFunc $CMDTests = GUICreate("Command Tests", 633, 250, 193, 115) $Group1 = GUICtrlCreateGroup("", 8, 8, 617, 193) $HelpCommands = GUICtrlCreateEdit("", 16, 24, 601, 169, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, StringFormat("Help:\r\nThe commands for this are:\r\n\r\n* exit\r\n* notepad\r\n* paint\r\n* cmd")) GUICtrlCreateGroup("", -99, -99, 1, 1) $Commands = GUICtrlCreateInput("", 8, 208, 505, 21) $SetCommand = GUICtrlCreateButton("Send Command", 520, 208, 105, 25, 0) GUISetState(@SW_SHOW) Speak("Welcome to Command Tests. Type in commands to make them run.", 1, 100) ; Set the commands $cexit = "exit" $cnotp = "notepad" $cpait = "paint" $ccomd = "cmd" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $SetCommand or $ $Commands $exitcommand = GuiCtrlRead($Commands) If $exitcommand = $cexit Then Speak("Exit", 1, 100) Exit EndIf If $exitcommand = $cnotp Then Speak("Notepad", 1, 100) Run("notepad.exe") EndIf If $exitcommand = $cpait Then Speak("Paint", 1, 100) Run("mspaint.exe") EndIf If $exitcommand = $ccomd Then Speak("Command Prompt", 1, 100) Run("cmd.exe") EndIf EndSwitch WEnd Secure Edited May 14, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted January 8, 2007 Author Posted January 8, 2007 57 views, no replies? Secure Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Achilles Posted January 8, 2007 Posted January 8, 2007 57 views, no replies?SecureI know you feel, my last script I posted here has close to 70 view and no replies... I like your code. I think you should make a way so that the user can insert whatever functions they want, they could add a directory of the program they wanted and in another inputbox they could type the name of the program. Just an idea... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
James Posted January 9, 2007 Author Posted January 9, 2007 Hmm.. Yeah, with use of .ini files or .dat. The idea for me was for BetaPad, which _Kurt and I are working on. Thanks Piano Man Secure Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Stewie Posted February 25, 2007 Posted February 25, 2007 Its very nice... But can you -bind the ENTER key to the Send Command button? -Make it possible to add stuff like Piano Man said. -Make it possible to typ when you run it, not that you have to wait untill the voice said her line Very nice though... Nice & simple
James Posted February 25, 2007 Author Posted February 25, 2007 I'm currently not working on it, as I'm working on other things (BetaPad) & Remote Home Control program. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
McGod Posted February 25, 2007 Posted February 25, 2007 -bind the ENTER key to the Send Command button? expandcollapse popup#cs Name: Command Tests Description: Run commands with a voice reader CreditL BugDod - Voice help #ce #include <GUIConstants.au3> Dim $voice = ObjCreate("Sapi.SpVoice") Func Speak($Text, $Rate, $Vol) $voice.Rate = $Rate $voice.Volume = $Vol $voice.Speak($Text) EndFunc $CMDTests = GUICreate("Command Tests", 633, 250, 193, 115) $Group1 = GUICtrlCreateGroup("", 8, 8, 617, 193) $HelpCommands = GUICtrlCreateEdit("", 16, 24, 601, 169, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, StringFormat("Help:\r\nThe commands for this are:\r\n\r\n* exit\r\n* notepad\r\n* paint\r\n* cmd")) GUICtrlCreateGroup("", -99, -99, 1, 1) $Commands = GUICtrlCreateInput("", 8, 208, 505, 21) $SetCommand = GUICtrlCreateButton("Send Command", 520, 208, 105, 25, 0) GUISetState(@SW_SHOW) Speak("Welcome to Command Tests. Type in commands to make them run.", 1, 100) ; Set the commands $cexit = "exit" $cnotp = "notepad" $cpait = "paint" $ccomd = "cmd" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $SetCommand OR $Commands $exitcommand = GuiCtrlRead($Commands) If $exitcommand = $cexit Then Speak("Exit", 1, 100) Exit EndIf If $exitcommand = $cnotp Then Speak("Notepad", 1, 100) Run("notepad.exe") EndIf If $exitcommand = $cpait Then Speak("Paint", 1, 100) Run("mspaint.exe") EndIf If $exitcommand = $ccomd Then Speak("Command Prompt", 1, 100) Run("cmd.exe") EndIf EndSwitch WEnd Untested. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
daslick Posted April 3, 2007 Posted April 3, 2007 Another idea would be to run whatever command is entered in the input box, wait a second, then get the window's title and speak(it).
Siddhartha Posted April 3, 2007 Posted April 3, 2007 -bind the ENTER key to the Send Command button?CODE#csName: Command TestsDescription: Run commands with a voice readerCreditL BugDod - Voice help#ce#include <GUIConstants.au3>Dim $voice = ObjCreate("Sapi.SpVoice")Func Speak($Text, $Rate, $Vol)$voice.Rate = $Rate$voice.Volume = $Vol$voice.Speak($Text)EndFunc$CMDTests = GUICreate("Command Tests", 633, 250, 193, 115)$Group1 = GUICtrlCreateGroup("", 8, 8, 617, 193)$HelpCommands = GUICtrlCreateEdit("", 16, 24, 601, 169, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))GUICtrlSetData(-1, StringFormat("Help:\r\nThe commands for this are:\r\n\r\n* exit\r\n* notepad\r\n* paint\r\n* cmd"))GUICtrlCreateGroup("", -99, -99, 1, 1)$Commands = GUICtrlCreateInput("", 8, 208, 505, 21)$SetCommand = GUICtrlCreateButton("Send Command", 520, 208, 105, 25, 0)GUISetState(@SW_SHOW)Speak("Welcome to Command Tests. Type in commands to make them run.", 1, 100); Set the commands$cexit = "exit"$cnotp = "notepad"$cpait = "paint"$ccomd = "cmd"While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $SetCommand OR $Commands $exitcommand = GuiCtrlRead($Commands) If $exitcommand = $cexit Then Speak("Exit", 1, 100) Exit EndIf If $exitcommand = $cnotp Then Speak("Notepad", 1, 100) Run("notepad.exe") EndIf If $exitcommand = $cpait Then Speak("Paint", 1, 100) Run("mspaint.exe") EndIf If $exitcommand = $ccomd Then Speak("Command Prompt", 1, 100) Run("cmd.exe") EndIf EndSwitchWEndUntested.lol holy crap...126 notepads opened up before i could stop it it seems to want to keep going by itself...
James Posted April 21, 2007 Author Posted April 21, 2007 (edited) Hey, Just to fix that problem with the continuous opening of programs. Chip forgot to set the Input back to emtpy otherwise the program keeps reading the input text. [scroll]expandcollapse popup#cs Name: Command Tests Description: Run commands with a voice reader CreditL BugDod - Voice help #ce #include <GUIConstants.au3> Dim $voice = ObjCreate("Sapi.SpVoice") Func Speak($Text, $Rate, $Vol) $voice.Rate = $Rate $voice.Volume = $Vol $voice.Speak($Text) EndFunc $CMDTests = GUICreate("Command Tests", 633, 250, 193, 115) $Group1 = GUICtrlCreateGroup("", 8, 8, 617, 193) $HelpCommands = GUICtrlCreateEdit("", 16, 24, 601, 169, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, StringFormat("Help:\r\nThe commands for this are:\r\n\r\n* exit\r\n* notepad\r\n* paint\r\n* cmd")) GUICtrlCreateGroup("", -99, -99, 1, 1) $Commands = GUICtrlCreateInput("", 8, 208, 505, 21) $SetCommand = GUICtrlCreateButton("Send Command", 520, 208, 105, 25, 0) GUISetState(@SW_SHOW) Speak("Welcome to Command Tests. Type in commands to make them run.", 1, 100) ; Set the commands $cexit = "exit" $cnotp = "notepad" $cpait = "paint" $ccomd = "cmd" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $SetCommand OR $Commands $exitcommand = GuiCtrlRead($Commands) If $exitcommand = $cexit Then Speak("Exit", 1, 100) GUICtrlSetData($Commands, "") Exit EndIf If $exitcommand = $cnotp Then Speak("Notepad", 1, 100) GUICtrlSetData($Commands, "") Run("notepad.exe") EndIf If $exitcommand = $cpait Then Speak("Paint", 1, 100) GUICtrlSetData($Commands, "") Run("mspaint.exe") EndIf If $exitcommand = $ccomd Then Speak("Command Prompt", 1, 100) GUICtrlSetData($Commands, "") Run("cmd.exe") EndIf EndSwitch WEnd[/scroll] Its just so that if anyone finds it and cannot fix it then they know how to. Secure Edited April 21, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
jvanegmond Posted April 21, 2007 Posted April 21, 2007 This reads from the command line and tells you what it is as soon as you press enter. Opt("WinTitleMatchMode",4) Dim $voice = ObjCreate("Sapi.SpVoice") $voice.Rate = 1 $voice.Volume = 100 $Text = "" While 1 While WinExists("Classname=#32770","OK") $Text = ControlGetText("Classname=#32770","OK",1001) Sleep(25) WEnd If $Text Then $voice.Speak($Text) $Text = "" Sleep(100) WEnd github.com/jvanegmond
James Posted April 22, 2007 Author Posted April 22, 2007 Cool.. Thats a good way of doing it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now