Kreatorul Posted April 27, 2006 Share Posted April 27, 2006 $input=InputBox("Question", "What is my name?") $answer="Name here" If $input=$answer Then MsgBox (0, "Good", "Good answer" ) I need help how to do if $input doesen't match $answer Then MsgBox(0, "Bad", "Bad answer") I don't know what comand to use if the answer doesen't match...help pls. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 27, 2006 Moderators Share Posted April 27, 2006 (edited) ??$input = InputBox("Question", "What is my name?") $answer = "Name here" If $input = $answer Then MsgBox (0, "Good", "Good answer") Else MsgBox(0, 'Error', 'Wrong Answer') EndIf Edit: If you want them to keep doing the input box until they get it right, I guess you could put it in a loop also. Local $count = 0 While 1 Local $input = InputBox("Question", "What is my name?") Local $answer = "Name here" If $input = $answer Then MsgBox (0, "Good", "Good answer") ExitLoop Else MsgBox(0, 'Error', 'Wrong Answer') $count = $count + 1 If $count = 3 Then MsgBox(0, 'Error', 'You have attempted 3 times to enter correct password, you will now be exited') Exit Else ContinueLoop EndIf EndIf WEnd Edited April 27, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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