telmob Posted February 29, 2012 Share Posted February 29, 2012 (edited) I have a script with more than 5000 thousand lines of code (yes, i'm sure i could slim it down, but i'm a n00bish) I've got more than one GUI and lots of functions, and everything is working so far, but... Now i'm trying to put a password script in the beginning of that huge code. If the password is correct, it should go to the GUI and show it. How can i point to the beginning of the GUI if i have tons of functions and other GUIs in it? Is this possible, or do i need a specific function for the GUIs? I know i can't have functions inside functions... Edited March 1, 2012 by telmob Link to comment Share on other sites More sharing options...
Mechaflash Posted February 29, 2012 Share Posted February 29, 2012 you should probably post a code snippet to the areas you want to adjust/add to. Makes it easier for someone to help. also... how the hell did you write 5k lines of code and not know what you're doing telmob 1 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
telmob Posted February 29, 2012 Author Share Posted February 29, 2012 LOL! Ok, let's try to write some example code... expandcollapse popupWhile 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButtonCancel Exit Case $ButtonOk _Decrypt() $Hash=IniRead($HashFile, GUICtrlRead($UsernameCheck), "Hash", "") $HashTrimmed="0x"&StringTrimLeft(StringTrimRight($Hash,3),1) $UserExists=IniReadSection($HashFile, GUICtrlRead($UsernameCheck)) If $UsernameCheck<>"" And $UserExists<>"" And _Crypt_HashData(GUICtrlRead($PasswordCheck),$CALG_MD5)=$HashTrimmed Then Global $FirstUserNameFind = StringInStr(IniRead(@ScriptDir & "\data\config.ini", GUICtrlRead($UsernameCheck), "Nome", ""), " ") Global $FirstUserNameResult = StringLeft(IniRead(@ScriptDir & "\data\config.ini", GUICtrlRead($UsernameCheck), "Nome", ""), $FirstUserNameFind) Global $FullUserNameFind = IniRead(@ScriptDir & "\data\config.ini", GUICtrlRead($UsernameCheck), "Nome", "") Global $UserQualif=GUICtrlRead($UsernameCheck) _Crypt() GUICtrlSetState($AcessDeniedLabel, $GUI_HIDE) GUICtrlSetState($AcessGrantedLabel, $GUI_SHOW) Sleep(1000) GUIDelete() -------------------------------------------------------How do i point to the GUI here if i can't use more funcs? ElseIf $UserExists="" OR _Crypt_HashData(GUICtrlRead($PasswordCheck),$CALG_MD5)<>$Hash Then GUICtrlSetState($AcessDeniedLabel, $GUI_SHOW) Sleep(1000) GUICtrlSetState($AcessDeniedLabel, $GUI_HIDE) _Crypt() EndIf EndSwitch WEnd $GUI bla bla bla Lots of funcs here... Here some GUI elements change. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 29, 2012 Moderators Share Posted February 29, 2012 (edited) Hi, Telmob. So put in a Function like this: Func _mypw() $pw = "mypw" $input = InputBox("My Script Name", "Please enter a password", "", "*") If $pw <> $input Then Exit EndIf EndFunc And then call the function on your first line: _mypw() Edited February 29, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
kylomas Posted February 29, 2012 Share Posted February 29, 2012 telmob, If authentication is truly what you need see the "InputBox" function. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
telmob Posted February 29, 2012 Author Share Posted February 29, 2012 Thanks Kylomas, i'm using inputboxes already. It just would make the example code huge to post everything here. JLogan3013, You just gave me an idea You can mark this thread as solved! Thanks again. Link to comment Share on other sites More sharing options...
JohnOne Posted March 1, 2012 Share Posted March 1, 2012 You can mark this thread as solved!Thanks again.That's your responsibility, just use the edit link. 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