Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- side = "back"
- modem = "right"
- rednet.open(modem)
- function ts(string)
- return textutils.serialize(string)
- end
- while true do
- channel,message = rednet.receive()
- if message == "lock" then
- lock = true
- elseif message == "unlock" then
- lock = false
- elseif message == "open" then
- door = false
- elseif message == "close" then
- door = true
- end
- print("lock: "..ts(lock))
- print("door: "..ts(door))
- if lock and not door then
- rs.setBundledOutput(side,colors.white)
- elseif not lock and not door then
- rs.setBundledOutput(side,0)
- elseif lock and door then
- rs.setBundledOutput(side,colors.combine(colors.white,colors.red))
- elseif not lock and door then
- rs.setBundledOutput(side,colors.red)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement