first method
local width, height = peripheral.call( 'left', 'getSize' )
this is a way not used by many, I just felt like putting it in here :P/>
second method
local monitor = peripheral.wrap( 'left' )
local width, height = monitor.getSize()
this one is used by most people…. but the next is imo the best way…
third method
local monitor = peripheral.wrap('left')
term.redirect(monitor)
local width, height = term.getSize()
term.restore()
this last method is a good method of doing easy printing and such to monitors as you can use the same functions you use for the computer.
it can actually open up some really nice stuff like so
if peripheral.getType('left') == 'monitor' then
term.redirect( peripheral.wrap('left') )
end
print("This text can print on a monitor if there is one available, or else it just prints on the computers screen")
if peripheral.getType('left') == 'monitor' then
term.restore()
end