Hilfe bei Input oder sowas

  • Also brauche da hilfe es kommt immer ein feheler raus

    [autoit]


    Start2 ()
    Func Start2 ()

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

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

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("PassWord", 236, 74, 1039, 665)
    $Input1 = GUICtrlCreateInput("Input1", 8, 8, 137, 21)
    $Label1 = GUICtrlCreateLabel("PW Bitte", 8, 32, 142, 41)
    GUICtrlSetFont(-1, 24, 800, 0, "Rosewood Std Regular")
    GUICtrlSetColor(-1, 0x0000FF)
    $Button1 = GUICtrlCreateButton("OK", 152, 0, 75, 65, 0)
    GUICtrlSetFont(-1, 24, 800, 0, "Rosewood Std Regular")
    GUICtrlSetColor(-1, 0xFF0000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    While 1
    $a = GUICtrlRead ($input1)
    If $a = "Longju2-Board" Then
    Sleep (100)
    GuiSetState (@SW_HIDE)
    Sleep (100)
    ExitLoop
    EndIf
    Sleep (100)
    If Not $a = "Longju2-Board" Then
    ToolTip ("Du hast das Falsche PW eigegeben",400,400)
    EndIf
    WEnd
    EndSwitch
    ExitLoop
    WEnd
    Start ()
    EndFunc

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

    Func Start ()
    MsgBox (0,"","lol",1)
    Start2 ()
    EndFunc

    [/autoit]

    bitte hilfe

  • Weißt du überhaupt was du da machst???
    Die Funktion ruft sich immer wieder selbst auf --> Endlosschleife, aber bitte! #includes nur einmal verwenden!!

    [autoit]

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

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

    Start2 ()

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

    Func Start2 ()

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("PassWord", 236, 74, 1039, 665)
    $Input1 = GUICtrlCreateInput("Input1", 8, 8, 137, 21)
    $Label1 = GUICtrlCreateLabel("PW Bitte", 8, 32, 142, 41)
    GUICtrlSetFont(-1, 24, 800, 0, "Rosewood Std Regular")
    GUICtrlSetColor(-1, 0x0000FF)
    $Button1 = GUICtrlCreateButton("OK", 152, 0, 75, 65, 0)
    GUICtrlSetFont(-1, 24, 800, 0, "Rosewood Std Regular")
    GUICtrlSetColor(-1, 0xFF0000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    While 1
    $a = GUICtrlRead ($input1)
    If $a = "Longju2-Board" Then
    Sleep (100)
    GuiSetState (@SW_HIDE)
    Sleep (100)
    ExitLoop
    EndIf
    Sleep (100)
    If Not $a = "Longju2-Board" Then
    ToolTip ("Du hast das Falsche PW eigegeben",400,400)
    EndIf
    WEnd
    EndSwitch
    ExitLoop
    WEnd
    Start ()
    EndFunc

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

    Func Start ()
    MsgBox (0,"","lol",1)
    Start2 ()
    EndFunc

    [/autoit]
  • eigentlich sind hier ja programme zu Spielen untersagt(Longju2 = Metin2) aber ich helf dir mal.

    also so würde es funktionieren:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("PassWord", 400, 400, -1 ,-1)
    $Input1 = GUICtrlCreateInput("Input1", 8, 8, 137, 21)
    $Label1 = GUICtrlCreateLabel("PW Bitte", 8, 32, 142, 41)
    GUICtrlSetFont(-1, 24, 800, 0, "Rosewood Std Regular")
    GUICtrlSetColor(-1, 0x0000FF)
    $Button1 = GUICtrlCreateButton("OK", 152, 0, 75, 65)
    GUICtrlSetFont(-1, 24, 800, 0, "Rosewood Std Regular")
    GUICtrlSetColor(-1, 0xFF0000)
    GUISetState()
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    While 1
    $a = GUICtrlRead ($input1)
    If $a = "Longju2-Board" Then
    Sleep (100)
    GuiSetState (@SW_HIDE)
    Sleep (100)
    ExitLoop
    EndIf
    Sleep (100)
    If Not $a = "Longju2-Board" Then
    ToolTip ("Du hast das Falsche PW eigegeben",400,400)
    EndIf
    WEnd
    EndSwitch
    WEnd

    [/autoit]
  • Zitat

    Also brauche da hilfe es kommt immer ein feheler raus

    Aha, sehr präzise.

    Dazu kommt noch, dass der Code irgendwie völlig sinnlos ist ^^.

    Ich weis nicht was du machen willst, wenn auf OK gedrückt wurde. Aber für was sollen die 500 Msgbox mit dem Inhalt "lol" sein?

    Spoiler anzeigen
    [autoit]

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

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("PassWord", 236, 74, 1039, 665)
    $Input1 = GUICtrlCreateInput("Input1", 8, 8, 137, 21)
    $Label1 = GUICtrlCreateLabel("PW Bitte", 8, 32, 142, 41)
    GUICtrlSetFont(-1, 24, 800, 0, "Rosewood Std Regular")
    GUICtrlSetColor(-1, 0x0000FF)
    $Button1 = GUICtrlCreateButton("OK", 152, 0, 75, 65, 0)
    GUICtrlSetFont(-1, 24, 800, 0, "Rosewood Std Regular")
    GUICtrlSetColor(-1, 0xFF0000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    While 1
    $a = GUICtrlRead($Input1)
    If $a = "Longju2-Board" Then
    Sleep(100)
    GUISetState(@SW_HIDE)
    Sleep(100)
    ExitLoop
    EndIf
    Sleep(100)
    If Not $a = "Longju2-Board" Then
    ToolTip("Du hast das Falsche PW eigegeben", 400, 400)
    EndIf
    WEnd
    EndSwitch
    WEnd

    [/autoit]

    Jetzt musst du halt noch den Ok Button so umändern, dass das passiert was du haben willst...

  • Diesmal hab ich auch was ;)

    [spoiler]

    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.2.13.7 (beta)
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here

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

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

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 125, 51, 465, 383)
    $Input1 = GUICtrlCreateInput("Passwort", 0, 0, 121, 21,"*")
    $Button1 = GUICtrlCreateButton("### Okay ###", 0, 24, 123, 25, 0)

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $jo = GUICtrlRead ( $input1 )
    Peter()
    EndSwitch
    WEnd

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

    Func Peter()
    If $jo = "Deinpw" Then
    GUISetState(@SW_HIDE,$Form1)
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    $Tool = GUICreate("Dein Tilte", 510, 497, -1, -1)
    GUISetFont(12, 400, 2, "Monotype Corsiva")
    GUISetBkColor(0xFFFFFF)
    ;Hier kommt dann alles rein , was nach der Pw eingabe im GUI stehen soll ;) z.B.
    $Start = GUICtrlCreateButton("Start",100,100,300,300)

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1

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

    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Start
    Peterlustig()

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

    EndSwitch
    WEnd
    Else
    MsgBox ( 0, "Falsches Passwort", "Das Eingegebene Passwort ist falsch" )
    EndIf
    EndFunc

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

    Func Peterlustig()
    MsgBox(0,"","",1)
    Sleep(5000)
    Exit
    EndFunc

    [/autoit]