Thank you so much!
Am I to understand that if I have the library saved, make changes and set it to the same name, it will overwrite the original library? Is this code backed up with the project?
Without "Keep source" only the compiled bytecode library is saved. The editor will be empty in this case because the source is not kept. You can put new code there and it will overwrite the current library. The backup will include such library but without the source code of course.
I couldn't do something. Can you give a concrete example of how to put this sample code into a library, running as a resident script with 0 sleep time?
Code:
12345678910111213141516171819
ifnotpirsthenpirs = {
{ input = '1/1/1', output = '2/1/1' },
{ input = '1/1/2', output = '2/1/2' },
}
endnow = os.time()
for_, pirinipairs(pirs) dokey = 'pir_timer_' .. pir.inputdelta = now - storage.get(key, 0)
-- set output to 0% after 1 hourifdelta > 60 * 60thengrp.checkwrite(pir.output, 0)
-- set output to 20% after 30 minuteselseifdelta > 30 * 60thengrp.checkwrite(pir.output, 20)
end