Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("left")
- term.redirect(monitor)
- monitor.setTextScale(2)
- term.clear()
- modem = peripheral.wrap("back")
- chan = 36602
- modem.open(chan)
- local function func1 (l)
- local w, h = term.getSize()
- l = #l
- xpos = w/2 - l/2 + 1
- return xpos
- end
- while true do
- event, modemSide, senderChannel, replyChannel, message, distance = os.pullEvent("modem_message")
- if (senderChannel == 36602) then
- message = "Pre Text : " .. message
- term.clear()
- term.setCursorPos(func1(message), 2)
- print(message)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement