skafreak_510 Posted January 21, 2005 Share Posted January 21, 2005 Hi I was wondering how to make and inputbox that ask for multiple inputs, and precautions to take when running scripts that can get screwed up by moving the mouse, keyboard ext. I know the blockinput function but is there one to turn of the monitor. thank you and sorry in I seem like a n00b Link to comment Share on other sites More sharing options...
DirtyBanditos Posted January 21, 2005 Share Posted January 21, 2005 Hi I was wondering how to make and inputbox that ask for multiple inputs, and precautions to take when running scripts that can get screwed up by moving the mouse, keyboard ext.I know the blockinput function but is there one to turn of the monitor.thank you and sorry in I seem like a n00b<{POST_SNAPBACK}>Hello look on your Autoit3 >Install folder for the Exampel folder! expandcollapse popup; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; Author: Jonathan Bennett (jon@hiddensoft.com) ; ; Script Function: ; Demonstrates the InputBox, looping and the use of @error. ; ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "AutoIt Example (English Only)", "This script will open an input box and get you to type in some text. Run?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(4096, "AutoIt", "OK. Bye!") Exit EndIf ; Loop around until the user gives a valid "autoit" answer $bLoop = 1 While $bLoop = 1 $text = InputBox("AutoIt Example", "Please type in the word ""autoit"" and click OK") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") Else ; They clicked OK, but did they type the right thing? If $text <> "autoit" Then MsgBox(4096, "Error", "You typed in the wrong thing - try again!") Else $bLoop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf WEnd ; Print the success message MsgBox(4096,"AutoIt Example", "You typed in the correct word! Congrats.") ; Finished! Link to comment Share on other sites More sharing options...
skafreak_510 Posted January 21, 2005 Author Share Posted January 21, 2005 Hello look on your Autoit3 >Install folder for the Exampel folder! thank you, I knew I would look like a newb Link to comment Share on other sites More sharing options...
skafreak_510 Posted January 21, 2005 Author Share Posted January 21, 2005 (edited) I meant two inputs in the same box sorry for not clarifying. Edited January 21, 2005 by skafreak_510 Link to comment Share on other sites More sharing options...
MHz Posted January 21, 2005 Share Posted January 21, 2005 (edited) Have a look at GUICtrlCreateInput in the helpfile. A nice little example is on the page. Here is a slightly modified version, for 2 input display. #include <GUIConstants.au3> GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45) $file = GUICtrlCreateInput("", 10, 5, 300, 20) GUICtrlSetState(-1, $GUI_ACCEPTFILES) $file2 = GUICtrlCreateInput("", 10, 35, 300, 20) $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $Btn MsgBox(262144, '', ' 1 : ' & GUICtrlRead($file) & ' 2: ' & GUICtrlRead($file2)) EndSelect WEnd Edited January 21, 2005 by MHz Link to comment Share on other sites More sharing options...
skafreak_510 Posted January 21, 2005 Author Share Posted January 21, 2005 Have a look at GUICtrlCreateInput in the helpfile. A nice little example is on the page.Here is a slightly modified version, for 2 input display.#include <GUIConstants.au3> GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45) $file = GUICtrlCreateInput("", 10, 5, 300, 20) GUICtrlSetState(-1, $GUI_ACCEPTFILES) $file2 = GUICtrlCreateInput("", 10, 35, 300, 20) $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $Btn MsgBox(262144, '', ' 1 : ' & GUICtrlRead($file) & ' 2: ' & GUICtrlRead($file2)) EndSelect WEnd<{POST_SNAPBACK}>It's errorring out on me Link to comment Share on other sites More sharing options...
MHz Posted January 21, 2005 Share Posted January 21, 2005 You may need the latest beta. I should have a link at the bottom of my post. I would assume GuiCtrlRead is causing the error? Link to comment Share on other sites More sharing options...
skafreak_510 Posted January 21, 2005 Author Share Posted January 21, 2005 AutoItX3? Link to comment Share on other sites More sharing options...
MHz Posted January 21, 2005 Share Posted January 21, 2005 (edited) No, not AutoItX3. Autoit3.Installer link Edited January 21, 2005 by MHz Link to comment Share on other sites More sharing options...
grakker Posted January 21, 2005 Share Posted January 21, 2005 (edited) AutoItX3?<{POST_SNAPBACK}>The developers are, uh...developing the hell out of AutoIt. I looks like you downloaded the wrong version if you are using the X version. Try something in this directory. Like the 1.5MB exe.Edit: Ooops. MHz beat me to it by a minute.... Edited January 21, 2005 by grakker Link to comment Share on other sites More sharing options...
skafreak_510 Posted January 21, 2005 Author Share Posted January 21, 2005 The developers are, uh...developing the hell out of AutoIt. I looks like you downloaded the wrong version if you are using the X version. Try something in this directory. Like the 1.5MB exe.Edit: Ooops. MHz beat me to it by a minute....<{POST_SNAPBACK}>there was an error when i installed. It couldn't open some file that started with a c. well I hope it works Link to comment Share on other sites More sharing options...
skafreak_510 Posted January 21, 2005 Author Share Posted January 21, 2005 thank you, using gui will help alot with what i want to do Link to comment Share on other sites More sharing options...
MHz Posted January 21, 2005 Share Posted January 21, 2005 there was an error when i installed. It couldn't open some file that started with a c. well I hope it works You may have had a file running during uninstall and reinstall. Example the helpfile or something running.Try a reinstall, with any autoit files closed. Link to comment Share on other sites More sharing options...
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