Ispressed do Until hilfe

  • Hi Ich hab en Problem und zwar Bräuchte ich hilfe dabei dass mein script nach _IsPressed("0D", $dll)
    warte bis die taste losgelassen wird und dann sleep(100) bis sie erneute gedrückt wird und dann fortfährt.
    das alles spielt sich in ner schleife ab, ich hab versucht das so zu lösen aber da es until ispressed is wird beim selben tastendruck der sleep beendet :

    [autoit]

    #Include <Misc.au3>

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

    HotKeySet("{END}", "Schleife")
    HotKeySet("{HOME}", "Close")

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

    While 1
    Sleep(100)
    WEnd

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

    Func Schleife()
    $dll = DllOpen("user32.dll")
    While 1
    If _IsPressed("41", $dll) Then
    Send("y")
    EndIf
    If _IsPressed("53", $dll) Then
    Send("x")
    EndIf
    If _IsPressed("44", $dll) Then
    Send("x")
    EndIf
    If _IsPressed("0D", $dll) Then
    Do
    Sleep(100)
    Until _IsPressed("0D", $dll)
    EndIf
    WEnd
    EndFunc

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

    Func Close()
    Exit 0
    EndFunc

    [/autoit]

    Bin Dankbar für jede hilfe..

    2 Mal editiert, zuletzt von WoEf (23. Juni 2008 um 21:21)

  • Wartet bis die Taste losgelassen wird und macht erst dann das sleep.

    [autoit]

    #Include <Misc.au3>

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

    If _IsPressed("0D") Then
    Do
    Until Not _IsPressed("0D")
    Do
    Sleep(100)
    Until _IsPressed("0D")
    EndIf

    [/autoit]

    MFG RAPTOR-ONE

  • Vielleicht andere Möglichkeit ohne Do...Until

    Spoiler anzeigen
    [autoit]

    If _IsPressed("0D") Then
    While _IsPressed("0D")
    Sleep(5)
    WEnd
    sleep(100)
    EndIf

    [/autoit]

    Also

    Spoiler anzeigen
    [autoit]

    #Include <Misc.au3>

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

    HotKeySet("{END}", "Schleife")
    HotKeySet("{HOME}", "Close")

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

    While 1
    Sleep(100)
    WEnd

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

    Func Schleife()

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

    While 1
    $dll = DllOpen("user32.dll")

    If _IsPressed("41", $dll) Then
    Send("y")
    EndIf

    If _IsPressed("53", $dll) Then
    Send("x")
    EndIf

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

    If _IsPressed("44", $dll) Then
    Send("x")
    EndIf

    If _IsPressed("0D") Then
    While _IsPressed("0D")
    Sleep(5)
    WEnd
    sleep(100)
    EndIf
    Wend

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

    EndFunc

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

    Func Close()
    Exit 0
    EndFunc

    [/autoit]

    mfg anno2008

  • nee, sry, ich hab das total falsch verstanden, ich hab gedacht, er sollte 100 ms sekunden warten, nachdem Enter wieder losgelassen is, also mein Script unktioniert auf jeden Fall ned mit dem Ergebnis, das du haben willst, SRY

  • Hi
    Hab ma was geabstelt:
    /Edit: Script Verbessert

    Spoiler anzeigen
    [autoit]

    #Include <Misc.au3>

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

    HotKeySet("{END}", "Schleife")
    HotKeySet("{HOME}", "Close")

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

    While 1
    Sleep(100)
    WEnd

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

    Func Schleife()
    $dll = DllOpen("user32.dll")
    While 1
    If _IsPressed("41", $dll) Then
    Send("y")
    EndIf
    If _IsPressed("53", $dll) Then
    Send("x")
    EndIf
    If _IsPressed("44", $dll) Then
    Send("x")
    EndIf

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

    If _IsPressed("0D", $dll) Then
    While _IsPressed("0D", $dll)
    Sleep(5)
    WEnd
    MsgBox(0,"","Anfang des Sleeps")

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

    Do
    Sleep(5)
    Until _IsPressed("0D", $dll)
    While _IsPressed("0D", $dll)
    Sleep(5)
    WEnd
    msgbox(0,"","Ende des Sleeps")
    EndIf
    WEnd
    EndFunc ;==>Schleife

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

    Func Close()
    Exit 0
    EndFunc ;==>Close

    [/autoit]

    Einmal editiert, zuletzt von anno2008 (23. Juni 2008 um 20:53)