Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local width = 18
- local height = 12
- monitor = peripheral.wrap("right")
- monitor.clear()
- monitor.setCursorPos(1,1)
- function writeCenterText(text, lheight)
- local mid = width / 2
- monitor.setCursorPos(mid - (#text / 2), lheight)
- monitor.write(text)
- end
- writeCenterText("Testing", 5)
- writeCenterText("Testing1", 6)
- local running = true
- monitor.clear()
- while(running) do
- print("Enter your message:")
- local input = read()
- if(input == "quitNow") then
- running = false
- else
- local text = input
- print("Enter the width:")
- local lwidth = tonumber(read())
- print("Enter the height:")
- local lheight = tonumber(read())
- monitor.clear()
- monitor.setCursorPos(lwidth, lheight)
- monitor.write(text)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement