regarding scripts, how can i put and if statement?
regarding scripts, how can i put and if statement? like for example if the variable a = 1, set it to 0. else, set it to 1.
thanks and God bless!
]]>
< ![CDATA[
This way:
var vars = LL.getVariables();
var value = vars.getInteger(‘a’);
var new_value;
if(value == 0) {
new_value = 1;
} else {
new_value = 0;
}
vars.edit().setInteger(‘a’, new_value).commit();
or in a more consice form:
var vars = LL.getVariables();
vars.edit().setInteger(‘a’, vars.getInteger(‘a’)==0 ? 1 : 0).commit();
or if value is always 0 or 1:
var vars = LL.getVariables();
vars.edit().setInteger(‘a’, 1- vars.getInteger(‘a’)).commit();
]]>
< ![CDATA[
do you have a tutorial on how to use scripts in LL? i’m so interested on scripts but i don’t really have a knowledge about everything. hahaha
]]>
< ![CDATA[
Pierre Hébert thanks!
]]>
< ![CDATA[
Most scripts will have instructions with them. You need to allow scripts to be run menu/settings/lightning general/expert mode/run scripts.
]]>