Lugio Posted July 13, 2011 Share Posted July 13, 2011 helly guys, I got a problem with my script. I want it to close whenever i press cancel but i must have done something wrong. $i = InputBox("Passwordcheck","Insert Password","","*") If $i = "hlMG83csk" Then MsgBox(0,"Sucess","Correct Password") Exit ElseIf $i <> "hlMG83csk" Then MsgBox(0,"FAIL","Wrong password try again") ElseIf @error = 1 Then Exit EndIf While 1 $i = InputBox("Passwordcheck","Insert Password","","*") If $i = "hlMG83csk" Then MsgBox(0,"Sucess","Correct Password") Exit ElseIf $i <> "hlMG83csk" Then MsgBox(0,"FAIL","Wrong password try again") ElseIf @error = 1 Then Exit EndIf WEnd Link to comment Share on other sites More sharing options...
Exit Posted July 13, 2011 Share Posted July 13, 2011 (edited) While 1 If InputBox("Passwordcheck", "Insert Password", "", "*") = "hlMG83csk" Then Exit MsgBox(0, "Sucess", "Correct Password") if MsgBox(5, "FAIL", "Wrong password try again") = 2 then Exit WEnd Edited July 13, 2011 by forumer100 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
JohnOne Posted July 13, 2011 Share Posted July 13, 2011 $i = InputBox("Passwordcheck", "Insert Password", "", "*") If $i = "hlMG83csk" Then MsgBox(0, "Sucess", "Correct Password") Exit ElseIf @error = 1 Then Exit ElseIf $i <> "hlMG83csk" Then MsgBox(0, "FAIL", "Wrong password try again") EndIf AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Lugio Posted July 13, 2011 Author Share Posted July 13, 2011 @ Forumer100 i want to get the program to exit whenever I press the cancel button in the inputbox. The Messagebox works fine. @ JohnOne your solution doesn´t work, but i don´t know why Link to comment Share on other sites More sharing options...
bogQ Posted July 13, 2011 Share Posted July 13, 2011 Heare you go, this is all that your script need While 1 $i = InputBox("Passwordcheck","Insert Password","","*") If @error = 1 Then Exit Select Case $i = "hlMG83csk" MsgBox(0,"Sucess","Correct Password") Exit Case Else MsgBox(0,"FAIL","Wrong password try again") EndSelect WEnd TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Exit Posted July 13, 2011 Share Posted July 13, 2011 While 1 If InputBox("Passwordcheck", "Insert Password", "", "*") = "hlMG83csk" Then Exit MsgBox(0, "Sucess", "Correct Password") if @Error = 1 then Exit if MsgBox(5, "FAIL", "Wrong password try again") = 2 then Exit WEnd App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Lugio Posted July 13, 2011 Author Share Posted July 13, 2011 @forumer100 still not getting yours but thats most likely cause I´m a newbie ;D @bogQ thx it works great finnaly solved that problem^^ Link to comment Share on other sites More sharing options...
Exit Posted July 13, 2011 Share Posted July 13, 2011 @forumer100 still not getting yours but thats most likely cause I´m a newbie ;DJust curious, what went wrong with my code ? Just let it run as is. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
JohnOne Posted July 13, 2011 Share Posted July 13, 2011 @ JohnOne your solution doesn´t work, but i don´t know whyBecause I never put it in a loop, I corrected the first part of the code you posted. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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