logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
alexbyrd  
#1 Posted : Sunday, October 11, 2020 10:48:43 PM(UTC)
alexbyrd

Rank: Newbie

Groups: Registered
Joined: 5/3/2015(UTC)
Posts: 8
Location: UK

Was thanked: 1 time(s) in 1 post(s)
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=0

here'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
Reinaldo  
#2 Posted : Monday, October 12, 2020 1:45:49 AM(UTC)
Reinaldo

Rank: Advanced Member

Groups: Registered
Joined: 5/24/2014(UTC)
Posts: 34
Man
Location: Brazil

Thanks: 43 times
Was thanked: 4 time(s) in 2 post(s)
Hi Alexbyrd, the dropbox link isnt functional.
Thanks
alexbyrd  
#3 Posted : Tuesday, October 13, 2020 3:51:38 AM(UTC)
alexbyrd

Rank: Newbie

Groups: Registered
Joined: 5/3/2015(UTC)
Posts: 8
Location: UK

Was thanked: 1 time(s) in 1 post(s)
link fixed - thanks for letting me know.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.