Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("program started")
- local messageToReceiveDown = "ROFF"
- local messageToReceiveUp = "RON"
- local modemDirect = "bottom"
- rednet.open(modemDirect)
- if (rednet.isOpen(modemDirect)) then
- print ("Modem is Open, Direction " ..modemDirect)
- else
- printError("Modem not found")
- end
- while true do
- local id, message, protocol = rednet.receive()
- if (message == messageToReceiveUp) then
- print("message received " ..message)
- message = "a"
- sleep (1)
- elseif (message == messageToReceiveDown) then
- print("message received " ..message)
- message = "a"
- sleep (1)
- else
- print("message not received!")
- sleep (1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement