Hilfe bei sleep

  • Hey, :)
    Mein Script reagiert nicht mehr nach dem ich Start gedrückt habe.
    Ich weiß auch woran es liegt und zwar am sleep .

    [autoit]

    #include <File.au3>
    #include <Array.au3>
    #include <GUIConstants.au3>
    $width = 375
    $height = 354
    $po = 1
    $time = 30000
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", $width,$height, 223, 148)
    $Slider1 = GUICtrlCreateSlider(70,310,209,40)
    GUICtrlSetLimit(-1,3000,180000)
    GUICtrlSetData(-1,3000)
    $stop = GUICtrlCreateButton("Stop",340,315)
    $Start = GUICtrlCreateButton("Start",300,315)
    GUISetBkColor(0xA6CAF0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $height -= 50
    $pics = _FileListToArray(@DesktopDir & "\o","*.jpg",1)
    While 1

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

    if $po==0 Then
    $bild = Random(1,$pics[0],1)
    ;ConsoleWrite($pics[1])
    ;ConsoleWrite($bild)
    $i = $bild
    $pic = GUICtrlCreatePic ( @DesktopDir & "\o" & "\" & $pics[$i], 1, 1,$width,$height)
    Sleep($time)
    GUICtrlDelete($pic)
    EndIf
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
    Exit
    Case $nMsg = $stop
    $po = 1
    Case $nMsg = $start
    $po = 0
    Case $nMsg = $Slider1
    $time = GUICtrlRead($Slider1)
    EndSelect
    WEnd

    [/autoit]


    Könntet ihr mir eine Funktion zeigen mit der ich das machen kann .

    Gruß L3w3x

  • Hi!


    Meinst du veileicht so???

    Spoiler anzeigen
    [autoit]

    #include <File.au3>
    #include <Array.au3>
    #include <GUIConstants.au3>
    $width = 375
    $height = 354
    $po = 1
    $i = 1
    $time = 30000
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", $width, $height, 223, 148)
    $Slider1 = GUICtrlCreateSlider(70, 310, 209, 40)
    GUICtrlSetLimit(-1, 3000, 180000)
    GUICtrlSetData(-1, 3000)
    $stop = GUICtrlCreateButton("Stop", 340, 315)
    $Start = GUICtrlCreateButton("Start", 300, 315)
    GUISetBkColor(0xA6CAF0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $height -= 50
    $pics = _FileListToArray("G:\Bilder\SAMMLUNG\JPG", "*.jpg", 1)
    While 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
    Exit
    Case $nMsg = $stop
    $po = 1
    Case $nMsg = $Start
    GUICtrlCreatePic('G:\Bilder\SAMMLUNG\JPG\' & $pics[$i], 0, 0, $width, $height)
    $i += 1
    Case $nMsg = $Slider1
    $time = GUICtrlRead($Slider1)
    EndSelect
    WEnd

    [/autoit]


    EDIT:/ Sorry falsch verstanden! Jetzt aber :rolleyes:

    Spoiler anzeigen
    [autoit]

    $height = 354
    $po = 1
    $i = 1
    $time = 3000
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", $width, $height, 223, 148)
    $Slider1 = GUICtrlCreateSlider(70, 310, 209, 40)
    GUICtrlSetLimit(-1, 3000, 180000)
    GUICtrlSetData(-1, 3000)
    $stop = GUICtrlCreateButton("Stop", 340, 315)
    $Start = GUICtrlCreateButton("Start", 300, 315)
    GUISetBkColor(0xA6CAF0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $height -= 50
    $pics = _FileListToArray("G:\Bilder\SAMMLUNG\JPG", "*.jpg", 1)
    Local $iTimer = TimerInit()

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

    While 1
    If Round(TimerDiff($iTimer)) > $time Then
    GUICtrlCreatePic('G:\Bilder\SAMMLUNG\JPG\' & $pics[$i], 0, 0, $width, $height)
    $i += 1
    $iTimer = TimerInit()
    EndIf
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
    Exit
    Case $nMsg = $stop
    $po = 1
    Case $nMsg = $Start
    GUICtrlCreatePic('G:\Bilder\SAMMLUNG\JPG\' & $pics[$i], 0, 0, $width, $height)
    $i += 1
    Case $nMsg = $Slider1
    $time = StringReplace(GUICtrlRead($Slider1), '-', '')
    EndSelect
    WEnd

    [/autoit]

    LG Kleiner

    Einmal editiert, zuletzt von Kleiner (10. Oktober 2010 um 15:02)

  • hey,

    Das ist noch nicht das was ich wollte :) .

    Das soll von alleine weiter laufen und immer wider eine neues Bild anzeigen und soll wenn ich auf Stop drück anhalten und auf Start wider los gehen :D .

    Und wenn ich den slinder hoch oder runter mache soll sich die zeit verändern so das ich das Bild von 3 sec auf 3 min machen kann und es dann so weiter macht .

    aber trotzdem danke für deine Antwort :thumbup:

    Gruß L3w3x

  • Hi!


    Okay war nicht ganz! :whistling:

    Spoiler anzeigen
    [autoit]

    #include <File.au3>
    #include <Array.au3>
    #include <GUIConstants.au3>
    $width = 375
    $height = 354
    $po = 0
    $i = 1
    $time = 3000
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", $width, $height, 223, 148)
    $Slider1 = GUICtrlCreateSlider(70, 310, 209, 40)
    GUICtrlSetLimit(-1, 3000, 180000)
    GUICtrlSetData(-1, 3000)
    $stop = GUICtrlCreateButton("Stop", 340, 315)
    $Start = GUICtrlCreateButton("Start", 300, 315)
    GUISetBkColor(0xA6CAF0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $height -= 50
    $pics = _FileListToArray("G:\Bilder\SAMMLUNG\JPG", "*.jpg", 1)
    Local $iTimer = TimerInit()

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

    While 1
    If Round(TimerDiff($iTimer)) > $time And $po Then
    GUICtrlCreatePic('G:\Bilder\SAMMLUNG\JPG\' & $pics[$i], 0, 0, $width, $height)
    $i += 1
    $iTimer = TimerInit()
    EndIf
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
    Exit
    Case $nMsg = $stop
    $po = 0
    Case $nMsg = $Start
    $po = 1
    GUICtrlCreatePic('G:\Bilder\SAMMLUNG\JPG\' & $pics[$i], 0, 0, $width, $height)
    $i += 1
    Case $nMsg = $Slider1
    $time = StringReplace(GUICtrlRead($Slider1), '-', '')
    EndSelect
    WEnd

    [/autoit]

    LG Kleiner

  • Ich danke dir für deine Hilfe :thumbup:

    jetzt hat es geklappt :D


    das gleiche hab ich auch noch mal gemacht :D :D :D :D !!!

    Gruß L3w3x

  • Eine andere Möglichkeit ist Adlib:

    Spoiler anzeigen
    [autoit]


    #include <File.au3>
    #include <Array.au3>
    #include <GUIConstants.au3>
    $pic = 0
    $width = 375
    $height = 354
    $time = 3000
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", $width,$height, 223, 148)
    $Slider1 = GUICtrlCreateSlider(70,310,209,40)
    GUICtrlSetLimit($slider1, 18000,3000)
    GUICtrlSetData($slider1, $time)
    $stop = GUICtrlCreateButton("Stop",340,315)
    $Start = GUICtrlCreateButton("Start",300,315)
    GUISetBkColor(0xA6CAF0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $height -= 50
    $path = "..\Images\"
    $pics = _FileListToArray($path,"*.jpg",1)

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

    While 1

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

    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
    AdlibUnRegister("Diashow")
    Exit
    Case $nMsg = $stop
    AdlibUnRegister("Diashow")
    Case $nMsg = $start
    $time = GUICtrlRead($Slider1)
    AdlibRegister("Diashow", $time)
    Case $nMsg = $Slider1
    $time = GUICtrlRead($Slider1)
    AdlibUnRegister("Diashow")
    AdlibRegister("Diashow", $time)
    ConsoleWrite($time & @CRLF)
    EndSelect
    WEnd

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

    Func Diashow()
    GUICtrlDelete($pic)
    $bild = Random(1,$pics[0],1)
    ;ConsoleWrite($pics[1])
    ;ConsoleWrite($bild)
    $i = $bild
    $pic = GUICtrlCreatePic ( $path & $pics[$i], 1, 1,$width,$height)
    EndFunc

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯