I'am trying to convert a few of my blockys to LUA, but its not working out.
Here are the blocky original: Here my LUA code :
Code: Select all
commandArray = {}
--
-- Turn on the Day scene
--
if (devicechanged['Virt_Day'] == 'On' and
otherdevices['Hemma'] == 'On' and
otherdevices['Virt_Dark'] == 'Off' and
otherdevices['Virt_Sleep'] == 'Off' and
otherdevices['Virt_TV'] == 'Off' ) then
commandArray['Scene:Day'] = 'On'
print('Day')
end
--
-- Turn on the Dusk light scene
--
elseif (devicechanged['Virt_Dusk_light'] == 'On' and
otherdevices['Hemma'] == 'On' and
otherdevices ['Virt_Dark'] == 'Off' and
otherdevices ['Virt_Sleep'] == 'Off' and
otherdevices ['Virt_TV'] == 'Off' and
otherdevices ['Virt_Dusk'] == 'Off') then
commandArray['Scene:Dusk light'] = 'On'
print('Dusk light')
end
--
-- Turn on the Dusk scene
--
elseif (devicechanged['Virt_Dusk'] == 'On' and
otherdevices ['Hemma'] == 'On' and
otherdevices ['Virt_Dark'] == 'Off' and
otherdevices ['Virt_Sleep'] == 'Off' and
otherdevices ['Virt_TV'] == 'Off' and
otherdevices ['Virt_Dusk_light'] == 'Off') then
commandArray['Scene:Dusk'] = 'On'
print('Dusk')
end
--
-- Turn on the Dark scene
--
elseif (devicechanged['Virt_Dark'] == 'On' and
otherdevices ['Hemma'] == 'On' and
otherdevices ['Virt_Dusk'] == 'Off' and
otherdevices ['Virt_Sleep'] == 'Off' and
otherdevices ['Virt_TV'] == 'Off' and
otherdevices ['Virt_Dusk_light'] == 'Off') then
commandArray['Scene:Dark'] = 'On'
print('Dark')
end
If anyone have a good page for the first few steps on how LUA are working please send it to me =)
I've tried to read the lua guide on the wiki, but its going to fast over my head on how to start LOL
Regards Magnus Svensson