Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local m = peripheral.find "modem"
- local o = peripheral.find "monitor"
- o.setTextScale(0.5)
- m.open(31415)
- term.redirect(o)
- local function ignore(c, rc)
- --print(c, rc)
- local i =
- c == 666 or c == 999 or rc == 999
- return i
- end
- while true do
- local e = { os.pullEvent "modem_message" }
- local msg = e[5]
- --print(msg.origin)
- --print(msg.type)
- if msg.type == "position fix" and not ignore(msg.channel, msg.replyChannel) then
- local p = msg.position
- print("@", p.x, p.y, p.z)
- elseif msg.origin == "VLA by Anavrins" and not ignore(msg.senderChannel, msg.replyChannel) then
- print(tostring(msg.senderChannel) .. " \16 " .. tostring(msg.replyChannel) .. " | " .. tostring(msg.senderDistance))
- local ok, err = pcall(textutils.serialise, msg.message)
- if not ok then print "[UNSERIALIZABLE]"
- else print(err) end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement