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
sinc747  
#1 Posted : Tuesday, February 16, 2021 4:53:06 AM(UTC)
sinc747

Rank: Advanced Member

Groups: Registered
Joined: 8/2/2013(UTC)
Posts: 1,072
Man
United States
Location: Fairhope, Alabama USA

Thanks: 553 times
Was thanked: 200 time(s) in 166 post(s)
I am using the vMix Script Builder from our friends at Studio 793 to build some simple Web Scripts for a project. But I cannot figure out how to address a 2nd PC with a Web Script. Do you know?

TIA!

- Tom
doggy  
#2 Posted : Tuesday, February 16, 2021 8:41:43 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
sinc747  
#3 Posted : Tuesday, February 16, 2021 4:01:47 PM(UTC)
sinc747

Rank: Advanced Member

Groups: Registered
Joined: 8/2/2013(UTC)
Posts: 1,072
Man
United States
Location: Fairhope, Alabama USA

Thanks: 553 times
Was thanked: 200 time(s) in 166 post(s)
Originally Posted by: doggy Go to Quoted Post


Thanks, but not sure what I'm looking for in the forum thread.

- Tom

rudyengels  
#4 Posted : Tuesday, February 16, 2021 4:38:56 PM(UTC)
rudyengels

Rank: Advanced Member

Groups: Registered
Joined: 2/16/2017(UTC)
Posts: 125
Man
Belgium

Thanks: 25 times
Was thanked: 25 time(s) in 18 post(s)
doggy  
#5 Posted : Tuesday, February 16, 2021 5:17:20 PM(UTC)
doggy

Rank: Advanced Member

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

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


Thanks, but not sure what I'm looking for in the forum thread.

- Tom




This Part Tom

Code:
'HTTP
Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=SetText&Input=Title 0- The Classic Blue.gtzip&SelectedName=Headline.Text&Value=Some Text")
Dim response = client.GetResponse()
response.Close

replace IP to 2nd pc's
sinc747  
#6 Posted : Wednesday, February 17, 2021 3:56:19 AM(UTC)
sinc747

Rank: Advanced Member

Groups: Registered
Joined: 8/2/2013(UTC)
Posts: 1,072
Man
United States
Location: Fairhope, Alabama USA

Thanks: 553 times
Was thanked: 200 time(s) in 166 post(s)
Thanks Rudy & Doggy! That's what I needed.

Now... how can I add a 2nd command to the same script.

So far I have

Dim client = WebRequest.Create("http://192.168.1.25:8088/api/?Function=VideoCallAudioSource&Input=Call 2349873452&Value=BusG")
Dim response = client.GetResponse()
response.Close

I want to add a 2nd command to the same PC...
Function = VideoCallVideoSource
Input = Call 2349873452
Value = Output2

What is the syntax for a 2nd command in the same script?

Again, thank you!

- Tom
doggy  
#7 Posted : Wednesday, February 17, 2021 9:18:40 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: sinc747 Go to Quoted Post
Now... how can I add a 2nd command to the same script.



Guess something like this might work

Code:
Dim client as WebRequest = WebRequest.Create("http://127.0.0.1:8088/api/?Function=SetText&Input=Title 0- The Classic Blue.gtzip&SelectedName=Headline.Text&Value=Some Text")
Dim response As WebResponse = client.GetResponse()

sleep(1000)

client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=SetText&Input=Title 0- The Classic Blue.gtzip&SelectedName=Headline.Text&Value=other Text")
response = client.GetResponse()
response.Close

Peter1000  
#8 Posted : Thursday, February 18, 2021 1:05:59 AM(UTC)
Peter1000

Rank: Advanced Member

Groups: Registered
Joined: 1/25/2019(UTC)
Posts: 303
Switzerland

Thanks: 17 times
Was thanked: 79 time(s) in 60 post(s)
I was getting errors, not closing the connection after every command. I would suggest to close the connection after every webrequest.
I also believe that you can send a second command faster than waiting a second. Try it out.

Code:
Dim client as WebRequest = WebRequest.Create("http://127.0.0.1:8088/api/?Function=SetText&Input=Title 0- The Classic Blue.gtzip&SelectedName=Headline.Text&Value=Some Text")
Dim response As WebResponse = client.GetResponse()
response.Close

sleep(1000)

client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=SetText&Input=Title 0- The Classic Blue.gtzip&SelectedName=Headline.Text&Value=other Text")
response = client.GetResponse()
response.Close

doggy  
#9 Posted : Thursday, February 18, 2021 1:24:51 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Peter1000 Go to Quoted Post
I was getting errors, not closing the connection after every command. I would suggest to close the connection after every webrequest.
I also believe that you can send a second command faster than waiting a second. Try it out.



The sleep time was just a way for the example (setting a text in a title ) for the change to be visible when running the script !

FYI: i was not getting an error omitting the first close , but it of course never hurts
sinc747  
#10 Posted : Friday, February 19, 2021 11:01:58 AM(UTC)
sinc747

Rank: Advanced Member

Groups: Registered
Joined: 8/2/2013(UTC)
Posts: 1,072
Man
United States
Location: Fairhope, Alabama USA

Thanks: 553 times
Was thanked: 200 time(s) in 166 post(s)
Awesome Baby!

Thank you.

- Tom
Users browsing this topic
Guest (4)
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.