Frage zu einem Script

  • Hallo,
    da ich noch relativ neu in AutoIT bin(seit 2 Tage) kommt hier meine erste Frage:
    Ich hab probiert einen Steam- AFK Script zu schreiben. Nun zum Problem:
    Er beendet das Script einfach ohne irgenwas zu machen. Ich weiß nicht was ich am
    Code noch ändern soll...
    Hier ist der Code:

    [autoit]

    HotKeySet ("{right}", "afk")
    Func afk ()
    while 1
    Do
    WInwaitactive (" - Chat")
    Send ("Hallo,ich bin gerade beschäftigt!")
    send ("{enter}")
    sleep (100)
    Send ("Ich werde sobald ich Zeit hab antworten!")
    Send ("{enter}")
    Sleep (100)
    WinClose ( " - Chat" )
    Until WinWaitActive ( " - Chat")
    Wend
    EndFunc

    [/autoit]


    P.S Die Funktion zum schließen hab ich noch nicht eingebaut

    MfG sLaXX

  • [autoit]

    HotKeySet ("{right}", "afk")

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

    While 1
    sLeep(100)
    WEnd

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

    Func afk ()
    while 1
    Do
    WInwaitactive (" - Chat")
    Send ("Hallo,ich bin gerade beschäftigt!")
    send ("{enter}")
    sleep (100)
    Send ("Ich werde sobald ich Zeit hab antworten!")
    Send ("{enter}")
    Sleep (100)
    WinClose ( " - Chat" )
    Until WinWaitActive ( " - Chat")
    Wend
    EndFunc

    [/autoit]

    so vielleicht ?

    Edit: Maaaan... schon wieder zu langsam

  • Spoiler anzeigen
    [autoit]

    HotKeySet ("{right}", "afk")

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

    While 1
    sleep(250)
    WEnd

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

    Func afk ()
    while 1
    WInwaitactive (" - Chat")
    Send ("Hallo,ich bin gerade beschäftigt!")
    send ("{enter}")
    sleep (100)
    Send ("Ich werde sobald ich Zeit hab antworten!")
    Send ("{enter}")
    Sleep (100)
    WinClose ( " - Chat" )
    Wend
    EndFunc

    [/autoit]

    edit: argh, ma wieda zuu spät :rolleyes: Joa habs so wie SilenCa.. nur die Do-Until Schleife ist unnötig..

  • Funzt leider net der öffnet das Chat Fenster net ich hab es mit WinActive probiert geht aba leider nicht naja egal


    MfG sLaXX

  • Wenn das fenster minimiert ist, kannst es mit WinActivate() aktivieren. dann WinWaitActive...