Jump to content

Multiple Inputbox


Recommended Posts

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

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! :lmao:

;
; 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

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 by MHz
Link to comment
Share on other sites

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

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 by grakker
Link to comment
Share on other sites

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 :lmao:
Link to comment
Share on other sites

there was an error when i installed. It couldn't open some file that started with a c. well I hope it works :lmao:

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...