Rank: Advanced Member
Groups: Registered
Joined: 11/20/2020(UTC) Posts: 74 ![Man Man](/Themes/yafpro/male.gif) ![Germany Germany](/Content/images/flags/DE.png) Thanks: 13 times Was thanked: 9 time(s) in 9 post(s)
|
For meterF1 returns a Value of something like 0.043xy you can not define it as Integer. Best you declare a string variable. You could use a double Variable but probably must get rid of the dot
The conditional statement will work with a string as well.
If Value does no deliver a return use .InnerText instead
And.... you have to set "CR1 Mic" as [@title='Mic whatever']
And...... if you load VmixXML you can not refer to "x".SelectSingleNode
And........ the meterF1 will as long as earth moves never show a value of >100 (if, it would be heard at least to Saturn, or even Pluto)
And........... get rid of the Else if Value declaration, only use else. Your computer will know what to do
|
![thanks](/Themes/yafpro/heart_small.png) 1 user thanked Chris Daum for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/30/2020(UTC) Posts: 7 ![United Kingdom United Kingdom](/Content/images/flags/GB.png) Location: Rugby Thanks: 1 times Was thanked: 1 time(s) in 1 post(s)
|
Just a quick question//
Can i presume we can't make vb functions because of the use of the word "Function" within the different scripting options?
I couldn't find any info in the documentation and it errors if i try and make one.
Thanks in advance.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: RSB ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Just a quick question//
Can i presume we can't make vb functions because of the use of the word "Function" within the different scripting options?
I couldn't find any info in the documentation and it errors if i try and make one.
Thanks in advance. From the help files : 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](/Themes/yafpro/heart_small.png) 1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: Chris Daum ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) And........ the meterF1 will as long as earth moves never show a value of >100 (if, it would be heard at least to Saturn, or even Pluto)
WHAT !? could not hear lol ;-)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/20/2020(UTC) Posts: 74 ![Man Man](/Themes/yafpro/male.gif) ![Germany Germany](/Content/images/flags/DE.png) Thanks: 13 times Was thanked: 9 time(s) in 9 post(s)
|
Originally Posted by: RSB ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Just a quick question//
Can i presume we can't make vb functions because of the use of the word "Function" within the different scripting options?
I couldn't find any info in the documentation and it errors if i try and make one.
Thanks in advance. vMix Scripting is not an IDE. So you dont´t have the structure features like using visual studio. If you want to use the functionalities that VS does deliver you could write a Visual Basic Script or App and control vMix via web api, like doggy apart from many other things shows at the beginning of this topic. I mean looking at it a bit closer, if you do something like read the api get the value "xy" if value "xy" is whatever then "do what you want" is in the end more or less a function, although it does not return a value so...
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/23/2020(UTC) Posts: 163 ![United States United States](/Content/images/flags/US.png) Location: Wichita Thanks: 9 times Was thanked: 23 time(s) in 19 post(s)
|
Originally Posted by: josh_5tool ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Originally Posted by: doggy ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Something is wrong with your vMix instalation
Version ? license type ?
Uh oh! We're running 24.0.0.72 on a Pro license. Haven't had any issues with scripting previously. There are a few other identical VMix machines around the office that I'll test the script on today! Actually there's another glaring error in the line: x.SelectSingleNode Where did "x" come from? That should be VmixXML not "x".
|
![thanks](/Themes/yafpro/heart_small.png) 2 users thanked Roy Sinclair for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: Roy Sinclair ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Actually there's another glaring error in the line: x.SelectSingleNode
Where did "x" come from? That should be VmixXML not "x".
In fact that is the one causing that specific error :-)
|
![thanks](/Themes/yafpro/heart_small.png) 1 user thanked doggy for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 8/18/2021(UTC) Posts: 8 ![United States United States](/Content/images/flags/US.png) Location: Boston Thanks: 5 times
|
Thanks so much Chris and Doggy! I've been able to cobble together a script that works for what I was trying to do. I sincerely appreciate it!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/5/2017(UTC) Posts: 32 Location: Zagreb
Thanks: 8 times
|
heyo! I have a curiosity question:
I'm using a script that changes the position of input on Y, on my PC (lets call it PC1) and on the other PC (PC2) in the production. Both PCs have vMix 24.0.0.72 4k, and are uptodate. Until today it worked with this code:
Dim gdrive as integer = Convert.toInt32(Input.Find("gdrive_count").Text("Message")) Dim layer as integer = Convert.toInt32(Input.Find("gdrive_count").Text("Title"))
If gdrive = 2 API.Function("SetPanY",Input:="test",Value:=-0.295) Dim PanY As String = "http://192.168.2.225:8088/API/?Function=SetPanY&input=test1&Value=-0.295" Dim webClient As New System.Net.WebClient Dim result2 As String = webClient.DownloadString(PanY) End If
Today, instead of changing the Y axis of test input on PC1 to -0.295, it changes it to -295, which vMix naturally cannot do, so my input goes out of the screen. On PC2 everything is ok. But if I change the script to:
If gdrive = 2 Dim PanY1 As String = "http://127.0.0.1:8088/API/?Function=SetPanY&input=test&Value=-0.295" Dim PanY2 As String = "http://192.168.2.225:8088/API/?Function=SetPanY&input=test1&Value=-0.295" Dim webClient As New System.Net.WebClient Dim result1 As String = webClient.DownloadString(PanY1) Dim result2 As String = webClient.DownloadString(PanY2) End If
It works as intended, as it worked until today.
Does anybody know why does this occur?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/2/2012(UTC) Posts: 103 ![Man Man](/Themes/yafpro/male.gif) Location: Germany Thanks: 13 times Was thanked: 10 time(s) in 9 post(s)
|
Try replacing the dot with comma: -0.295 after 0,295 Maybe Windows is set differently
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/23/2020(UTC) Posts: 163 ![United States United States](/Content/images/flags/US.png) Location: Wichita Thanks: 9 times Was thanked: 23 time(s) in 19 post(s)
|
Originally Posted by: cutter07 ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Try replacing the dot with comma: -0.295 after 0,295 Maybe Windows is set differently Ah yes, if someone changed the locale of the PC then the punctuation for numbers could have been changed.
|
![thanks](/Themes/yafpro/heart_small.png) 1 user thanked Roy Sinclair for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/5/2017(UTC) Posts: 32 Location: Zagreb
Thanks: 8 times
|
Originally Posted by: Roy Sinclair ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Originally Posted by: cutter07 ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Try replacing the dot with comma: -0.295 after 0,295 Maybe Windows is set differently Ah yes, if someone changed the locale of the PC then the punctuation for numbers could have been changed. ah, yes, somebody was playing with my PC, and changed my regional formatting ... Thanks guys, for the help!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/5/2017(UTC) Posts: 135 Location: UK
Thanks: 15 times Was thanked: 11 time(s) in 9 post(s)
|
I'm looking for a strategy to change the text colour in a Host UI (see Pic) ![](/Themes/yafpro/icon_file.gif) 27-01-22_12-28-35_snap.jpg (220kb) downloaded 2 time(s).The screen will display the currently selected topic (from a datasource row) And also a list of available topics (8 text fields, with row1=text1, row2=text2 etc) I want to highlight current topic selected in the available topics list - by setting the text colour - which I know I can do via a shortcut. I guess my question is, how do I do that? Assuming some scripting involved (what is the current row, set avialable topic row text colour = X, all the others to y ) Is that the right approach? And how would I get the current datasource row? Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: nowski ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) by using the SetTextColour shortcut function One for each text another sortcut Quote:Assuming some scripting involved (what is the current row, set avialable topic row text colour = X, all the others to y ) Is that the right approach?
And how would I get the current datasource row?
one can not get the current row number but you can pecify the number and use that to change that numbers text one could play with the index number within a script too ( retrieve the text name related to that index number from the API XML for the setcolor function) Could have shortcuts setting the index number and let a script do the color change based on that and reset the other colors to the original ones ( would be # buttons for the indexes and one to call the script ) in one script Coold also adjust the title and have the topics doubled up ( a series with base colors and a series with the highlight colors on top of them and with the use of pages select a page which hides or unhides the selection color ones (one page per topic ) ![](/Themes/yafpro/icon_file.gif) topic color.png (51kb) downloaded 3 time(s).
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/5/2017(UTC) Posts: 135 Location: UK
Thanks: 15 times Was thanked: 11 time(s) in 9 post(s)
|
I figured something out actually. (sometimes it just helps to write things down!) First I set all the text to white: Quote:for i = 1 to 9 API.Function("SetTextColour",Input:="host_screen.gtzip",SelectedName:="List"+ i.toString +".Text",Value:="white")
next then I pull a value from the Datasource which I set in the Sheet which is row Quote:Dim row as String =Input.Find("host_screen.gtzip").Text("row.Text") Then I set the colour of the text: Quote:API.Function("SetTextColour",Input:="host_screen.gtzip",SelectedName:="List"+ row.toString +".Text",Value:="pink") Almost works - just got to futz with the logic of the row numbers
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/5/2017(UTC) Posts: 135 Location: UK
Thanks: 15 times Was thanked: 11 time(s) in 9 post(s)
|
Thanks Doggy, thats an approach I will also try. Might well work better
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/6/2021(UTC) Posts: 1
|
Good Day! I often use various scripts to work in vmix, it makes the job easier . The other day i saw on the internet how someone made an additional program for mix . I also had idea to transfer my scripts separately to the program, but then a problem arose. I succeeded in extracting information from vmix using api.xml, but i dont know how to change api.xml vmix. Does anyone have an idea how to do this? Maybe there is an api.xml file in the vmix folders?
My example code to get information: Dim url as string = "http://192.168.1.129:8089/api" Dim x as new system.xml.xmldocument x.Load(url) dim a =x.SelectSingleNode("//input[@number='1'/text[@index = '0']").InnerText Console.writeline(a)
To change the text field in the scripts, i used API.Function,and if we have a link "http://192.168.1.129:8089/api" instead of api.xml, then how to change the content?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: SAJlAMAHDPA ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Good Day! I often use various scripts to work in vmix, it makes the job easier . The other day i saw on the internet how someone made an additional program for mix . I also had idea to transfer my scripts separately to the program, but then a problem arose. I succeeded in extracting information from vmix using api.xml, but i dont know how to change api.xml vmix. Does anyone have an idea how to do this? Maybe there is an api.xml file in the vmix folders?
My example code to get information: Dim url as string = "http://192.168.1.129:8089/api" Dim x as new system.xml.xmldocument x.Load(url) dim a =x.SelectSingleNode("//input[@number='1'/text[@index = '0']").InnerText Console.writeline(a)
To change the text field in the scripts, i used API.Function,and if we have a link "http://192.168.1.129:8089/api" instead of api.xml, then how to change the content?
By doing a httprequest Have you checked page 1 of this post ?
|
|
|
|
Rank: Member
Groups: Registered
Joined: 1/6/2014(UTC) Posts: 15
Thanks: 3 times Was thanked: 1 time(s) in 1 post(s)
|
Hello doggy
I need Help for a syntax to do something when an audio meter of a live input (from sound card) reaches certain level. I am sorry, I am new to script. thank you, much appreciated.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: endiaer ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Hello doggy
I need Help for a syntax to do something when an audio meter of a live input (from sound card) reaches certain level. I am sorry, I am new to script. thank you, much appreciated. Have you checked the input Trigger section for OnAudioMeter? ( no scripting needed there ) else you will need to retrieve it from the API XML ( many examples in this post on how to retrieve similar information ) here is also a hint ( also this post ) https://forums.vmix.com/...ng-for-Dummies#post98785The "doing something" is a very broad concept ;-)
|
|
|
|
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