Jump to content
Sign in to follow this  
keen

Blocked Input box

Recommended Posts

Do a help file search.... its pretty self explanatory... you want an inputbox, try looking that up.

Edit: BTW, if you haven't looked through the help file then thats usually what you will be told to do. Make an attempt at your script and if you run into problems that you cant figure out, feel free to make a post.

Edited by BPBNA

Share this post


Link to post
Share on other sites

Welcome,

Try this example

; Get the name
$name = InputBox("Question", "What is your name?", "")

; Get the password
$password = InputBox("Question", "What is your password?", "")

MsgBox(0, 'Answer', $name & " " & $password)

:whistle:

Share this post


Link to post
Share on other sites

You could put it inside a while loop and have it compare the string they enter the password and only exit the loop when its correct.

While $pass <> "mypassword"
    $pass = InputBox("Password", "Enter your password", "" , "*M")
WEnd

The * makes it so every keystroke comes out as * instead of the real character and the M as the second character of that parameter makes entering something into the box mandatory so they cannot enter a blank(you can just remove the M if you want them to be able to)

Edited by BPBNA

Share this post


Link to post
Share on other sites

Most get 3 tries so this code will do that for you

For $i = 1 To 3
    ; Get the name
    $name = InputBox("Question count:" & $i, "What is your name?", "")
    If $name <> 'John' Then ContinueLoop
    ; Get the password
    $password = InputBox("Question count:" & $i, "What is your password?", "")
    If $password = 'JibbaJabba' Then ExitLoop 
Next

If $i > 3 Then
    MsgBox(0, 'You failed', 'Goodbye')
    Exit 1
EndIf

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...