printer.getInkLevel

From ComputerCraft Wiki
Revision as of 18:36, 9 April 2014 by MKlegoman357 (Talk | contribs) (Expanded)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.