If you're running OpenOS, there's a proper way to disable hard interrupts: require("process").info().data.signal = function() end. This function is the interrupt handler, and by populating the body of the function, you can define the desired behavior when Ctrl-Alt-C is pressed. Though the pcall solution makes sense if you want to restart the program when it crashes (because of a bug, for instance).
For the sake of completeness, soft interrupts, Ctrl-C without the Alt key, generate an interrupted event.
Thanks I'm glad I could help.
Yes, you can add as many elseif statements with other slaves. But if you have a lot, then you might think about other solutions like using a table, as I mentioned above. This then has better readability and better performance.
The string containing "%s" is a format string. The "%s" is a place holder and at that position a string is filled in. There are multiple types of placeholders, for example "%d" and "%f", which are placeholders for integers and floats. You can read more on that at http://www.lua.org/manual/5.3/manual.html#pdf-string.format and https://en.wikipedia.org/wiki/Printf_format_string.
Yeah, this is totally possible since you distinguish the slaves by their addresses, so use only 1 port.