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
hadi_753  
#1 Posted : Sunday, July 24, 2016 5:00:08 PM(UTC)
hadi_753

Rank: Member

Groups: Registered
Joined: 3/26/2016(UTC)
Posts: 10

Thanks: 1 times
Was thanked: 5 time(s) in 1 post(s)
Hi all ,

First , huge thanks to Mr. Martin as he helped me coding this scripting ..

Here as an example of scoreboard(for table tennis) scripting .


The script do the following :
In Table Tennis , the every player got 2 services , until they reach 10-10 then every player got one serve .

What the script do is to move the dot (white circle showing how got the serve) automatically to the other player every two point until they reach 10-10 , then every player got only one .

This is impossible to do without scripting . because the dot (white circle) is an image .aside from the mistakes may happens if you do it manually .

Here is the script (if anything not clear , please let me know) :

Code:

dim i = Input.Find("SOCORE TENIS.xaml")
dim sum As Integer
sum = Convert.ToInt32(i.Text("SCORE_1_A")) +  Convert.ToInt32(i.Text("SCORE_1_B"))
dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim n = x.SelectSingleNode("//input[@title =""SOCORE TENIS.xaml""]/image[@name = ""SELCT_TEAM_A""]")

if sum <>  "0" then 
if sum < 20 then
if CLng(sum) Mod 2 > 0 Then 

else 
if n.InnerText = "C:\*******SELECT TEAM WHITE.png" then 
API.Function("SetImage", "SOCORE TENIS.xaml", "C:\*******\SELECT TEAM WHITE.png", 100, "SELCT_TEAM_B") 
API.Function("SetImage", "SOCORE TENIS.xaml", "C:\*******\SELECT TEAM OUT.png", 100, "SELCT_TEAM_A") 
else
API.Function("SetImage", "SOCORE TENIS.xaml", "C:\************\SELECT TEAM WHITE.png", 100, "SELCT_TEAM_A") 
API.Function("SetImage", "SOCORE TENIS.xaml", "C:\************\SELECT TEAM OUT.png", 100, "SELCT_TEAM_B") 
end if
end if 
else
if n.InnerText = "C:\*************\SELECT TEAM WHITE.png" then 
API.Function("SetImage", "SOCORE TENIS.xaml", "C:\*****************\SELECT TEAM WHITE.png", 100, "SELCT_TEAM_B") 
API.Function("SetImage", "SOCORE TENIS.xaml", "C:\*****************\SELECT TEAM OUT.png", 100, "SELCT_TEAM_A") 
else
API.Function("SetImage", "SOCORE TENIS.xaml", "C:\*****************\SELECT TEAM WHITE.png", 100, "SELCT_TEAM_A") 
API.Function("SetImage", "SOCORE TENIS.xaml", "C:\******************\SELECT TEAM OUT.png", 100, "SELCT_TEAM_B") 
end if
end if 
end if 



Hope the above code will be helpful for you guys ..

Thanks Mr. Martin for the support .

Regards ,
thanks 5 users thanked hadi_753 for this useful post.
corporatejames on 7/24/2016(UTC), mburel1980 on 9/18/2016(UTC), tomaszek117 on 1/6/2020(UTC), Vyacheslav on 2/7/2021(UTC), monamiga on 7/26/2021(UTC)
Jacan  
#2 Posted : Monday, May 9, 2022 5:13:27 PM(UTC)
Jacan

Rank: Newbie

Groups: Registered
Joined: 1/7/2022(UTC)
Posts: 4
Jamaica
Location: Kingston

I have been searching my whole "VMix" life for something like this. I have a cricket set up for which each odd number score changes the "white circle" and after every six legal deliveries, it also changes.

I am a novice to scripting and would appreciate guidance on how to use your "gift"

I am going to read all I can now.
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.