Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this program check if printer have paper or ink
- local printer = peripheral.wrap("back")
- if printer.getPaperLevel() == 0 then -- If there is no paper in the printer
- error("There is no paper in the printer!")
- end
- if printer.getInkLevel() == 0 then -- If there is no ink in the printer
- error("There is no ink in the printer!")
- end
- -- There is paper and ink in the printer, we can now print a page
- -- if printer.newPage() then
- -- printer.write("Tasks:")
- -- printer.setCursorPos(1, 3)
- -- printer.write("* Check melon farm")
- -- printer.setCursorPos(1, 4)
- -- printer.write("* Get more ender pearls")
- -- printer.setPageTitle("Tasks")
- -- printer.endPage()
- -- else
- -- error("Page could not be created.")
- -- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement