vMix Forums
»
General
»
GT
»
Script to Restart Data Rotation on Blank Text Field
Rank: Member
Groups: Registered
Joined: 8/26/2020(UTC) Posts: 16 Location: Charlotte Thanks: 1 times
|
So I have a script that I use for rotating data and it works great with the exception of when the last line of data in the sheet is blank. I was wondering if there was a way to modify the script below to start from the beginning if a certain text field is blank. Is this possible and how would I go about writing that script. I tried putting in an if statement before but It returned an error so I know i didnt go about it correctly. As always, thank you for the help! Hunter Code:
while (true)
For i As Integer = 0 to 2
Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=DataSourceSelectRow&Value=Show_Graphics,Wins_to_Date," & i )
Dim response = client.GetResponse()
Sleep(10000)
Next
end while
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,209 Location: Belgium Thanks: 291 times Was thanked: 954 time(s) in 789 post(s)
|
First off , why would your datasources have blank lines ? Then you could use to auto next and loop of your data source
but to your question, sure check for blank result and let the script appropriately respond to that. Maybe show what you tried ?
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/26/2020(UTC) Posts: 16 Location: Charlotte Thanks: 1 times
|
Originally Posted by: doggy First off , why would your datasources have blank lines ? Then you could use to auto next and loop of your data source
but to your question, sure check for blank result and let the script appropriately respond to that. Maybe show what you tried ? So I have data coming in that needs to be easy entry for my directors. They enter the information into an excel sheet and I have one graphic pulling the data how it is laid out there. However, I need the data restructured into rows of five for another graphic. So I have excel pulling the data into another sheet with this information. I have 15 lines available for entry (3 Rows) however, sometimes the data does not fully reach 15 lines. Some days we have 9 items, some days we have 11, some days 7, etc. The problem with the rows is when there is blank data in the sheet, vmix still reads the cells as active because of the formulas in the excel sheet. Because of this, the rows will always be there regardless of data, which is why i need to figure out a way to cycle back if the text field is blank. This is what I tried earlier: Code:
while (true)
For i As Integer = 0 to 2
Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=DataSourceSelectRow&Value=Show_Graphics,Wins_to_Date," & i )
Dim response = client.GetResponse()
if Input.Find("Wins_to_Date.gtzip").Text("Driver_Name_1.Text")=""
i = 0
Sleep(10000)
end if
Next
end while
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,209 Location: Belgium Thanks: 291 times Was thanked: 954 time(s) in 789 post(s)
|
while it should work it wont do nicely as it will still display the blank one for the set pause time (add an "else" before)
your setting your x=to 0 but the "next" instruction will make it skip a line so consider another logic to loop through the list like just a do while with handling the x value (add and reset etc)
ps. always help to tell what error you are getting
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/26/2020(UTC) Posts: 16 Location: Charlotte Thanks: 1 times
|
Originally Posted by: doggy while it should work it wont do nicely as it will still display the blank one for the set pause time (add an "else" before)
your setting your x=to 0 but the "next" instruction will make it skip a line so consider another logic to loop through the list like just a do while with handling the x value (add and reset etc)
ps. always help to tell what error you are getting Thanks, You directed me in the right direction and I was able to craft a solution. I have it currently set up on a loop as long as "i" is less than 4 (which it will never reach) The graphic and script now work perfectly for what I was looking for. Code:
while (true)
Dim i As Integer = 0
do while i<4
Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=DataSourceSelectRow&Value=Show Graphics,Wins to Date," & i )
Dim response = client.GetResponse()
if Input.Find("Winners to Date.gtzip").Text("Position 1.Text")=""
i = 0
Elseif i=3
i=0
Else Sleep(10000)
i=i+1
end if
loop
end while
any tips on consolidating or refining the code is always welcome Thanks again!
|
|
|
|
Rank: Member
Groups: Registered
Joined: 4/13/2021(UTC) Posts: 15 Location: Düsseldorf
|
Hi, Can you please see what is the issue in my setting here, I tried to use your script, but my text doesn't showing other rows, just remain in first row. title or input in vmix is: title_01.gtzip data source name is: DATA.XLSX text layer name: text_01.text Excel sheet name: sheet01 Quote: while (true) Dim i As Integer = 0 do while i<4 Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=DataSourceSelectRow&Value=DATA,sheet01," & i ) Dim response = client.GetResponse()
if Input.Find("title_01.gtzip").Text("text_01.text")="" i = 0
Elseif i=3 i=0
Else Sleep(1000)
i=i+1
end if loop end while
|
|
|
|
vMix Forums
»
General
»
GT
»
Script to Restart Data Rotation on Blank Text Field
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