printer.getPaperLevel

From ComputerCraft Wiki
Jump to: navigation, search


Grid Redstone.png  Function printer.getPaperLevel
Returns the amount of paper in the printer.
Syntax printer.getPaperLevel()
Returns number the amount of paper in the printer
Part of ComputerCraft
API printer

Examples

Grid paper.png  Example
Prints how much paper there is in the printer (assuming there are 5 sheets of paper in the printer).
Code
local printer = peripheral.wrap("left")
local paperAmount = printer.getPaperLevel()

print("There is/are " .. paperAmount .. " sheet(s) of paper in the printer.")
Output There is/are 5 sheet(s) of paper in the printer.