mrmacro Posted July 9, 2017 Share Posted July 9, 2017 (edited) I am reasonably new to AutoIt but have been working on a script for a few months searching Google and many other forums for code that helps me complete my task I have RTFM but can't seem to find, or if I have then I not made sense of this ,so if someone can look at the below code and see where I am going wrong I have used the Koda to generate the GUI and that seems ok its only the case statement below that I seem to have problems with the form is a Username, Password, Domain and PVN I can get it to exit if the $Btn_Cancel is pressed but what I can't get it to do is once the $Btn_Submit is pressed is to continue to the MsgBox and continue the script I have implemented all of this , and it works using separate input boxes but I wanted only one prompt and enter all the details , rather than multiple input popups keep coming up and asking for input The $Inp_myUsername , $Inp_myPassword , $Inp_myPvn have all been declared as Global in the GUI this is just where I believe the problem to be While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Btn_Cancel MsgBox(0, "Operation has been cancelled", "The Script will now quit.", 3) Exit Case $Btn_Submit $Inp_myUsername = GUICtrlRead($Inp_myUsername) ;MsgBox(0, "User", $Inp_myUsername) $Inp_myPassword = GUICtrlRead($Inp_myPassword) $Inp_myPvn = GUICtrlRead($Inp_myPvn) If ($Inp_myPassword = "Inp_Password" And $Inp_myPvn = "8_Digits") Then MsgBox(0, "Invalid Details", "Invalid Password & Invalid Pvn") Exit EndIf If ($Inp_myPassword == "Inp_Password" And $Inp_myPvn <> "8_Digits") Then MsgBox(0, "Password Invalid", "Invalid Password & Possible Valid Pvn") Exit EndIf If ($Inp_myPassword <> "Inp_Password" And $Inp_myPvn = "8_Digits") Then MsgBox(0, "Pvn Invalid", "Possible Valid Password & Invalid Pvn") Exit EndIf If ($Inp_myPassword <> "Inp_Password" And $Inp_myPvn <> "8_Digits") Then ;MsgBox(0, "Pvn Invalid", "Possible Valid Password & Invalid Pvn") GUIDelete() EndIf EndSwitch WEnd ;its not getting to this part it just seems to hang #Region Login MessageBox --- MsgBox(0, "Wait", "Before Continuing further Please Now Open ' Login'" & @CRLF & @CRLF & "Down by the clock Click on the arrow to show any hidden icons then right click on to the Login icon and select connect" & @CRLF & "Be sure to select the Password Box") #EndRegion Login MessageBox --- ;Other code below that I believe is not needed to show this example Edited July 16, 2017 by mrmacro Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2017 Developers Share Posted July 9, 2017 Add an ExitLoop underneath the Guidelete() to exit the While loop. Jos mrmacro 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
mrmacro Posted July 9, 2017 Author Share Posted July 9, 2017 17 minutes ago, Jos said: Add an ExitLoop underneath the Guidelete() to exit the While loop. Jos perfect just another fresh pair of eyes and its all fixed many thanks , seen many posts about RTFM and didn't want to get that reply like others as I have been looking and editing and changing code without any luck and now had to post a message and just exitloop fixed this thanks 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