Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Code for Recieving PCs
- function listen()
- local modem = peripheral.wrap("right")
- modem.open(3)
- local event, modemSide, senderChannel,
- replyChannel, message, senderDistance = os.pullEvent("modem_message")
- modem.close(3)
- CheckMessage(message)
- end
- function box1()
- print("Box 1")
- --[[redstone.setOutput("back", true)
- os.sleep(99)
- redstone.setOutput("back", false)
- listen()]]--
- end
- function box2()
- print("Box 2")
- --[[redstone.setOutput("back", true)
- os.sleep(99)
- redstone.setOutput("back", false)
- listen()]]--
- end
- function box3()
- print("Box 3")
- --[[redstone.setOutput("back", true)
- os.sleep(99)
- redstone.setOutput("back", false)
- listen()]]--
- end
- function CheckMessage(message1)
- local boxes1 = "box1"
- local boxes2 = "box2"
- local boxes3 = "box3"
- if message1 == "boxes1"
- then
- print("ok1")
- box1()
- elseif message1 == "boxes2"
- then
- print("ok2")
- box2()
- elseif message == "boxes3"
- then
- print("ok3")
- box3()
- else
- end
- end
- --program
- listen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement