Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- if not args[1] or not args[2] or args[3] then return end
- local text = args[1]
- local mon = peripheral.wrap(args[2])
- local bgcolor = colors.blue
- local fgcolor = colors.white
- term.redirect(mon)
- local w, h = term.getSize()
- term.clear()
- term.setBackgroundColor(bgcolor)
- term.setTextColor(fgcolor)
- if h % 2 ~= 0 then h = h + 1 end
- if w % 2 ~= 0 then w = w + 1 end
- term.setCursorPos(w / 2 - string.len(text) / 2 + 1, math.floor(h / 2))
- term.write(text)
Advertisement
Add Comment
Please, Sign In to add comment