Posted 03 January 2016 - 10:35 AM
term.clear()
term.setCursorPos(1,1)
print("===================================================")
term.setCursorPos(1,18)
print("===================================================")
term.setCursorPos(20,2)
print("Desk Text")
newLine()
newLine()
print("What would you like your desk to say?")
newLine()
write(" Input: ")
local input = read()
mon = peripheral.wrap("left")
function centerText(text)
x,y = mon.getSize()
x1,y1 = mon.getCursorPos()
mon.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
mon.write(text)
end
mon.clear()
mon.setTextScale(2)
centerText(input)
newLine()
print(" Text is being displayed on the monitor!")
function newLine()
local _,cY = term.getCursorPos()
term.setCursorPos(1, cY+1)
end
The error I keep getting is:
desk:8: attempt to call nil
Maybe it's something simple, but I can't see it. It's also 5:33am
Edited on 04 January 2016 - 02:41 AM