printer.getInkLevel

From ComputerCraft Wiki
Jump to: navigation, search


Grid Redstone.png  Function printer.getInkLevel
Returns the amount of ink in the printer's ink slot.
Syntax printer.getInkLevel()
Returns number amount of ink in the printer.
Part of ComputerCraft
API printer

Examples

Grid paper.png  Example
Prints how much ink there is in the printer (assuming there are 6 ink sacs in the printer).
Code
local printer = peripheral.wrap("left")
local inkAmount = printer.getInkLevel()

print("There is/are " .. inkAmount .. " dye(s) in the printer.")
Output There is/are 6 dye(s) in the printer.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox