In Lil, the "+" operator is exclusively for addition. The "," operator joins strings into lists, and writing to the ".text" attribute of a field implicitly concatenates together the elements of a list. In a string literal, a backslash followed by the letter "n" is an escaped newline.
Putting this all together, you could write that fragment as:
on run do if (me.text = "hello") | (me.text = "Hello") log.text:log.text,"\nHello to you as well!" else log.text:log.text"\nI do not understand." end me.value:"" end
You could further simplify the conditional by factoring out the common parts of each subexpression:
on run do log.text:log.text,"\n", if (me.text = "hello") | (me.text = "Hello") "Hello to you as well!" else "I do not understand." end me.value:"" end
To make the initial comparison case-insensitive, you could use the "%l" formatting pattern to convert the input to lowercase:
on run do log.text:log.text,"\n", if "hello" = "%l" format me.text "Hello to you as well!" else "I do not understand." end me.value:"" end
Does that help?