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.

Script_Disable: strange behaviour
#1
Code:
12345678
script.disable('Valvola_Bagno_Giorno_Automatismo') termostato_giorno = event.getvalue() os.sleep(0.2) if termostato_giorno == true then  grp.write('2/0/8', true) -- valvola bagno giorno   end os.sleep(10) script.enable('Valvola_Bagno_Giorno_Automatismo')
Code:
12345678
script.disable('Valvola Bagno Notte Automatismo') termostato_notte = event.getvalue() os.sleep(0.2) if termostato_notte == true then   grp.write('2/0/5', true) -- indirizzo valvola bagno notte     end os.sleep(5) script.enable('Valvola Bagno Notte Automatismo')


Hi above 2 event based script which works but in the first case script anable and disable does not work. I mean that does not disable the script ('Valvola_Bagno_Giorno_Automatismo'). The name of the script is correct.

I cannot the reason why in the second script I see the resident script ('Valvola Bagno Notte Automatismo') which change its status. In the other case no.

I cannot understand the reason why.

Thanks.
Reply
#2
Are you sure that the name is correct? In one place you have name with spaces, in another with "_". You can also do this:
Code:
1
log(script.disable('Valvola_Bagno_Giorno_Automatismo'))

If logged value is nil it means that script is not found.
Reply
#3
Yes, I used "_" because at the beginning there's not. I copied the name of the script and paste it. The same thing I did with the working script.
In any case I check.
Thanks.

I log the variable.
The first time was bool:false, the second time I test it value was nil. How is it possible?
Thanks.
Reply


Forum Jump: