Posted 30 August 2012 - 03:45 AM
So as the title states, im making a monitor which is 5x3
but it produces the error ":9: attempt to get length of nil"
i've played around with line 9 but i cant get it to work :/
This is the code:
please help me! :)/>/>
but it produces the error ":9: attempt to get length of nil"
i've played around with line 9 but i cant get it to work :/
This is the code:
local tText = {
"random gibberish"
}
local sSide = "right"
local nTextSize = 2
local function printCenter(mon, t)
local w, h = mon.getSize()
local y = math.floor((h / 3) - (#t / 3)) - 1
for i, line in ipairs(t) do
local x = math.floor((w / 5) - (#line / 5))
mon.setCursorPos(x, y + i)
mon.write(line)
end
end
local mon = peripheral.wrap(sSide)
mon.setTextScale(nTextSize)
printCenter(mon, tText)
please help me! :)/>/>