Wecker

  • Problem mit wecker Ich werde in den Anhang alle datein machen die man braucht um das Scirpt richtig zu starten!

    Spoiler anzeigen
    [autoit]

    #include <sound.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <date.au3>

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

    #Region ### START Koda GUI section ### Form=
    ;NebenForm

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

    $Form1_1 = GUICreate("Wecker", 373, 73, 192, 127)
    GUISetIcon("Icon.ico")
    $Input2 = GUICtrlCreateInput("", 264, 8, 97, 21)
    $Label1 = GUICtrlCreateLabel("Aktuelle Zeit: " & _NowTime(), 8, 8, 145, 21)
    $Label2 = GUICtrlCreateLabel("Weckzeit", 184, 8, 61, 17)
    $Button3 = GUICtrlCreateButton("!!!!START!!!!", 8, 40, 353, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $State_NF = GUISetState(@SW_SHOW)

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

    ;Hauptform
    $Form1 = GUICreate("Wecker", 251, 201, 243, 148)
    GUISetIcon("Icon.ico")
    $Pic1 = GUICtrlCreatePic("Bild.gif", 8, 8, 233, 153, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("SLEEP", 8, 168, 113, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("STOP", 128, 168, 113, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $State_HF = GUISetState(@SW_HIDE)
    #EndRegion ### END Koda GUI section ###

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

    $Soundopen = _SoundOpen( "Weck_sound.wav")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button3
    $Weckzeit = GUICtrlRead($Input2)
    GUIDelete($Form1_1)
    While 1
    if _NowTime(5) = $Weckzeit Then
    _SoundPlay($Soundopen)
    $State_HF = GUISetState(@SW_SHOW)
    EndIf
    Sleep(40)
    WEnd

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

    Case $Button1
    _SoundStop($Soundopen)
    $Slummerzeit = IniRead( "option.txt", "Schlummer Funktion", "", "")
    $State_NF = GUISetState(@SW_HIDE)
    Sleep( $Slummerzeit)
    $State_NF = GUISetState(@SW_SHOW)
    Case $Button2
    _SoundClose($Soundopen)
    Exit

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

    EndSwitch
    WEnd

    [/autoit]

    Also das Problem ist dieses !: Is die UHRzeit erreicht die angeben wurde soll sich eine 2. gui öffnen(Hauptform) und ein Sound(Weck_sound.wav) das Problem ist das das ich auf die Buttons von Gui(hauptform) nich drauf klicken kann wenn sie sich öffnet! Also es sieht so aus wie wen er gedrückt wäre aber es passier einfach nix!

  • Versteh ich nich ?( ?( ?( ?( ?( Ich weis was ne Endloseschleife is aber ehm ja wo ??? is das problem an der endlosenschleife

  • Wie soll er da wieder rauskommen?

    Twitter: @L3viathan2142
    Benutze AutoIt persönlich nicht mehr, da ich keinen Windows-Rechner mehr besitze.

  • Hallo MrMultiBot,

    so sollte es funktionieren:

    Spoiler anzeigen
    [autoit]

    #include <sound.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <date.au3>

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

    #region ### START Koda GUI section ### Form=
    ;NebenForm

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

    $Form1_1 = GUICreate("Wecker...by...Mr.Multibot", 373, 73, 192, 127)
    GUISetIcon("Icon.ico")
    $Input2 = GUICtrlCreateInput("", 264, 8, 97, 21)
    $Label1 = GUICtrlCreateLabel("Aktuelle Zeit: " & _NowTime(), 8, 8, 145, 21)
    $Label2 = GUICtrlCreateLabel("Weckzeit", 184, 8, 61, 17)
    $Button3 = GUICtrlCreateButton("!!!!START!!!!", 8, 40, 353, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $State_NF = GUISetState(@SW_SHOW)

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

    ;Hauptform
    $Form1 = GUICreate("Wecker...by...Mr.Multibot", 251, 201, 243, 148)
    GUISetIcon("Icon.ico")
    $Pic1 = GUICtrlCreatePic("Bild.gif", 8, 8, 233, 153, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("SLEEP", 8, 168, 113, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("STOP", 128, 168, 113, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    ;$State_HF = GUISetState(@SW_HIDE)
    #endregion ### END Koda GUI section ###

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

    $Soundopen = _SoundOpen("Weck_sound.wav")
    While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[1]
    Case $Form1_1
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button3
    GUISetState(@SW_SHOW, $Form1)
    GUISetState(@SW_HIDE, $Form1_1)
    $Weckzeit = GUICtrlRead($Input2)
    While 1
    If _NowTime(4) = $Weckzeit Then ;ursprünglich 5
    AdlibRegister("Aufwachen",5000)
    ;$State_HF = GUISetState(@SW_SHOW)
    ExitLoop
    EndIf
    Sleep(40)
    WEnd
    EndSwitch
    Case $Form1
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    _SoundStop($Soundopen)
    $Slummerzeit = IniRead("option.txt", "Schlummer Funktion", "", "")
    ; $State_NF = GUISetState(@SW_HIDE)
    AdlibUnRegister("Aufwachen")
    Sleep($Slummerzeit)
    AdlibRegister("Aufwachen",5000)
    ; $State_NF = GUISetState(@SW_SHOW)
    Case $Button2
    AdlibUnRegister("Aufwachen")
    _SoundClose($Soundopen)
    GUISetState(@SW_HIDE, $Form1)
    GUISetState(@SW_SHOW, $Form1_1)
    EndSwitch
    EndSwitch
    WEnd

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

    Func Aufwachen()
    ConsoleWrite("Aufwachen" & @CRLF)
    _SoundPlay($Soundopen)
    EndFunc ;==>Aufwachen

    [/autoit]

    mfg (Auto)Bert

  • Hallo MrMultiBot,

    jetzt klappts (sogar noch mit kleinem opt. Gimmick):

    Spoiler anzeigen
    [autoit]

    #include <sound.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <date.au3>

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

    #region ### START Koda GUI section ### Form=
    ;NebenForm

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

    $Form1_1 = GUICreate("Wecker...by...Mr.Multibot", 373, 73, 192, 127)
    GUISetIcon("Icon.ico")
    $Input2 = GUICtrlCreateInput("", 264, 8, 97, 21)
    $Label1 = GUICtrlCreateLabel("Aktuelle Zeit: " & _NowTime(), 8, 8, 145, 21)
    $Label2 = GUICtrlCreateLabel("Weckzeit", 184, 8, 61, 17)
    $Button3 = GUICtrlCreateButton("!!!!START!!!!", 8, 40, 353, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $State_NF = GUISetState(@SW_SHOW)

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

    ;Hauptform
    $Form1 = GUICreate("Wecker...by...Mr.Multibot", 251, 201, 243, 148)
    GUISetIcon("Icon.ico")
    $Pic1 = GUICtrlCreatePic("Bild.gif", 8, 8, 233, 153, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("SLEEP", 8, 168, 113, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("STOP", 128, 168, 113, 25, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    ;$State_HF = GUISetState(@SW_HIDE)
    #endregion ### END Koda GUI section ###

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

    $Soundopen = _SoundOpen("Weck_sound.wav")
    While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[1]
    Case $Form1_1
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button3
    GUISetState(@SW_SHOW, $Form1)
    GUISetState(@SW_HIDE, $Form1_1)
    $Weckzeit = GUICtrlRead($Input2)
    While 1
    ;If _NowTime(5) = $Weckzeit Then ;ursprünglich
    If _NowTime(4) = StringLeft($Weckzeit,5) Then
    AdlibRegister("Aufwachen",5000)
    ;$State_HF = GUISetState(@SW_SHOW)
    ExitLoop
    EndIf
    Sleep(40)
    WEnd
    EndSwitch
    Case $Form1
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    _SoundStop($Soundopen)
    $Slummerzeit = IniRead("option.txt", "Schlummer Funktion", "", "")
    ; $State_NF = GUISetState(@SW_HIDE)
    AdlibUnRegister("Aufwachen")
    Sleep($Slummerzeit)
    AdlibRegister("Aufwachen",5000)
    ; $State_NF = GUISetState(@SW_SHOW)
    Case $Button2
    AdlibUnRegister("Aufwachen")
    _SoundClose($Soundopen)
    GUISetState(@SW_HIDE, $Form1)
    GUISetState(@SW_SHOW, $Form1_1)
    EndSwitch
    EndSwitch
    WEnd

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

    Func Aufwachen()
    ConsoleWrite("Aufwachen" & @CRLF)
    _SoundPlay($Soundopen)
    $Pos = ControlGetPos($Form1,"",$Pic1)
    for $i = 1 to 50
    ControlMove($Form1,"",$Pic1,$Pos[0]-5,$Pos[1])
    Sleep(10)
    ControlMove($Form1,"",$Pic1,$Pos[0],$Pos[1]-5)
    Sleep(10)
    ControlMove($Form1,"",$Pic1,$Pos[0]+5,$Pos[1])
    Sleep(10)
    ControlMove($Form1,"",$Pic1,$Pos[0],$Pos[1]+5)
    Sleep(10)
    Next
    EndFunc ;==>Aufwachen

    [/autoit]

    die Vorgängerversion klappt auch schon, nur darfst du dann keine Sekunden mehr eingeben. Sekunden werden auch in dieser Version einfach nicht mehr berücksichtigt,

    mfg (Auto)Bert