Codeverziferung

  • Hey Leute,
    Das Script is recht simpel(es ist sowas wie diese Code bestätigugen nach Registrierungen)

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Date.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $isecs = 60
    Global $iFalsch = 0
    $rCode = _RCode()
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Codeverziferung", 282, 184, 192, 124)
    $Button1 = GUICtrlCreateButton("Ok", 112, 152, 75, 25, $WS_GROUP)
    $Button2 = GUICtrlCreateButton("Neues Bild", 192, 152, 75, 25, $WS_GROUP)
    $Label1 = GUICtrlCreateLabel("Übrige zeit: 60sec.", 8, 152, 91, 25)
    $label2 = GUICtrlCreateLabel($rCode, 70, 50, 91,25)
    $Pic1 = GUICtrlCreatePic("", 8, 8, 268, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $Input1 = GUICtrlCreateInput("", 8, 120, 265, 21)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("_timer", 1000)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $iread = GUICtrlRead($Input1)
    If $rCode = $iread Then
    MsgBox(0, "Freigabe", "Freigabe wahr Erfolgreich")
    Exit
    Else
    MsgBox(0, "Freigabe", "Freigabe ist Fehlgeschlagen")
    $iFalsch = $iFalsch +1
    If $iFalsch = 3 Then
    MsgBox(0, "Freigabe", "Sie haben den Code drei mal Falsch eingeben!")
    Exit
    EndIf
    EndIf
    Case $Button2
    $rCode = _RCode()
    GUICtrlSetData($Label2, $rCode)
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _RCode()
    $string = StringSplit( "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,1,2,3,4,5,6,7,8,9", ",")
    $irandom = Random(1, 35)
    $irandom1 = Random(1, 35)
    $irandom2 = Random(1, 35)
    $irandom3 = Random(1, 35)
    Return $string[$irandom] & $string[$irandom1] & $string[$irandom2] & $string[$irandom3]
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Timer()
    $isecs = $isecs -1
    GUICtrlSetData($Label1,"Übrige zeit:" & $isecs & "sec")
    If $isecs = 0 Then
    MsgBox(0, "Codeverziferung", "Sie haben das Zeit limit überschritten!"
    Exit
    EndIf
    EndFunc

    [/autoit]

    Bug: wenn ihr in den Funktion _timer() das exit weglasst zählt der Timer einfach in die - zahlen..

    MFG CF*Gaming

  • Nettes Script !
    Aber könnst unten bei der letzten MsgBox noch ne ) dran machen, dann funkt. die auch ^^
    ... und sieht auch besser aus.