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
Salleman  
#1 Posted : Tuesday, March 21, 2023 10:01:15 PM(UTC)
Salleman

Rank: Member

Groups: Registered
Joined: 3/13/2020(UTC)
Posts: 25
Sweden
Location: Stockholm

Thanks: 2 times
Hey all

We broadcast Hockey and during a normal game night, around 8-20 matches are played at the same time

We have built a script that follows the other ongoing match results and presents a sound and graphics on the main screen at the same time during our game to present goals in other matches.

It works well, but needs some improvements.

Before all matches start we get in "DataIn", the time when the game starts (ex: 19:00) and as soon as the game is started it changes to "(0 - 0)". When the match is over, the parentheses around the result "0 - 0" disappear if the match ended as in this example without a goal.
Problem:
If you have 20 matches on a match night, the match goes from 19:00 to (0 - 0) and it is shown and sounded on the screen. Lots of pling :-)

Desired solution:
Any "DataIn" changes without parentheses "()" we want to make sure the script just skips and takes no action.

This is a short version of the script with only 2 matches coverage, but I think you guys get the picture and can give me suggestions on what to add to make sure it doesn't show changes in match results but just move on to the next match goal stats

Bonus question.
What to add to the script to tell vMix to change text in "Title.text" from "Goal" to "GameOn" and after the match from "Goal" to "GameOver"
If this can be resolved, we can continue to show when other games start and the final score but skip the "Pling" sound.

Scripts today:

dim oldresult001 as string = ""
dim Serie1G1Result as string = ""

dim oldresult002 as string = ""
dim Serie1G2Result as string = ""

do while true
Serie1G1Result = Input.Find("SERIE1").Text("G1Result.Text")
if not (Serie1G1Result = oldresult001)
API.Function("SetImageVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1HomeLogo.Source")
API.Function("SetImageVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1AwayLogo.Source")
API.Function("SetTextVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1Result.Text")
API.Function("Play", Input:="Goal-Pling")
sleep(300)
API.Function("OverlayInput4In", Input:="GoalServiceTitle")
sleep(5000)
API.Function("OverlayInput4Out", Input:="GoalServiceTitle")
sleep(500)
API.Function("SetImageVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1HomeLogo.Source")
API.Function("SetImageVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1AwayLogo.Source")
API.Function("SetTextVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1Result.Text")
oldresult001 = Serie1G1Result
sleep(1000)
end if

Serie1G2Result = Input.Find("SERIE1").Text("G2Result.Text")
if not (Serie1G2Result = oldresult002)
API.Function("SetImageVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game2", SelectedName:="G2HomeLogo.Source")
API.Function("SetImageVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game2", SelectedName:="G2AwayLogo.Source")
API.Function("SetTextVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game2", SelectedName:="G2Result.Text")
API.Function("Play", Input:="Goal-Pling")
sleep(300)
API.Function("OverlayInput4In", Input:="GoalServiceTitle")
sleep(5000)
API.Function("OverlayInput4Out", Input:="GoalServiceTitle")
sleep(500)
API.Function("SetImageVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game2", SelectedName:="G2HomeLogo.Source")
API.Function("SetImageVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game2", SelectedName:="G2AwayLogo.Source")
API.Function("SetTextVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game2", SelectedName:="G2Result.Text")
oldresult002 = Serie1G2Result
sleep(1000)
end if

loop
doggy  
#2 Posted : Wednesday, March 22, 2023 3:28:24 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Salleman Go to Quoted Post
and it is shown and sounded on the screen. Lots of pling :-)


pin ball machine ? ;-)

Quote:

Desired solution:
Any "DataIn" changes without parentheses "()" we want to make sure the script just skips and takes no action.


do a check on the string for containing these characters or not




Salleman  
#3 Posted : Thursday, March 23, 2023 5:29:31 AM(UTC)
Salleman

Rank: Member

Groups: Registered
Joined: 3/13/2020(UTC)
Posts: 25
Sweden
Location: Stockholm

Thanks: 2 times
This is what the graphic looks like from which we get the data.


Match 1 before start:
HSK HC  19:00   VIS IF

Match 1 current match:
HSK HC  (0 - 0)  VIS IF

Match 1 after the match:
HSK HC    0 - 0   VIS IF

So how can we distinguish these 3 different statuses of the match in the script?

19:00

(0 - 0)

0 - 0
Salleman  
#4 Posted : Thursday, March 23, 2023 5:59:05 AM(UTC)
Salleman

Rank: Member

Groups: Registered
Joined: 3/13/2020(UTC)
Posts: 25
Sweden
Location: Stockholm

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salleman Go to Quoted Post
and it is shown and sounded on the screen. Lots of pling :-)


pin ball machine ? ;-)

Quote:

Desired solution:
Any "DataIn" changes without parentheses "()" we want to make sure the script just skips and takes no action.


do a check on the string for containing these characters or not






ok, I will look for the string but the tricky part is status shift from ongoing game to finished game when both contain - but finished game lack of ()

Do you have any good links to me to read about codes regarding this?

and yes it sounds as pinball games at 19:00 each game night 😁
doggy  
#5 Posted : Thursday, March 23, 2023 6:03:17 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Salleman Go to Quoted Post
This is what the graphic looks like from which we get the data.


Match 1 before start:
HSK HC  19:00   VIS IF

Match 1 current match:
HSK HC  (0 - 0)  VIS IF

Match 1 after the match:
HSK HC    0 - 0   VIS IF

So how can we distinguish these 3 different statuses of the match in the script?

19:00

(0 - 0)

0 - 0


one has : in it
the others have - in it of which one of them has ( and ) in it

use some vb.net coding in your script to search for their existence and performs actions accordingly

Google "vb.net search for characters in a string" for example
thanks 1 user thanked doggy for this useful post.
Salleman on 3/23/2023(UTC)
Salleman  
#6 Posted : Thursday, March 23, 2023 7:08:57 AM(UTC)
Salleman

Rank: Member

Groups: Registered
Joined: 3/13/2020(UTC)
Posts: 25
Sweden
Location: Stockholm

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salleman Go to Quoted Post
This is what the graphic looks like from which we get the data.


Match 1 before start:
HSK HC  19:00   VIS IF

Match 1 current match:
HSK HC  (0 - 0)  VIS IF

Match 1 after the match:
HSK HC    0 - 0   VIS IF

So how can we distinguish these 3 different statuses of the match in the script?

19:00

(0 - 0)

0 - 0


one has : in it
the others have - in it of which one of them has ( and ) in it

use some vb.net coding in your script to search for their existence and performs actions accordingly

Google "vb.net search for characters in a string" for example



I "think" it is these 3 variations of find special characters and that will return yes or no or will it be true or false?
*************
Function ContainsSpecialChars(s As String) As Boolean
Return s.IndexOfAny("()".ToCharArray) <> -1
End Function

Function ContainsSpecialChars(s As String) As Boolean
Return s.IndexOfAny("-".ToCharArray) <> -1
End Function

Function ContainsSpecialChars(s As String) As Boolean
Return s.IndexOfAny(":".ToCharArray) <> -1
End Function
*******************
Regardless, I can't find how to build on the script, how to save the result with an "if", "if not" and how to combine the query to distinguish "(-)" vs just "-"

Do you enter the vMix api script within "Function/End Function" or is it a separate IF/END IF statement?


I'll have to look more in the vMix forum and it will surely appear :-)
doggy  
#7 Posted : Thursday, March 23, 2023 7:49:59 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Salleman Go to Quoted Post

I'll have to look more in the vMix forum and it will surely appear :-)


https://forums.vmix.com/posts/t20986-Scripting-for-Dummies
Salleman  
#8 Posted : Thursday, March 23, 2023 9:30:24 PM(UTC)
Salleman

Rank: Member

Groups: Registered
Joined: 3/13/2020(UTC)
Posts: 25
Sweden
Location: Stockholm

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salleman Go to Quoted Post

I'll have to look more in the vMix forum and it will surely appear :-)


https://forums.vmix.com/posts/t20986-Scripting-for-Dummies


Hmm

Function/End Function and Sub/End Sub is not allowed to use what I can see so this was tricky...
doggy  
#9 Posted : Thursday, March 23, 2023 10:14:54 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Salleman Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salleman Go to Quoted Post

I'll have to look more in the vMix forum and it will surely appear :-)


https://forums.vmix.com/posts/t20986-Scripting-for-Dummies


Hmm

Function/End Function and Sub/End Sub is not allowed to use what I can see so this was tricky...


From the helpfiles
Quote:
VB.NET


vMix Scripting supports the majority of VB.NET 2.0 code that will work within a single sub or function.
This means that custom classes and structures are not supported, however you can use the vast majority of the built in base classes in the .NET framework

thanks 1 user thanked doggy for this useful post.
Salleman on 3/23/2023(UTC)
Salleman  
#10 Posted : Friday, March 24, 2023 12:21:38 AM(UTC)
Salleman

Rank: Member

Groups: Registered
Joined: 3/13/2020(UTC)
Posts: 25
Sweden
Location: Stockholm

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salleman Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salleman Go to Quoted Post

I'll have to look more in the vMix forum and it will surely appear :-)


https://forums.vmix.com/posts/t20986-Scripting-for-Dummies


Hmm

Function/End Function and Sub/End Sub is not allowed to use what I can see so this was tricky...


From the helpfiles
Quote:
VB.NET


vMix Scripting supports the majority of VB.NET 2.0 code that will work within a single sub or function.
This means that custom classes and structures are not supported, however you can use the vast majority of the built in base classes in the .NET framework



NOPE! I'm to stupid to fix this, I give up!

What ever I try just get error so I need to find someone thats working on commission to help me.
doggy  
#11 Posted : Friday, March 24, 2023 1:55:43 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Salleman Go to Quoted Post


NOPE! I'm to stupid to fix this, I give up!

What ever I try just get error so I need to find someone thats working on commission to help me.


Allready giving up with al the info available (forum, Google search etc) to learn? ;-)

Code:
dim teststring as string =""

teststring = Input.Find("Green.gtzip").Text("Headline.Text")

If teststring .Contains(":") Then
    Input.Find("Green.gtzip").Text("Description.Text")= "Clock"
Else If teststring .Contains("-") and  teststring .Contains("(") Then
    Input.Find("Green.gtzip").Text("Description.Text")= "Start"
Else If teststring .Contains("-")  Then
    Input.Find("Green.gtzip").Text("Description.Text")= "Final"
Else
    Input.Find("Green.gtzip").Text("Description.Text")= "Nothing"
End If
Salleman  
#12 Posted : Friday, March 24, 2023 8:21:57 AM(UTC)
Salleman

Rank: Member

Groups: Registered
Joined: 3/13/2020(UTC)
Posts: 25
Sweden
Location: Stockholm

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salleman Go to Quoted Post


NOPE! I'm to stupid to fix this, I give up!

What ever I try just get error so I need to find someone thats working on commission to help me.


Allready giving up with al the info available (forum, Google search etc) to learn? ;-)

Code:
dim teststring as string =""

teststring = Input.Find("Green.gtzip").Text("Headline.Text")

If teststring .Contains(":") Then
    Input.Find("Green.gtzip").Text("Description.Text")= "Clock"
Else If teststring .Contains("-") and  teststring .Contains("(") Then
    Input.Find("Green.gtzip").Text("Description.Text")= "Start"
Else If teststring .Contains("-")  Then
    Input.Find("Green.gtzip").Text("Description.Text")= "Final"
Else
    Input.Find("Green.gtzip").Text("Description.Text")= "Nothing"
End If

WHY could I not see that???
So simple when you put it like that!

Many thanks and now it works perfectly:

Code:

dim oldresult001 as string = ""
dim Serie1G1Result as string = ""

do while true
Serie1G1Result = Input.Find("SERIE1").Text("G1Result.Text")
     If Serie1G1Result .Contains(":") Then
     API.Function("SetTextVisibleOn", Input:="GoalService", Value:="Background", SelectedName:="Nedsläpp.Text")
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Mål.Text")
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Slutresultat.Text")
Else If Serie1G1Result .Contains("-") and  Serie1G1Result .Contains("(") Then
     API.Function("SetTextVisibleOn", Input:="GoalService", Value:="Background", SelectedName:="Mål.Text")
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Nedsläpp.Text")
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Slutresultat.Text")
Else If Serie1G1Result .Contains("-")  Then
     API.Function("SetTextVisibleOn", Input:="GoalService", Value:="Background", SelectedName:="Slutresultat.Text")
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Nedsläpp.Text")
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Mål.Text")
Else
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Nedsläpp.Text")
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Mål.Text")
     API.Function("SetTextVisibleOff", Input:="GoalService", Value:="Background", SelectedName:="Slutresultat.Text")
end if
     if not (Serie1G1Result = oldresult001)
     API.Function("SetImageVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1HomeLogo.Source")
     API.Function("SetImageVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1AwayLogo.Source")
     API.Function("SetTextVisibleOn", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1Result.Text")
     API.Function("Play", Input:="Goal-Pling")
     sleep(300) 
     API.Function("OverlayInput4In", Input:="GoalServiceTitle")
     sleep(5000)    
     API.Function("OverlayInput4Out", Input:="GoalServiceTitle")
     sleep(500) 
     API.Function("SetImageVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1HomeLogo.Source")
     API.Function("SetImageVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1AwayLogo.Source")
     API.Function("SetTextVisibleOff", Input:="SERIE1-GoalService", Value:="Serie1Game1", SelectedName:="G1Result.Text")
     oldresult001 = Serie1G1Result
end if
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.