Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("right")
- rednet.open("top")
- serverID = 2
- connected = false
- os.loadAPI("APIs/server")
- --FUNCTIONS
- local function clear()
- m.clear()
- m.setCursorPos(1, 1)
- end
- server.TestConnection()
- server.connect("monitor", "password-monitor-password")
- senderID, message, distance = rednet.receive()
- if message == "login" then
- print("Connection done!")
- connected = true
- else
- print("Fail")
- end
- while connected do
- local senderID, message, distance = rednet.receive()
- print("Getting message.")
- print(message)
- if message == "anyMonitors" then
- rednet.broadcast("monitor")
- end
- if message == "sendTo" then
- print(senderID, ": Requesting data... Waiting for sender.")
- senderID, message, distance = rednet.receive()
- print(senderID, ": Sent message: ", message)
- clear()
- m.write(message)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment