Posted 19 April 2015 - 12:55 AM
I have recently started working with Monitors. My first goal was to complete a System that automaticly splits the screen in 5 equal parts and writes down the Elements inside a table. It worked when I split the screen equally in 2 Parts and it even worked with 5 when I had really small values for my Elements but now it doesn't work. This is my Code:
local monitor = peripheral.wrap("top")
local x,y = monitor.getSize()
monitor.setTextScale(1)
monitor.clear()
menuString = {"ID","X-Pos","Z-Pos","Holes","Tracked Block"}
for i=1,5,1 do
monitor.setCursorPos(((x/5)-((menuString):len())/2)*i,1)
monitor.write(menuString)
end
local monitor = peripheral.wrap("top")
local x,y = monitor.getSize()
monitor.setTextScale(1)
monitor.clear()
menuString = {"ID","X-Pos","Z-Pos","Holes","Tracked Block"}
for i=1,5,1 do
monitor.setCursorPos(((x/5)-((menuString):len())/2)*i,1)
monitor.write(menuString)
end