programm zu bestimmter zeit ausführen

  • hi leute!

    ich hab jetz ein script geschrieben das ein programm zu einer bestimmten uhrzeit ausführen soll nur leider ist bei warten die prozessorleistung ziemlich hoch und das is nu nich so toll habt ihr da vllt einen schonenderen weg für mich?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    ; Hotkeys
    HotKeySet("{esc}","kill")
    HotKeySet("{f9}","show")
    HotKeySet("{f10}","hide")

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

    ; GUI
    $gui1 = GUICreate("",200,55,-1,-1)

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

    ; Input
    $box = GUICtrlCreateInput("",5,5,92,20)
    $box2 = GUICtrlCreateInput("",5,30,190,20)

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

    ; Button
    $b1 = GUICtrlCreateButton("OK",102,5,93,20)
    GUISetState()

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

    ; Hauptschleife
    While 1
    $ziel = GUICtrlRead($box2)
    $bla = GUICtrlRead($box)
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $b1
    GUISetState(@sw_hide,$gui1)
    while 1
    if $bla = @hour & @min & @sec Then
    If GUICtrlRead($box2) = "..." Then Shutdown(1)
    If GUICtrlRead($box2) = "..." Then Shutdown(2)
    If GUICtrlRead($box2) = "..." Then Run("C:\...")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Shutdown(48)
    If GUICtrlRead($box2) = "..." Then Exitloop
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Shutdown(0)
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run ("C:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    sleep(1000)
    Exit

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

    EndIf

    wend
    EndSelect
    Wend

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

    Exit

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

    ;----------------------------Func

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

    func kill()
    Exit
    EndFunc

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

    func show()
    GUISetState(@sw_show,$gui1)
    EndFunc

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

    func hide()
    GUISetState(@sw_hide,$gui1)
    EndFunc

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

    ;----------------------------EndFunc

    [/autoit]

    also vllt wisst ihr da ja was^^ ;)

    thx im voraus

    • Offizieller Beitrag

    Hallo

    Sleep. Ich hoffe bis zu 50 Millisekunden(0.05 Sekunden) später ist nicht schlimm^^

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

    ; Hotkeys
    HotKeySet("{esc}","kill")
    HotKeySet("{f9}","show")
    HotKeySet("{f10}","hide")

    ; GUI
    $gui1 = GUICreate("",200,55,-1,-1)

    ; Input
    $box = GUICtrlCreateInput("",5,5,92,20)
    $box2 = GUICtrlCreateInput("",5,30,190,20)

    ; Button
    $b1 = GUICtrlCreateButton("OK",102,5,93,20)
    GUISetState()

    ; Hauptschleife
    While 1
    $ziel = GUICtrlRead($box2)
    $bla = GUICtrlRead($box)
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $b1
    GUISetState(@sw_hide,$gui1)
    while 1
    if $bla = @hour & @min & @sec Then
    If GUICtrlRead($box2) = "..." Then Shutdown(1)
    If GUICtrlRead($box2) = "..." Then Shutdown(2)
    If GUICtrlRead($box2) = "..." Then Run("C:\...")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Shutdown(48)
    If GUICtrlRead($box2) = "..." Then Exitloop
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Shutdown(0)
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run ("C:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("C:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    If GUICtrlRead($box2) = "..." Then Run("D:\")
    sleep(1000)
    Exit

    EndIf
    Sleep(50)
    wend
    EndSelect
    Wend

    Exit

    ;----------------------------Func

    func kill()
    Exit
    EndFunc

    func show()
    GUISetState(@sw_show,$gui1)
    EndFunc

    func hide()
    GUISetState(@sw_hide,$gui1)
    EndFunc

    ;----------------------------EndFunc

    [/autoit]

    Mfg spider

  • ok hab gerade festgestellt,dass wenn ich das ging gestartet hab wird es ja auf hide gesetzt aber wenn ich es dann wieda auf show mach und schließen drücke passiert nix!?

    hat da einer ne idee???

    script : siehe oben ;)

  • hat denn keine ne idee??? wie man das machen könnte, dass man das fenster auch nach einen klick auf schließen geschlossen wird???

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

    ; Hotkeys
    HotKeySet("{esc}","kill")
    HotKeySet("{f9}","show")
    HotKeySet("{f10}","hide")

    ; GUI
    $gui1 = GUICreate("",200,55,-1,-1)

    ; Input
    $box = GUICtrlCreateInput("",5,5,92,20)
    $box2 = GUICtrlCreateInput("",5,30,190,20)

    ; Button
    $b1 = GUICtrlCreateButton("OK",102,5,93,20)
    GUISetState()

    ; Hauptschleife
    While 1
    $ziel = GUICtrlRead($box2)
    $bla = GUICtrlRead($box)
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $b1
    GUISetState(@sw_hide,$gui1)
    while 1
    if $bla = @hour & @min & @sec Then
    If GUICtrlRead($box2) = "test" Then run("notepad.exe")

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

    sleep(1000)
    Exit

    EndIf
    Sleep(50)
    wend
    EndSelect
    Wend

    Exit

    ;----------------------------Func

    func kill()
    Exit
    EndFunc

    func show()
    GUISetState(@sw_show,$gui1)
    EndFunc

    func hide()
    GUISetState(@sw_hide,$gui1)
    EndFunc

    ;----------------------------EndFunc

    [/autoit]

    thx im voraus ;)

    • Offizieller Beitrag

    Hi,

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    ; Hotkeys
    HotKeySet("{esc}", "kill")
    HotKeySet("{f9}", "show")
    HotKeySet("{f10}", "hide")

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

    ; GUI
    $gui1 = GUICreate("", 200, 55, -1, -1)

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

    ; Input
    $box = GUICtrlCreateInput("", 5, 5, 92, 20)
    $box2 = GUICtrlCreateInput("", 5, 30, 190, 20)

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

    ; Button
    $b1 = GUICtrlCreateButton("OK", 102, 5, 93, 20)
    GUISetState()
    Global $state = 0

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

    ; Hauptschleife
    While 1
    $ziel = GUICtrlRead($box2)
    $bla = GUICtrlRead($box)
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $b1
    GUISetState(@SW_HIDE, $gui1)
    $state = Not $state
    EndSelect
    If $state Then
    If $bla = @HOUR & @MIN & @SEC Then
    If GUICtrlRead($box2) = "test" Then Run("notepad.exe")
    Sleep(1000)
    Exit
    EndIf
    EndIf
    WEnd

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

    Exit

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

    ;----------------------------Func

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

    Func kill()
    Exit
    EndFunc ;==>kill

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

    Func show()
    GUISetState(@SW_SHOW, $gui1)
    EndFunc ;==>show

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

    Func hide()
    GUISetState(@SW_HIDE, $gui1)
    EndFunc ;==>hide

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

    ;----------------------------EndFunc

    [/autoit]

    So long,

    Mega

  • Hallo

    Keliner Vorschlag noch: das Icon unten rechts (Tray) würde ich wegnehmen.

    Gruss, Lina.

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    OuBVU5ebLhHu5QvlnAyQB4A7SzBrvWulwL7RLl2BdH5tI6sIYspeMKeXMSXl

    Einmal editiert, zuletzt von Alina (23. Oktober 2007 um 00:13)

  • jo thx hab ich ganz vergessen^^ ;)

    und für alle die nicht wissen wie das geht:

    entweder

    [autoit]

    #notrayicon ; wird ganz nach oben in das script geschrieben

    [/autoit]

    oder

    [autoit]

    Opt("TrayIconHide", 0) ; schreibt man unter #include wenn vorhanden

    [/autoit]

    Einmal editiert, zuletzt von .::Mignon::. (23. Oktober 2007 um 00:44)