Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for k,v in pairs(rs.getSides()) do
- if peripheral.getType(v) == "modem" then
- rednet.open(v)
- end
- end
- if fs.exists("floor") then
- file = fs.open("floor", "r")
- floor = file.readAll()
- file.close()
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Which number will this be on the monitor?")
- write("> ")
- floor = read()
- file = fs.open("floor", "w")
- file.write(floor)
- file.close()
- term.clear()
- term.setCursorPos(1,1)
- print("Thank you.")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- end
- while true do
- id,message,proto = rednet.receive("teleport")
- touchData = textutils.unserialize(message)
- if touchData.sender == floor then
- rs.setOutput("left", true)
- sleep(0.5)
- rs.setOutput("left",false)
- end
- if touchData.destination == floor then
- rs.setOutput("right", true)
- sleep(0.5)
- rs.setOutput("right",false)
- end
- print(message)
- end
Add Comment
Please, Sign In to add comment