25.06.2017, 18:07
(This post was last modified: 25.06.2017, 18:11 by Erwin van der Zwart.)
Hi,
Yes, if you want to send multiple commands from a single event based script you can create a byte object and attach this script to it:
In your visu you create 5 buttons that send fixed values 0 to 4 all on the same byte object.
BR,
Erwin
Yes, if you want to send multiple commands from a single event based script you can create a byte object and attach this script to it:
Code:
require('socket.http')
socket.http.TIMEOUT = 15
value = event.getvalue()
if value == 0 then
socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file.mkv')
elseif value == 1 then
socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file1.mkv')
elseif value == 2 then
socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file2.mkv')
elseif value == 3 then
socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file3.mkv')
elseif value == 4 then
socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file4.mkv')
end
BR,
Erwin