Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.find("modem")
- local monitor = peripheral.find("monitor")
- modem.open(12345)
- term.redirect(monitor)
- local surface = dofile("surface")
- local w, h = monitor.getSize()
- local surf = surface.create(w, h, colors.white, colors.black)
- function drawMessage(t)
- local screeningMessage = "Now Playing:"
- surf:clear()
- surf:drawString(screeningMessage, (math.floor((w - string.len(screeningMessage)) / 2)), 0)
- surf:drawString(t, (math.floor((w - string.len(t)) / 2)), 3)
- surf:output(monitor)
- end
- local message = "nothing recieved"
- drawMessage("nothing recieved")
- while true do
- --print(os.pullEvent("modem_message"))
- event, side, sendCh, recieveCh, message = os.pullEvent("modem_message")
- drawMessage(message)
- end
Add Comment
Please, Sign In to add comment