Hilft das vielleicht? Keine Zeitversetzung, und dürfte auch mit ner Do-Until Schleife funktionieren.
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
HotKeySet("{esc}","_ende")
[/autoit] [autoit][/autoit] [autoit]$go=False
[/autoit] [autoit][/autoit] [autoit]Run("notepad.exe")
[/autoit] [autoit][/autoit] [autoit]$MainGUI = GUICreate("MainGUI", 258, 108, Default, Default)
$Start = GUICtrlCreateButton("Start", 24, 40, 89, 33, $WS_GROUP)
$Stop = GUICtrlCreateButton("Stop", 136, 40, 89, 33, $WS_GROUP)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
$go=True
$timer=TimerInit()
While $go * sleep(10)
If GUIGetMsg() = $Stop Then $go=False
If TimerDiff($timer) > 200 Then
ControlSend("Unbenannt - Editor","","[CLASS:Edit; INSTANCE:1]","test"&@CRLF)
$timer=TimerInit()
EndIf
WEnd
Case $Stop
$go=False
EndSwitch
WEnd
Func _ende()
Exit
EndFunc
Hier die While schleife nochmal als Do-Until
Spoiler anzeigen
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
$go=True
$timer=TimerInit()
Do
sleep(10)
If GUIGetMsg() = $Stop Then $go = False
If TimerDiff($timer) > 200 Then
ControlSend("Unbenannt - Editor","","[CLASS:Edit; INSTANCE:1]","test"&@CRLF)
$timer=TimerInit()
EndIf
Until $go = False ; OR _IsPressed(18) OR ...
Case $Stop
$go=False
EndSwitch
WEnd