Sign in to follow this  
Followers 0
augustspies

Loop to password timeout for input box after XX mins

2 posts in this topic

Hi guys,

I am currently using _Crypt_HashData to require a password

to run the script.  Once the password has been entered

correctly another input box pops up for you to select, which

option you would like to run.

What I would like to happen is after the 2nd input box that

pops up has been opened for 30 for it to then go back to

the first input box that requires you to re-enter the password.

Any help would be greatly appreciated.

#include  <Crypt.au3>

$sPassword = InputBox("Login", "Enter Password", "", "*")

If _Crypt_HashData($sPassword, $CALG_MD5) = $bPasswordHash Then
    Do
        $launcher = InputBox("Launcher", "Enter Option" & @CRLF & @CRLF & "   1. Test" & @CRLF & "   2. Test 2", Default, "", Default, 230, Default, Default,1800)
        If @error = 1 Then
            Exit
        EndIf
        If $launcher = 1 Then
            MsgBox(1,"","Test 1")
        ElseIf $launcher = 2 Then
            MsgBox(1,"","Test 2")
        EndIf
    Until $launcher = @error = 1 Or @error = 2
Else
    MsgBox(16, "", "Incorrect Password")
EndIf

Share this post


Link to post
Share on other sites



Global $sPassword, $sLauncher
Global $Timeout = 5


While 1

$sPassword = InputBox("Login", "Enter Password", "", "*")
If @error = 1 Then Exit

If $sPassword == "password" Then
While 1
$sLauncher = InputBox("Launcher", "Enter Option" & @CRLF & @CRLF & " 1. Test" & @CRLF & " 2. Test 2", Default, "", Default, 230, Default, Default, $Timeout)
Switch @error
Case 1 ; Cancel
Exit
Case 2
ExitLoop
EndSwitch

Switch $sLauncher
Case "1"
MsgBox(1, "", "Test 1")
Case "2"
MsgBox(1, "", "Test 2")
EndSwitch

WEnd

Else
MsgBox(16, "", "Incorrect Password")
EndIf
WEnd


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


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
Sign in to follow this  
Followers 0