Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- peripheral.find("modem", rednet.open)
- local input = false
- print("Starting loop")
- while (true)
- do
- if (redstone.getInput("left")) then
- if (input == false) then
- print("Sending ping...")
- rednet.send(tonumber(arg[1]), "ping")
- end
- input = true
- else
- input = false
- end
- local id, msg = rednet.receive(nil, 0.1)
- if (id == tonumber(arg[1]) and msg == "ping") then
- print("Received ping...")
- redstone.setOutput("right", true)
- os.sleep(1)
- redstone.setOutput("right", false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement