Sign in to follow this  
Followers 0
Kyme

InputBox help

3 posts in this topic

i have this skirpt

pass()

While 1
    $msg = GUIGetMsg()
    if $msg= -3 Then
        Exit
    EndIf
WEnd

Func pass()
    $passwd = InputBox("Password", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")
    If $passwd = IniRead(@ScriptDir & "\data.dll", "Word", "Pass", "")  Then
            MsgBox(0, "Warning", "corect")
            exit

    Else
        do 
            pass()
        until $passwd = IniRead(@ScriptDir & "\data.dll", "Word", "Pass", "")
        EndIf
    EndFunc

how i can make it when pass it's wrong 3 time to exit???

and when one time pass wrong to be InputBox("Password Wrong(1)", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")

when 2 time InputBox("Password Wrong(2)", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")

tnx for help

Share this post


Link to post
Share on other sites



how i can make it when pass it's wrong 3 time to exit???

and when one time pass wrong to be InputBox("Password Wrong(1)", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")

when 2 time InputBox("Password Wrong(2)", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")

tnx for help

that would b something like this

Global $times
Global $passwd
$times = "0"
pass()

While 1
    $msg = GUIGetMsg()
    if $msg= -3 Then
        Exit
    EndIf
WEnd

Func pass()
    $times = $times +1
    Select
        Case $times = "4" 
            Exit
        Case $times = "3" 
            $passwd = InputBox("Password Wrong(2)", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")
        Case $times = "2" 
            $passwd = InputBox("Password Wrong(1)", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")
        Case $times = "1" 
            $passwd = InputBox("Password", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")
    EndSelect
    If $passwd = IniRead(@ScriptDir & "\data.dll", "Word", "Pass", "")    Then
        MsgBox(0, "Warning", "corect")
        exit
    Else
        pass()
    EndIf
EndFunc

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites

i have this skirpt

pass()

While 1
    $msg = GUIGetMsg()
    if $msg= -3 Then
        Exit
    EndIf
WEnd

Func pass()
    $passwd = InputBox("Password", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")
    If $passwd = IniRead(@ScriptDir & "\data.dll", "Word", "Pass", "")  Then
            MsgBox(0, "Warning", "corect")
            exit

    Else
        do 
            pass()
        until $passwd = IniRead(@ScriptDir & "\data.dll", "Word", "Pass", "")
        EndIf
    EndFunc

how i can make it when pass it's wrong 3 time to exit???

and when one time pass wrong to be InputBox("Password Wrong(1)", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")

when 2 time InputBox("Password Wrong(2)", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")

tnx for help

I like to put the query in a While/WEnd loop that doesn't exit until either the correct response is provided, or it fails:
Func pass()
    Local $iTries = 3, $passwd
    While 1
        $passwd = InputBox("Password", IniRead(@ScriptDir & "\data.dll", "Question", "1", ""), "", "*")
        If $passwd = IniRead(@ScriptDir & "\data.dll", "Word", "Pass", "") Then
            MsgBox(64, "Correct", "Corect")
            ExitLoop
        Else
            $iTries -= 1
            If $iTries Then
                MsgBox(16, "Wrong", "Wrong!  You have " & $iTries & " attempts left.")
            Else
                MsgBox(16, "Cracker!", "Get thee behind me, Cracker!")
                Exit
            EndIf
        EndIf
    WEnd
EndFunc  ;==>pass

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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