Here is a very simple script that will work with a countdown timer made in GT designer - dropbox link attached.
as it gets closer to the end of the countdown it goes from green (plus 5 mins) to yellow (5 - 2 mins) to red (0 - 2 mins) and flashes red/white once it runs out of time.
It uses the countdownclock.gtzip which is just a simple countdown timer.
Its been working on multiple events and keeping speakers to time as best as possible, as we send it back on a reverse feed on all the vimxcallers.
As far as I can tell It does not handle time that crosses midnight - as most of the events I do are across the day its not been an issue.
Hope someone finds it useful or as a bit of a jump start into scripting in vmix, as there is not much to go on sometimes.
Enjoy.
https://www.dropbox.com/...ountdownclock.gtzip?dl=0here's is the script for vmix scripting.
dim i As Integer
dim time1 as String
dim hourset as String
dim minset as String
dim secset as String
dim Timemake as string
dim date1 as DateTime
dim remainingtime as TimeSpan
dim rightnow as dateTime
dim flashx as Boolean
dim tClose as Integer
dim tAlmost as Integer
' set parameters
flashx = false
i = 1
tClose = (5*60) ' set to 5 mins - is number of seconds
tAlmost = (2*60) ' set to 2 mins - - is number of seconds
Do Until i = 2
' if you don't have countdownclock.gtzip and a field called Countdown.Text it won't do much
dim content as string = Input.Find("countdownclock.gtzip").Text("CountDown.Text")
'Console.WriteLine(content)
'Console.WriteLine(content.Substring(3,2))
'Console.WriteLine(content.Substring(6,2))
'Console.WriteLine(content.Substring(9,2))
'Console.WriteLine(System.DateTime.Now.ToLongTimeString + " " + content)
rightnow = DateTime.Now
hourset = content.Substring(3,2)
minset = content.Substring(6,2)
secset = content.Substring(9,2)
Timemake = hourset & ":" & minset &":" & secset
'Console.WriteLine(Timemake)
Try
date1 = Convert.ToDateTime(Timemake)
Catch ex As System.Exception
' nothing
End Try
remainingtime = date1.Subtract(rightnow)
console.Writeline("Time Left -" +remainingtime.TotalSeconds.Tostring)
If remainingtime.TotalSeconds > tClose then
API.Function("SetTextColour",Input:="countdownclock.gtzip",Value:="40,200,40")
Else if remainingtime.TotalSeconds < tAlmost then
API.Function("SetTextColour",Input:="countdownclock.gtzip",Value:="255,40,40")
Else
API.Function("SetTextColour",Input:="countdownclock.gtzip",Value:="Yellow")
End if
' Flash when out of time.
if remainingtime.TotalSeconds < 1 then
if flashx = true then
API.Function("SetTextColour",Input:="countdownclock.gtzip",Value:="255,255,255")
flashx = false
Else
API.Function("SetTextColour",Input:="countdownclock.gtzip",Value:="255,40,40")
flashx = true
End if
End if
Sleep (300)
Loop