Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Originally Posted by: Mr.Shamil
The code you have given worked , thanks. Sorry for taking your time. I was bewildered again , I would like to make Second Text Box (Text.Box2) and integrate it with Input=Title.gtzip. For example, I have Title.gtzip and Breaking.gtzip both with Headline.Text , I would like to add Text.Box2 so when I type Breaking.gtzip on it will change to another title.
Dim client As WebRequest = WebRequest.Create("http://192.168.13.167:8088/api/?Function=SetText&Input=" & TextBox2 SelectedName=Headline.Text&Value=" & TextBox1.Text) it seemed I have done it incorrectly
With all due respect this thread was created to help one on its way to use vMix scripting (in its various forms and adapt to personal usage requirements) and not creating external apps be it many bits can be used either way You are asking to specifically solve (basic) problems using windows forms (in vb.net) There are 2 options : Learning the vb.net basics (or other language usable within visual studio) so one understands what it all is doing or what possibilities there are instead of just throwing what looks like code haphazardly together (Google will be your friend here) or ask someone to create it for you ( with compensation) for a custom solution to your goals with full plan of these goals and not ask added piece by piece as you go . If one doesnt plan ahead in the goal even a 3rd party programmer is not going to be happy to help you out. Tip, why not look into using dropdownboxes to select the wanted title and avoid mistyping your choises , or use radiobuttons to make such selections. wil be more practical during use One can try ChatGTP to create for you but without understanding some basics it wont do any good (if one can explaine properly in the first place) in understanding why it doesnt work or what it all does BTW you are missing a .Text and a & and a " https://www.google.com/s...ceid=chrome&ie=UTF-8
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 11/19/2022(UTC) Posts: 3 Location: Austin, TX Thanks: 1 times
|
Originally Posted by: Roy Sinclair Originally Posted by: justinheatindex Hello,
I wanted to see if anyone could help me out with a script I'm trying to troubleshoot. I've gotten this far with the help of this thread + ChatGPT but only have a baseline understanding of code (not a coder myself).
Here's what I'm trying to do. I have a Data Source feeding into a title input named "title" from a Google Sheet. This Data Source is essentially pulling a cell that is a sum / total counting up as things are added to my Google Sheets as a running total. I want my script to continually run / monitor this input until it reaches the value of 10,000. At 10,000 I want it to trigger an overlay with a video file, and then end once the value is over 10,050.
The Script currently saves okay, and runs but it never triggers the overlay, and it also does not end when the value gets above 10,050. I'm unsure if the issue is how I'm writing the Input.Find command, pulling in the title input and its subsequent Message.text text (which is where the data source is populating) or what. All I know is the issue seems to be in the script not recognizing when the value is updating. I also attempted this with a different title input that was not linked to a Data Source and that too did not work.
Here's my code. Any help is much appreciated!
Do Dim value as String = Input.Find("title").text("Message.Text")
If Not String.IsNullOrEmpty(value) AndAlso CInt(value) > 10050 Then API.Function("OverlayInput1In", Input:="win") Exit Do ' Exit the loop when the condition is met End If
' Sleep for a short duration to avoid excessive CPU usage Sleep(1000) ' Sleep for 1 second
Loop While True ' Continue looping indefinitely Thank you I changed the condition and the terminal value since you said you wanted greater than 10,050 and yet was checking for exactly equal to 10,000 which means the script would have to catch it at exactly equal to the terminal value otherwise it would continue to run long after the terminal value was reached. Thank you for your response, this worked! I appreciate your help.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/9/2017(UTC) Posts: 36 Location: Jeffry_Ghost Thanks: 10 times Was thanked: 2 time(s) in 2 post(s)
|
Hello guys
hope i am not blind, but i did not found anything similiar that would helped me so I am asking you guys and of course mostly our hero doggy
Is there any way how can i get TYPE of source from API? Here is some code i used (generally i need to get info what input is active and if it has video in it)
activeinput = (x.SelectSingleNode("//active").InnerText) activeoverlay = (x.SelectSingleNode("//input[@number='"& activeinput &"']/overlay[3]/@key").InnerText)
if i try /@type it has invalid token and i tried everything i came up in my mind but nothing worked. Is it possible that this is not possible to do or am I just that stupid?
Also my second question, is there any possibility how to check if there is multiview overlay (layr)? I tried some code but it doesn't work i tried google also, i know how to phrase it but don't know how to re-prhase it in vmix script.
If anybody would be able to help me, i would be greatfull
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/2/2021(UTC) Posts: 12 Location: Utrecht Thanks: 2 times Was thanked: 4 time(s) in 3 post(s)
|
Hi Jeffry,
You could try something like this, as the type attribute is accessable through the XML:
' Select the inputs nodes Dim inputsNode As XmlNode = xmlDoc.SelectSingleNode("/vmix/inputs")
' Iterate over each input node For Each inputNode As XmlNode In inputsNode.ChildNodes ' Get the type attribute value Dim typeValue As String = inputNode.Attributes("type").Value
' Print the type value Console.WriteLine("Type: " & typeValue) Next
This is looping over all inputs and returns the type value, but you could also do something similar to get the type of a specific input. As for your second question, I do not thing there as an option to see if an input has layers in the current API. would be usefull tho!
|
1 user thanked QuintvK for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/9/2017(UTC) Posts: 36 Location: Jeffry_Ghost Thanks: 10 times Was thanked: 2 time(s) in 2 post(s)
|
Originally Posted by: QuintvK Hi Jeffry,
You could try something like this, as the type attribute is accessable through the XML:
' Select the inputs nodes Dim inputsNode As XmlNode = xmlDoc.SelectSingleNode("/vmix/inputs")
' Iterate over each input node For Each inputNode As XmlNode In inputsNode.ChildNodes ' Get the type attribute value Dim typeValue As String = inputNode.Attributes("type").Value
' Print the type value Console.WriteLine("Type: " & typeValue) Next
This is looping over all inputs and returns the type value, but you could also do something similar to get the type of a specific input. As for your second question, I do not thing there as an option to see if an input has layers in the current API. would be usefull tho! Thank you very much with fast answer, deffintly will try this as soon as possible second question i thought so but agree would be really usefull
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Originally Posted by: Jeffry_Ghost Hello guys
hope i am not blind, but i did not found anything similiar that would helped me so I am asking you guys and of course mostly our hero doggy
Is there any way how can i get TYPE of source from API? Here is some code i used (generally i need to get info what input is active and if it has video in it)
activeinput = (x.SelectSingleNode("//active").InnerText) activeoverlay = (x.SelectSingleNode("//input[@number='"& activeinput &"']/overlay[3]/@key").InnerText)
if i try /@type it has invalid token and i tried everything i came up in my mind but nothing worked. Is it possible that this is not possible to do or am I just that stupid?
Also my second question, is there any possibility how to check if there is multiview overlay (layr)? I tried some code but it doesn't work i tried google also, i know how to phrase it but don't know how to re-prhase it in vmix script.
If anybody would be able to help me, i would be greatfull Not blind but might consider new eyeglasses or maybe just a bit more focus ;-) Please again put code in language quotes for better reading!to check what input is active and if it's a video (see post #15 of this thread, can't miss it ) see post #15 of this threadCode:activeinput = (x.SelectSingleNode("//active").InnerText)
activeType = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@type").Value)
to get all video inputs for example its easier to work with a nodelist (filtered list basically) Code:dim nodeList as XmlNodeList = x.SelectNodes("//inputs/input[@type='Video']")
Multiple examples of usng nodelists in this forum API XML contains all info needed to check if an input is on overlay or if an input has layers and which inputs they refer to ( see #81 and next #406 for hints in this thread ) A good idea is to get familiar with XML and its XPath posibilities
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/9/2017(UTC) Posts: 36 Location: Jeffry_Ghost Thanks: 10 times Was thanked: 2 time(s) in 2 post(s)
|
Originally Posted by: doggy Originally Posted by: Jeffry_Ghost Hello guys
hope i am not blind, but i did not found anything similiar that would helped me so I am asking you guys and of course mostly our hero doggy
Is there any way how can i get TYPE of source from API? Here is some code i used (generally i need to get info what input is active and if it has video in it)
activeinput = (x.SelectSingleNode("//active").InnerText) activeoverlay = (x.SelectSingleNode("//input[@number='"& activeinput &"']/overlay[3]/@key").InnerText)
if i try /@type it has invalid token and i tried everything i came up in my mind but nothing worked. Is it possible that this is not possible to do or am I just that stupid?
Also my second question, is there any possibility how to check if there is multiview overlay (layr)? I tried some code but it doesn't work i tried google also, i know how to phrase it but don't know how to re-prhase it in vmix script.
If anybody would be able to help me, i would be greatfull Not blind but might consider new eyeglasses or maybe just a bit more focus ;-) Please again put code in language quotes for better reading!to check what input is active and if it's a video (see post #15 of this thread, can't miss it ) see post #15 of this threadCode:activeinput = (x.SelectSingleNode("//active").InnerText)
activeType = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@type").Value)
to get all video inputs for example its easier to work with a nodelist (filtered list basically) Code:dim nodeList as XmlNodeList = x.SelectNodes("//inputs/input[@type='Video']")
Multiple examples of usng nodelists in this forum API XML contains all info needed to check if an input is on overlay or if an input has layers and which inputs they refer to ( see #81 and next #406 for hints in this thread ) A good idea is to get familiar with XML and its XPath posibilities Thank you very much i red all posts you mentioned, but have to admit i need to learn more about coding and basics as you wrote. my problem is that in our show there is always one video playing (one at time, in fact theres a lot of them), but its moveing from input itself to mix 2 or to PGM but as Layer1-10 and nobody know when and where it will be as there are atleast 3 people operating it simultanesly. So my point is to make one script that will run on loop and write each other what is playing and where (that part was easy, what i am fighting with is Condition when it is as a LAYER to find it not sure if you got me, but either way, you helped me today
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Originally Posted by: Jeffry_Ghost but its moveing from input itself to mix 2 or to PGM but as Layer1-10 and nobody know when and where it will be as there are atleast 3 people operating it simultanesly. So my point is to make one script that will run on loop and write each other what is playing and where (that part was easy, what i am fighting with is Condition when it is as a LAYER to find it not sure if you got me, "totally".... NOT Might want to keep your inputs under control so they do not keep running around
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/23/2020(UTC) Posts: 170 Location: Wichita Thanks: 10 times Was thanked: 24 time(s) in 20 post(s)
|
Originally Posted by: Jeffry_Ghost Originally Posted by: doggy Originally Posted by: Jeffry_Ghost Hello guys
hope i am not blind, but i did not found anything similiar that would helped me so I am asking you guys and of course mostly our hero doggy
Is there any way how can i get TYPE of source from API? Here is some code i used (generally i need to get info what input is active and if it has video in it)
activeinput = (x.SelectSingleNode("//active").InnerText) activeoverlay = (x.SelectSingleNode("//input[@number='"& activeinput &"']/overlay[3]/@key").InnerText)
if i try /@type it has invalid token and i tried everything i came up in my mind but nothing worked. Is it possible that this is not possible to do or am I just that stupid?
Also my second question, is there any possibility how to check if there is multiview overlay (layr)? I tried some code but it doesn't work i tried google also, i know how to phrase it but don't know how to re-prhase it in vmix script.
If anybody would be able to help me, i would be greatfull Not blind but might consider new eyeglasses or maybe just a bit more focus ;-) Please again put code in language quotes for better reading!to check what input is active and if it's a video (see post #15 of this thread, can't miss it ) see post #15 of this threadCode:activeinput = (x.SelectSingleNode("//active").InnerText)
activeType = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@type").Value)
to get all video inputs for example its easier to work with a nodelist (filtered list basically) Code:dim nodeList as XmlNodeList = x.SelectNodes("//inputs/input[@type='Video']")
Multiple examples of usng nodelists in this forum API XML contains all info needed to check if an input is on overlay or if an input has layers and which inputs they refer to ( see #81 and next #406 for hints in this thread ) A good idea is to get familiar with XML and its XPath posibilities Thank you very much i red all posts you mentioned, but have to admit i need to learn more about coding and basics as you wrote. my problem is that in our show there is always one video playing (one at time, in fact theres a lot of them), but its moveing from input itself to mix 2 or to PGM but as Layer1-10 and nobody know when and where it will be as there are atleast 3 people operating it simultanesly. So my point is to make one script that will run on loop and write each other what is playing and where (that part was easy, what i am fighting with is Condition when it is as a LAYER to find it not sure if you got me, but either way, you helped me today One thing you should always do when coding is to bring up the API.XML output in a browser window (sorry not Firefox, someone broke it in recent versions) so you can examine it: "http://127.0.0.1:8088/api". If you had done so you'd have already found that a part of the INPUT XML object will be all of the layers in that object which you can iterate through to find which video Input is in which layer and whether it's playing or not.
|
1 user thanked Roy Sinclair for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Display input names of 9 input multiview Multiviewtitling.jpg (83kb) downloaded 32 time(s).
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/23/2020(UTC) Posts: 170 Location: Wichita Thanks: 10 times Was thanked: 24 time(s) in 20 post(s)
|
Originally Posted by: doggy Display input names of 9 input multiview Multiviewtitling.jpg (83kb) downloaded 32 time(s). Excellent, a usable example of what I stated. For future reference though, it takes a lot more bandwidth to post or view an image when compared to text and as an added benefit the text can be selected and copied whereas for the image the text has to be input again by hand and will therefore be subject to typos.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Originally Posted by: Roy Sinclair Originally Posted by: doggy Display input names of 9 input multiview
Excellent, a usable example of what I stated.
For future reference though, it takes a lot more bandwidth to post or view an image when compared to text and as an added benefit the text can be selected and copied whereas for the image the text has to be input again by hand and will therefore be subject to typos.
True but then again for many just copy and paste will not help in learning to understand (and an easy way to let someone else do the work for them) and the importance of every single character when coding
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/23/2020(UTC) Posts: 170 Location: Wichita Thanks: 10 times Was thanked: 24 time(s) in 20 post(s)
|
Originally Posted by: doggy Originally Posted by: Roy Sinclair Originally Posted by: doggy Display input names of 9 input multiview
Excellent, a usable example of what I stated.
For future reference though, it takes a lot more bandwidth to post or view an image when compared to text and as an added benefit the text can be selected and copied whereas for the image the text has to be input again by hand and will therefore be subject to typos.
True but then again for many just copy and paste will not help in learning to understand (and an easy way to let someone else do the work for them) and the importance of every single character when coding Worked in IT for decades, after seeing people doing data entry I made sure that I always did my best to eliminate all the typing I could because EVERY uncontrolled input will contain garbage which will be the source of future bugs or difficulties.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Originally Posted by: Roy Sinclair Originally Posted by: doggy Originally Posted by: Roy Sinclair Originally Posted by: doggy Display input names of 9 input multiview
Excellent, a usable example of what I stated.
For future reference though, it takes a lot more bandwidth to post or view an image when compared to text and as an added benefit the text can be selected and copied whereas for the image the text has to be input again by hand and will therefore be subject to typos.
True but then again for many just copy and paste will not help in learning to understand (and an easy way to let someone else do the work for them) and the importance of every single character when coding Worked in IT for decades, after seeing people doing data entry I made sure that I always did my best to eliminate all the typing I could because EVERY uncontrolled input will contain garbage which will be the source of future bugs or difficulties. Understand where you are comming from and agree. Yet asking a basic question , ignoring advice and tips on where to find existing examples or doing even the smalest of effort and trying to end up with a fully working complete script for their production (gig) with more added questions and extra bits during each step is using up way more bandwidth ;-) feel free to copy/paste and run this working vMix script, no need to understand ;-) Code:For Each prog As Process In Process.GetProcesses
If prog.ProcessName = "vMix64" Then
prog.Kill()
End If
Next
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/23/2020(UTC) Posts: 170 Location: Wichita Thanks: 10 times Was thanked: 24 time(s) in 20 post(s)
|
Originally Posted by: doggy Originally Posted by: Roy Sinclair Originally Posted by: doggy Originally Posted by: Roy Sinclair Originally Posted by: doggy Display input names of 9 input multiview
Excellent, a usable example of what I stated.
For future reference though, it takes a lot more bandwidth to post or view an image when compared to text and as an added benefit the text can be selected and copied whereas for the image the text has to be input again by hand and will therefore be subject to typos.
True but then again for many just copy and paste will not help in learning to understand (and an easy way to let someone else do the work for them) and the importance of every single character when coding Worked in IT for decades, after seeing people doing data entry I made sure that I always did my best to eliminate all the typing I could because EVERY uncontrolled input will contain garbage which will be the source of future bugs or difficulties. Understand where you are comming from and agree. Yet asking a basic question , ignoring advice and tips on where to find existing examples or doing even the smalest of effort and trying to end up with a fully working complete script for their production (gig) with more added questions and extra bits during each step is using up way more bandwidth ;-) feel free to copy/paste and run this working vMix script, no need to understand ;-) Code:For Each prog As Process In Process.GetProcesses
If prog.ProcessName = "vMix64" Then
prog.Kill()
End If
Next
You DO realize that's actually an example that someone can change and use? lol Of course you do, I'm not talking about writing all the code anyone needs so they don't have to learn to help themselves though, just pointing out that it does help to have usable examples especially when the interface for writing the code isn't quite as smart as Notepad. What I WOULD like to see is an VMIXAPI.DLL that could be used to write external programs and subscribe to vMIX events. Building a scripting language into an application is no longer a good idea, implementing a badly crippled subset of a language is not even rational but its's what we have so we use it.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/5/2020(UTC) Posts: 91 Location: Jakarta Thanks: 17 times Was thanked: 5 time(s) in 3 post(s)
|
Hi Doggy,
How can we run script after a preset loaded successfully?
Thanks in advance.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Originally Posted by: gpdipalmerahtimur Hi Doggy,
How can we run script after a preset loaded successfully?
Thanks in advance. Is there a criteria indicating a fully succesfull load of a preset ? Its not build in but there is a neat little trick Step 1: Google search for "vmix autostart script" step 2: go through the search results until you stumble on one titled "Trigger on vMix startup" Step 3: check out post #4 there (something about a Browser input with a scriptstart httprequest) Other autostart solutions are starting vMix with a batch file or so but imo less practical
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/5/2020(UTC) Posts: 91 Location: Jakarta Thanks: 17 times Was thanked: 5 time(s) in 3 post(s)
|
Originally Posted by: doggy Originally Posted by: gpdipalmerahtimur Hi Doggy,
How can we run script after a preset loaded successfully?
Thanks in advance. Is there a criteria indicating a fully succesfull load of a preset ? Its not build in but there is a neat little trick Step 1: Google search for "vmix autostart script" step 2: go through the search results until you stumble on one titled "Trigger on vMix startup" Step 3: check out post #4 there (something about a Browser input with a scriptstart httprequest) Other autostart solutions are starting vMix with a batch file or so but imo less practical Hi Doggy, I think a preset loaded successfully when this Message Box disappeared after Loading the Preset: Screenshot 2023-06-18 215634.png (2kb) downloaded 0 time(s).I have tried to use Web Browser with HTTP Request to start a script. But I notice when I use "Sleep(x)" the Script Stopped Immediately. I'm using to delay to ensure all inputs are fully loaded. But it is better if we can know when a preset loaded successfully before running the script.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,220 Location: Belgium Thanks: 291 times Was thanked: 953 time(s) in 788 post(s)
|
Originally Posted by: gpdipalmerahtimur Hi Doggy,
I think a preset loaded successfully when this Message Box disappeared after Loading the Preset:
is what i meant AFAIK there is no real indication Quote: I have tried to use Web Browser with HTTP Request to start a script. But I notice when I use "Sleep(x)" the Script Stopped Immediately. I'm using to delay to ensure all inputs are fully loaded. But it is better if we can know when a preset loaded successfully before running the script.
You never mentioned the reason why so hard to tell if suited I tested with the below be it only part1 or part2 or both Code:
dim i as integer
'Part1
API.Function("SetAlpha",Input:=5,Value:=0 )
sleep(5000)
API.Function("SetAlpha",Input:=5,Value:=255)
'Part2
for i = 1 to 100
Dim client as WebRequest = WebRequest.Create("http://127.0.0.1:8088/api/?Function=SetText&Input=3&SelectedName=Headline.Text&Value="&i.tostring)
Dim response As WebResponse = client.GetResponse()
response.Close
sleep(100)
next
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/5/2020(UTC) Posts: 91 Location: Jakarta Thanks: 17 times Was thanked: 5 time(s) in 3 post(s)
|
Hi Doggy,
If we can modify a Title Fill Color by using SetColor, can we also use script to Change Border Color dynamically?
|
|
|
|
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