Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.find("monitor")
- if (monitor) then
- term.redirect(monitor)
- end
- term.clear()
- term.setCursorPos(1, 1)
- local modem = peripheral.find("modem")
- local channel = 355
- modem.open(channel)
- local speaker = peripheral.find("speaker")
- if (os.getComputerLabel() == nil) then
- os.setComputerLabel("Server")
- end
- while (true) do
- local event, keycode, isHeld, _, message, _ = os.pullEvent()
- if (event == "modem_message") then
- if (speaker) then
- speaker.playSound("minecraft:entity.player.levelup", 3, 0.5297)
- end
- if (message.label and message.message and message.replies) then
- term.setTextColor(colors.lightBlue)
- write("[" .. textutils.formatTime(os.time(), true ) .. "] (" .. message.label .. "): ")
- term.setTextColor(colors.white)
- write(message.message .. "\n")
- local next = next --For efficiency
- if (next(message.replies) ~= nil) then
- term.setTextColor(colors.yellow)
- print("Press any key to mark as read")
- os.pullEvent("key")
- end
- modem.transmit(channel, channel, {label = os.getComputerLabel(), message = "continue"})
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement