Rank: Member
Groups: Registered
Joined: 2/11/2020(UTC) Posts: 10
|
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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,222 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"
|
|
|
|
Rank: Member
Groups: Registered
Joined: 2/11/2020(UTC) Posts: 10
|
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?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,222 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: cashmuny03 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/16/2020(UTC) Posts: 77 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
|
|
|
|
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.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close