This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Simple OR/if not script
#1
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
Reply
#2
Code:
if value ~= 2 and value ~= 8 and value ~= 20 then
Reply
#3
Thanks,

It now works as intended Smile

BR,
Mr.D
Reply
#4
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
Reply


Forum Jump: