Advertisement
karelvysinka

Print 1

Mar 30th, 2023 (edited)
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. local printer = peripheral.wrap("right")
  2.  
  3. if printer.getPaperLevel() == 0 then -- If there is no paper in the printer
  4.   error("There is no paper in the printer!")
  5. end
  6.  
  7. if printer.getInkLevel() == 0 then -- If there is no ink in the printer
  8.   error("There is no ink in the printer!")
  9. end
  10.  
  11. -- There is paper and ink in the printer, we can now print a page
  12.  
  13. if printer.newPage() then
  14.   printer.write("Ahoj TrithCZ :) :)")
  15.  
  16. printer.setCursorPos(1, 3)
  17. printer.write("Tady Scherry,")
  18. printer.setCursorPos(1, 4)
  19. printer.write("Doufam, ze se ti dnes")
  20. printer.setCursorPos(1, 5)
  21. printer.write("dari skvele v Minecraftu!")
  22. printer.setCursorPos(1, 6)
  23. printer.write("Preji ti spoustu zabavy a kreativity.")
  24. printer.setCursorPos(1, 7)
  25. printer.write("Mej se skvele a")
  26. printer.setCursorPos(1, 7)
  27. printer.write("uzivej si hrani!")
  28.  
  29.   printer.setPageTitle("Prani")
  30.   printer.endPage()
  31. else
  32.   error("Page could not be created.")
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement