#include <Misc.au3>
#include <MsgBoxConstants.au3>
If _Singleton("test", 1) = 0 Then
    ; zweites mal start
	ControlSend ( "OBS 21.1.0 (64bit, windows) - Profil: Unbenannt - Szenen: Unbenannt", "", "[CLASS:Qt5QWindowIcon; INSTANCE:1]", "+{f12}" )      ;start recording
    Send ("+{f4}")
Else
    ;erstes mal start
	ControlSend ( "OBS 21.1.0 (64bit, windows) - Profil: Unbenannt - Szenen: Unbenannt", "", "[CLASS:Qt5QWindowIcon; INSTANCE:1]", "+{f12}" )      ;start recording
	HotKeySet("+{f3}", "_replay")
	Send ("+{f3}")
	AdlibRegister("_StopRecord", 1000*60*1)
 EndIf



HotKeySet("+{f4}", "_ExtendTime")
While 1
    Sleep(20)
WEnd

Func _StopRecord()
	ControlSend ( "OBS 21.1.0 (64bit, windows) - Profil: Unbenannt - Szenen: Unbenannt", "", "[CLASS:Qt5QWindowIcon; INSTANCE:1]", "+{f11}" )
    Exit
 EndFunc

Func _ExtendTime()
    $iTime = 1                              ;stop recording after 15 minutes
    AdlibRegister("_StopRecord", 1000*60*$iTime)
 EndFunc

Func _replay()
ControlSend ( "OBS 21.1.0 (64bit, windows) - Profil: Unbenannt - Szenen: Unbenannt", "", "[CLASS:Qt5QWindowIcon; INSTANCE:1]", "+{f6}" )
EndFunc
Func _Exit()
   Exit
EndFunc
