Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 496 Location: athens Thanks: 121 times Was thanked: 70 time(s) in 66 post(s)
|
Originally Posted by: Video-Chopper Hello everyone!
Does anyone know of a way to actively monitor the state of all of the scripts in a given preset?
I use a lot of scripts for my online shows, and sometimes I run into situations where I need to check whether a script is running or not, and the only way to do that is to open the Settings tab and navigate to the Scripting section that way. Super clunky and slow.
I started working out a vMix UTC instance that has a bunch of scripts as buttons, which is getting me closer to what I want to build, but I can't figure out a way to set up 'Activators' to determine the state of the script, which to me is the biggest part.
In a perfect world, I could have some kind of window, UI, browser, etc. that shows all of the scripts I have in my preset based on the XML so it is always up to date, the current state of those scripts (i.e., Stopped or Running, checked every second or two) and the ability to toggle Start / Stop scripts as needed—bonus points for activators that make the text/button/UI red or green based on their current state, or something like that.
Any thoughts, ideas, discussions, or workarounds on this would be welcome!
Thanks in advance! Hello. A very easy way i have found to be able to check if a script is running or not. Im using it with some of my scripts and it work perfect. I cannot say for sure if it will work for any script but for me is ok Let`s say we have a simple script like this i personally use to overlay 2 cards automatically for some seconds and then off,while it is running Code:
Do While True
sleep (60000)
API.Function("OverlayInput3In", Input:="card1")
sleep (11000)
API.Function("OverlayInput3In", Input:="card2")
sleep (11000)
API.Function("OverlayInput3Out")
sleep (360000)
loop
and we need something to inform us if it is running or not. With the little help from AI thing, i found some code that work for me. So we change the code like this Code:
Try
Do While True
API.Function("SetText", Input:="Script status1", Value:="The script is running", SelectedName:="Message.Text")
sleep (60000)
API.Function("OverlayInput3In", Input:="card1")
sleep (11000)
API.Function("OverlayInput3In", Input:="card2")
sleep (11000)
API.Function("OverlayInput3Out")
sleep (360000)
loop
Catch ex As Exception
' console line that says the error
Console.WriteLine("Σφάλμα: " & ex.Message)
Finally
' do an action
Console.WriteLine("Το script stopped running.")
API.Function("SetText", Input:="Script status1", Value:="The script is not running", SelectedName:="Message.Text")
End Try
So what we have here? We begin code with "Try" and then we finish it with "End Try". Then we have a vmix input title that when the script start to run it will write something we assign. Then if we stop the script or it stopped itself for any reason,it will write the text we have in the section "catch ex As Exception". So it is a simple workaround to know if a script is running or not. Of course we can use if need dynamic values or anything else to proceed further. And with use of triggers in bitfocus companion (or other 3rd party similar program) we can do automation of things when the script start/stop and have a some kind of "activator status". Hope that this helps and also if anyone has ideas for better improvement, hope he want to share.
|