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.

Help
#1
Hi all, please help, I have a script with two conditions and I need the script to start working if the first condition is false and the other true. For example...

Twilight = grp.getvalue("9/1/2") 
ObjA = grp.getvalue("9/2/100")  

if Twiligt false and ObjA == true then

Where am I making a mistake?

Thanks
Reply
#2
You can do something like this:

Code:
if twilight == true or objA == true then
-- do something
end

or shorter way:

Code:
if twilight or objA then
-- do something
end
Reply
#3
to Buuuudzik
I know, but I need to judge both conditions at once so one will be false and the other true...
Reply
#4
(09.08.2017, 20:23)kostal.borek Wrote: to Buuuudzik
I know, but I need to judge both conditions at once so one will be false and the other true...

If I understand right you want doing something when this 2 values will be opposite? If yes below script should be enough:
Code:
if twilight ~= objA then
-- do something
end
Reply
#5
(09.08.2017, 18:26)kostal.borek Wrote: Hi all, please help, I have a script with two conditions and I need the script to start working if the first condition is false and the other true. For example...

Twilight = grp.getvalue("9/1/2") 
ObjA = grp.getvalue("9/2/100")  

if Twiligt false and ObjA == true then

Where am I making a mistake?

Thanks

Hi Kostal,
First make sure that 9/1/2 and 9/2/100 are booleans. Then try this :

Code:
Twilight = grp.getvalue('9/1/2')
ObjA = grp.getvalue('9/2/100')  

if (Twiligt == false and ObjA == true) then
--do something
end


Chouaibou.
Reply
#6
Hi, apologize to all. I have not noticed errors in my own script. In the first line I wrote Twilight and in the third I wrote Twiligt ...
Reply


Forum Jump: