logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

10 Pages«<8910
Options
Go to last post Go to first unread
Chris Daum  
#181 Posted : Friday, January 14, 2022 2:57:25 AM(UTC)
Chris Daum

Rank: Advanced Member

Groups: Registered
Joined: 11/20/2020(UTC)
Posts: 62
Man
Germany

Thanks: 12 times
Was thanked: 8 time(s) in 8 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 1 user thanked Chris Daum for this useful post.
josh_5tool on 1/14/2022(UTC)
RSB  
#182 Posted : Friday, January 14, 2022 3:08:50 AM(UTC)
RSB

Rank: Newbie

Groups: Registered
Joined: 5/30/2020(UTC)
Posts: 5
United Kingdom
Location: Rugby

Thanks: 1 times
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.
doggy  
#183 Posted : Friday, January 14, 2022 3:15:24 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 3,723
Belgium
Location: Belgium

Thanks: 211 times
Was thanked: 667 time(s) in 543 post(s)
Originally Posted by: RSB Go to Quoted Post
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 1 user thanked doggy for this useful post.
RSB on 1/14/2022(UTC)
doggy  
#184 Posted : Friday, January 14, 2022 3:19:01 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 3,723
Belgium
Location: Belgium

Thanks: 211 times
Was thanked: 667 time(s) in 543 post(s)
Originally Posted by: Chris Daum Go to Quoted Post

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 ;-)
Chris Daum  
#185 Posted : Friday, January 14, 2022 3:20:10 AM(UTC)
Chris Daum

Rank: Advanced Member

Groups: Registered
Joined: 11/20/2020(UTC)
Posts: 62
Man
Germany

Thanks: 12 times
Was thanked: 8 time(s) in 8 post(s)
Originally Posted by: RSB Go to Quoted Post
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...
Roy Sinclair  
#186 Posted : Friday, January 14, 2022 3:41:31 AM(UTC)
Roy Sinclair

Rank: Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 25
United States
Location: Wichita

Thanks: 2 times
Was thanked: 6 time(s) in 5 post(s)
Originally Posted by: josh_5tool Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post

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 2 users thanked Roy Sinclair for this useful post.
doggy on 1/14/2022(UTC), josh_5tool on 1/14/2022(UTC)
doggy  
#187 Posted : Friday, January 14, 2022 3:45:53 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 3,723
Belgium
Location: Belgium

Thanks: 211 times
Was thanked: 667 time(s) in 543 post(s)
Originally Posted by: Roy Sinclair Go to Quoted Post

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 1 user thanked doggy for this useful post.
josh_5tool on 1/14/2022(UTC)
josh_5tool  
#188 Posted : Friday, January 14, 2022 5:16:12 AM(UTC)
josh_5tool

Rank: Newbie

Groups: Registered
Joined: 8/18/2021(UTC)
Posts: 5
United States
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!
gefiltafish  
#189 Posted : Tuesday, January 18, 2022 12:07:13 AM(UTC)
gefiltafish

Rank: Member

Groups: Registered
Joined: 12/5/2017(UTC)
Posts: 21
Location: Zagreb

Thanks: 6 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?
cutter07  
#190 Posted : Wednesday, January 19, 2022 7:52:04 AM(UTC)
cutter07

Rank: Advanced Member

Groups: Registered
Joined: 6/2/2012(UTC)
Posts: 96
Man
Location: Germany

Thanks: 10 times
Was thanked: 9 time(s) in 8 post(s)
Try replacing the dot with comma: -0.295 after 0,295
Maybe Windows is set differently
Roy Sinclair  
#191 Posted : Wednesday, January 19, 2022 8:07:50 AM(UTC)
Roy Sinclair

Rank: Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 25
United States
Location: Wichita

Thanks: 2 times
Was thanked: 6 time(s) in 5 post(s)
Originally Posted by: cutter07 Go to Quoted Post
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 1 user thanked Roy Sinclair for this useful post.
gefiltafish on 1/20/2022(UTC)
gefiltafish  
#192 Posted : Thursday, January 20, 2022 7:09:43 AM(UTC)
gefiltafish

Rank: Member

Groups: Registered
Joined: 12/5/2017(UTC)
Posts: 21
Location: Zagreb

Thanks: 6 times
Originally Posted by: Roy Sinclair Go to Quoted Post
Originally Posted by: cutter07 Go to Quoted Post
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!
Users browsing this topic
10 Pages«<8910
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.