Jump to content

SOLVED! All messed up, need simple help.

Recommended Posts

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 by telmob
Link to post
Share on other sites

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 :oops:


“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 post
Share on other sites


Ok, let's try to write some example code...

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $ButtonCancel
Case $ButtonOk
$Hash=IniRead($HashFile, GUICtrlRead($UsernameCheck), "Hash", "")
$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)
GUICtrlSetState($AcessDeniedLabel, $GUI_HIDE)
GUICtrlSetState($AcessGrantedLabel, $GUI_SHOW)
-------------------------------------------------------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)
GUICtrlSetState($AcessDeniedLabel, $GUI_HIDE)

Lots of funcs here...

Here some GUI elements change.
Link to post
Share on other sites
  • Moderators

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


And then call the function on your first line:

Edited 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 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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...