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
cashmuny03  
#1 Posted : Wednesday, November 11, 2020 2:30:56 AM(UTC)
cashmuny03

Rank: Member

Groups: Registered
Joined: 2/11/2020(UTC)
Posts: 10
United States

I'm having a hard time scripting my scoreboard. I'm trying to make it so when the playclock gets down to 5 and below it will turn the background red. Right now it turns red when it's 5 or 52. It just sees the first digit. How do I modify my code to make it see the correct order of the numbers 5,4,3,2,1?

Here's what I have

dim i = Input.Find("football scoreboard.gtzip")

Do

dim playclock
playclock = i.Text("Playclock.Text")

if playclock <= "5"
API.Function("SetTextColour",Input:="football scoreboard.gtzip",Value:="#BF0000",SelectedName:="Playclock BG.Text" )
else
API.Function("SetTextColour",Input:="football scoreboard.gtzip",Value:="#000000",SelectedName:="Playclock BG.Text" )
end if

Sleep(100)
Loop
doggy  
#2 Posted : Wednesday, November 11, 2020 2:48:46 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
you are trying to compare a string to a value(number)
Wonder if you are pulling the data from the correct part of a time string unless its just a "count"
cashmuny03  
#3 Posted : Wednesday, November 11, 2020 4:15:43 AM(UTC)
cashmuny03

Rank: Member

Groups: Registered
Joined: 2/11/2020(UTC)
Posts: 10
United States

Thanks for responding. I'm pretty new to scripting but the data from the scoreboard is just a simple count down from 40. Everything works except my script. Can you point me in the right direction as far as the code?
doggy  
#4 Posted : Wednesday, November 11, 2020 4:37:08 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: cashmuny03 Go to Quoted Post
Thanks for responding. I'm pretty new to scripting but the data from the scoreboard is just a simple count down from 40. Everything works except my script. Can you point me in the right direction as far as the code?


So you have a countdown from 40 but the script isn't working because Right now it turns red when it's 5 or 52.

As mentioned before your are evaluating the content of a string against a numeric value (and its taking the first character from the string to compare). one way is to convert the string (Text) to a value ( integer number) and compare it to a integer value (number) (not compare apples with oranges)

Check up on vb,net coding (google) as that is what the script's language is
Papo  
#5 Posted : Thursday, November 12, 2020 1:17:16 PM(UTC)
Papo

Rank: Advanced Member

Groups: Registered
Joined: 6/16/2020(UTC)
Posts: 77
Peru

Thanks: 8 times
Was thanked: 2 time(s) in 2 post(s)
I do not know I have not tried it in vmix but at first glance, try with this code, the quotes in the "5" should be removed and the playclock variable must be of type integer; all this bearing in mind that it is a countdown with format only seconds ss ...... translated from Spanish to English by google translator

dim i = Input.Find("football scoreboard.gtzip")
dim playclock as integer
Do

playclock = i.Text("Playclock.Text")

if playclock <= 5
API.Function("SetTextColour",Input:="football scoreboard.gtzip",Value:="#BF0000",SelectedName:="Playclock BG.Text" )
else
API.Function("SetTextColour",Input:="football scoreboard.gtzip",Value:="#000000",SelectedName:="Playclock BG.Text" )
end if

Sleep(100)
Loop
Users browsing this topic
Guest (2)
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.