Difference between revisions of "Printer.getInkLevel"
From ComputerCraft Wiki
MathManiac0 (Talk | contribs) (Added Page) |
MKlegoman357 (Talk | contribs) m (Expanded) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
{{Function | {{Function | ||
− | |name=printer.getInkLevel | + | |name=''printer''.getInkLevel |
− | |returns= | + | |returns={{type|number}} amount of ink in the printer. |
− | |api= | + | |api=printer |
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc= | + | |desc=Returns the amount of ink in the printer's ink slot. |
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc=Prints | + | |desc=Prints how much ink there is in the printer (assuming there are 6 ink sacs in the printer). |
− | |code= | + | |code= local printer = [[peripheral.wrap]]("left") |
− | |output= | + | local inkAmount = printer.getInkLevel() |
+ | |||
+ | print("There is/are " .. inkAmount .. " dye(s) in the printer.") | ||
+ | |output=There is/are 6 dye(s) in the printer. | ||
}} | }} | ||
}} | }} | ||
+ | |||
+ | [[Category:Lua_Core_Functions]] |
Latest revision as of 18:36, 9 April 2014
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
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. |