Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Monitor = {}
- Monitor.__index = Monitor
- function Monitor:new(side)
- if peripheral.getType(side) ~= "monitor" then
- error("ERROR: This peripheral is not a monitor! It's a " .. monitor.getType())
- end
- local monitor = {}
- print(type(peripheral))
- print(getmetatable(peripheral))
- setmetatable(monitor,Monitor)
- setmetatable(Monitor, peripheral.wrap(side))
- monitor.side = side
- monitor:getCursorPos()
- monitor:intialize()
- return monitor
- end
- function Monitor:initialize()
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.setTextScale(.5)
- end
- function Monitor:getType()
- return peripheral.getType(self.side)
- end
- function Monitor:newLine()
- x,y = self.getCursorPos()
- self.setCursorPos(1,y+1)
- end
- monitor = Monitor:new("top")
- monitor:newLine()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement