Posted 12 July 2013 - 08:10 AM
Title: Attempt to index ? (a nil value) but can't find mistake
I'm trying to teach myself the advanced monitor stuff and I started out by trying to fill the complete screen. On Ln 17 I got a 'nil value' error but I have no idea why. Please help :)/>
I'm trying to teach myself the advanced monitor stuff and I started out by trying to fill the complete screen. On Ln 17 I got a 'nil value' error but I have no idea why. Please help :)/>
function StartMonitor()
local wm, hm, monitor
local monitor = peripheral.wrap("top")
local w,h = term.getSize()
monitor.setTextScale(1)
monitor.setCursorPos(1,1)
monitor.clear()
monitor.write("Hello World")
wm, hm = monitor.getSize()
print("Monitor size = " ..wm..","..hm)
print("Terminal size = " ..w..","..h)
end
StartMonitor()
for y=1,hm+1 do
monitor.write(string.rep("*",wm))
monitor.setCursorPos(1,y)
end
monitor.setCursorPos(1,y)