Logic Machine Forum
Simple OR/if not script - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Simple OR/if not script (/showthread.php?tid=776)



Simple OR/if not script - Mr.D - 06.05.2017

Hi,

I not getting this code to work as intended.

This is where I struggle:
if not value == (2 or 8 or 20) then
 grp.write('Status - Scener - Kjellerstue', 3)
end
Anyone know what I am doing wrong?

Code:
value = event.getvalue()
value1 = grp.getvalue('Status - Skallsikring - Av/På')
if value == 2 and value1 == true then
end
if value == 8 and value1 == true then
 grp.write('Status - Scener - Kjellerstue', 1)
end
if value == 20 and value1 == true then
 grp.write('Status - Scener - Kjellerstue', 2)
end
if not value == (2 or 8 or 20) then
 grp.write('Status - Scener - Kjellerstue', 3)
end

Thanks,

Mr.D


RE: Simple OR/if not script - admin - 06.05.2017

Code:
if value ~= 2 and value ~= 8 and value ~= 20 then



RE: Simple OR/if not script - Mr.D - 06.05.2017

Thanks,

It now works as intended Smile

BR,
Mr.D


RE: Simple OR/if not script - Erwin van der Zwart - 06.05.2017

Hi,

You could also use this:

if value1 == true then
   if value == 2 then

   elseif value == 8 then

   elseif value == 20 then

   else
   
   end

end


BR,

Erwin