könnt ihr ma kurz helfen...

  • also hallo erstma...
    ich bin neu hier und befasse mich erst kurz mit autoit...
    ich wollte mich ma mit GUI versuchen...
    seht selbst:

    Spoiler anzeigen
    [autoit]

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

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

    AutoIt Version: 3.2.10.0
    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
    #include <GUIConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form2", 301, 221, 313, 171)
    $Radio1 = GUICtrlCreateRadio("Radio1", 176, 88, 113, 17)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 8, 88, 97, 17)
    $Radio2 = GUICtrlCreateRadio("Radio2", 176, 112, 113, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 8, 112, 97, 17)
    $Radio3 = GUICtrlCreateRadio("Radio3", 176, 136, 113, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 8, 136, 97, 17)
    $Label1 = GUICtrlCreateLabel("Auswahl:", 56, 8, 147, 42)
    GUICtrlSetFont(-1, 20, 400, 0, "Comic Sans MS")
    $Button1 = GUICtrlCreateButton("Go!", 88, 176, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    Func Radio1()
    Send ("1b1b1b1b1b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox1()
    Send ("1a1a1a1a1a")
    Sleep (5000)
    EndFunc

    Func Radio2()
    Send ("2b2b2b2b2b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox2()
    Send ("2a2a2a2a2a")
    Sleep (5000)
    EndFunc

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

    Func Radio3()
    Send ("3b3b3b3b3b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox3()
    Send ("3a3a3a3a3a")
    Sleep (5000)
    EndFunc

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Button1
    EndSwitch
    WEnd

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

    Exit

    [/autoit]


    Nun weiß ich nich wie ich es hinkriege , das wenn ich den Button klicke, das das ausgewählte passiert... ?(
    PS: das skript ist nur zum herausfinden wie das mit GUI funktioniert
    Danke im vorraus

  • also...
    so???

    Spoiler anzeigen
    [autoit]

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

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

    AutoIt Version: 3.2.10.0
    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
    #include <GUIConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form2", 301, 221, 313, 171)
    $Radio1 = GUICtrlCreateRadio("Radio1", 176, 88, 113, 17)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 8, 88, 97, 17)
    $Radio2 = GUICtrlCreateRadio("Radio2", 176, 112, 113, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 8, 112, 97, 17)
    $Radio3 = GUICtrlCreateRadio("Radio3", 176, 136, 113, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 8, 136, 97, 17)
    $Label1 = GUICtrlCreateLabel("Auswahl:", 56, 8, 147, 42)
    GUICtrlSetFont(-1, 20, 400, 0, "Comic Sans MS")
    $Button1 = GUICtrlCreateButton("Go!", 88, 176, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Button1
    Func Radio1()
    Send ("1b1b1b1b1b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox1()
    Send ("1a1a1a1a1a")
    Sleep (5000)
    EndFunc

    Func Radio2()
    Send ("2b2b2b2b2b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox2()
    Send ("2a2a2a2a2a")
    Sleep (5000)
    EndFunc

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

    Func Radio3()
    Send ("3b3b3b3b3b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox3()
    Send ("3a3a3a3a3a")
    Sleep (5000)
    EndFunc

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

    EndSwitch
    WEnd

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

    Exit

    [/autoit]

    sry wenn ich nerv aber ich bin halt en nobbi :D

    • Offizieller Beitrag

    Nein, Funktionen sind eigene Routinen, die man über deren Funktionsnamen aufruft:

    Spoiler anzeigen
    [autoit]


    Func Radio1()
    Send ("1b1b1b1b1b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox1()
    Send ("1a1a1a1a1a")
    Sleep (5000)
    EndFunc

    Func Radio2()
    Send ("2b2b2b2b2b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox2()
    Send ("2a2a2a2a2a")
    Sleep (5000)
    EndFunc

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

    Func Radio3()
    Send ("3b3b3b3b3b")
    Sleep (5000)
    EndFunc

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

    Func Checkbox3()
    Send ("3a3a3a3a3a")
    Sleep (5000)
    EndFunc

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    Radio1()
    Checkbox1()
    Radio2()
    etc.
    EndSwitch
    WEnd

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

    Exit

    [/autoit]