Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Pocket Computer Control Program
- rednet.open("back") -- Adjust if your modem is on a different side
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Block Toggle Control")
- print("1. Toggle block")
- print("2. Exit")
- local _, key = os.pullEvent("key")
- if key == keys.one then
- rednet.broadcast("toggle", "trapdoor")
- print("Signal sent to turtle")
- local sender, message = rednet.receive("trapdoor_response", 5)
- if message then
- print("Turtle response: " .. message)
- else
- print("No response from turtle")
- end
- sleep(2)
- elseif key == keys.two then
- break
- end
- end
- rednet.close("back")
Advertisement
Add Comment
Please, Sign In to add comment