Hi,
ich habe ein Script, das ein paar Funktionen ausführen soll, aber eine davon soll nicht ausgeführt werden, wenn das Skript nochmal aktiviert wird, während es bereits läuft.
Ich hatte irgendwo gelesen, dass man es mit Singleton machen soll, aber, weil ich ein Anfänger bin und Informatik allgemein kompliziert finde, weiß ich nicht, wie ich es nutzen sollte.
Ich möchte zur Aktivierung des Scripts und zur Aktivierung der Zusatzfunktion denselben Tastaturbutton benutzen. Bisher kriege ich es nicht hin mit meinem Wissen
Code
ControlSend ( "OBS 21.1.0 (64bit, windows) - Profil: Unbenannt - Szenen: Unbenannt", "", "[CLASS:Qt5QWindowIcon; INSTANCE:1]", "+{f12}" ) ;start recording
Send ("+{f4}") ; I need this for the script to trigger _ExtendTime when I press it the second time.
HotKeySet("+{f3}", "_replay") ;
Send ("+{f3}") ;this is what I only want the first time. It saves the replay.
HotKeySet("+{f4}", "_ExtendTime")
AdlibRegister("_StopRecord", 1000*60*15)
;hierhin exit?
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
Alles anzeigen