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
Riddlez  
#1 Posted : Saturday, May 29, 2021 1:00:58 PM(UTC)
Riddlez

Rank: Newbie

Groups: Registered
Joined: 3/11/2021(UTC)
Posts: 8

Hi everyone.

I'm trying to create a timer that only displays the timer/countdown in seconds. Is this possible?

I see that the Display Format allows you to add the timer as HH:mm, HH:mm:ss, ss and a few others. But I'd love it to be "ssss" as I need to display seconds from 0 to 5000 continuously

Can this be done, through countdown or with scripts?
doggy  
#2 Posted : Saturday, May 29, 2021 4:43:48 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,223
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Time formats follow the normal time rules

Script will do that for you

https://www.google.com/s...wAhUKahQKHYmcBoYQ4dUDCA4
Peter1000  
#3 Posted : Saturday, May 29, 2021 5:40:46 PM(UTC)
Peter1000

Rank: Advanced Member

Groups: Registered
Joined: 1/25/2019(UTC)
Posts: 303
Switzerland

Thanks: 17 times
Was thanked: 79 time(s) in 60 post(s)
if you only want to display seconds, counting up, there is a very simple solution

make a new script

copy this in:
Code:
dim second as integer =0

do while true
API.Function("SetText",Input:="Title 0- The Classic Blue.gtzip",SelectedIndex:="1" ,Value:=second)
second = second + 1
sleep (1000)
loop

load the Title Title 0- The Classic Blue.gtzip from the predefined Titles.
start the script
the script passes the value to the Title and puts it in the first field.

to stop or reset the time, some coding is needed again.
To implement more complex time displays, follow the link in doggy's post.
Riddlez  
#4 Posted : Saturday, May 29, 2021 6:00:12 PM(UTC)
Riddlez

Rank: Newbie

Groups: Registered
Joined: 3/11/2021(UTC)
Posts: 8

Originally Posted by: doggy Go to Quoted Post
Time formats follow the normal time rules

Script will do that for you

https://www.google.com/s...wAhUKahQKHYmcBoYQ4dUDCA4


Cheers that makes sense. Thanks for your help Doggy your help is much appreciated!

doggy  
#5 Posted : Saturday, May 29, 2021 6:49:17 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,223
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
As peter1000's answer is the basic way to go , but if you want to play with date/time data and some formatting (not just for counting up seconds) ;-)

Code:
dim StartTime as DateTime
Dim ts As TimeSpan 
Dim NowTime As DateTime

do while true
  StartTime = DateTime.Now()
  dim total as integer = 0

  do while total < 10
    NowTime = DateTime.Now()
    ts = NowTime.Subtract(StartTime)
    total = ((ts.Hours * 60) + ts.Minutes) * 60 + ts.Seconds

    API.Function("SetText",Input:="sometitle.gtzip",SelectedName:="Headline.Text",Value:=string.Format("T:{0,4}",total))
    'console.writeline((string.Format("T:{0,4}", total)))

    sleep(1000)

  Loop
Loop
doggy  
#6 Posted : Saturday, May 29, 2021 7:01:48 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,223
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
;-)

Code:
API.Function("SetText",Input:="greenmod.gtzip",SelectedName:="Headline.Text",Value:="0")

Do while true
sleep(1000)
API.Function("SetText",Input:="greenmod.gtzip",SelectedName:="Headline.Text",Value:="+=1")
Loop
Users browsing this topic
Guest
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.