Difference between revisions of "Printer.getPaperLevel"
From ComputerCraft Wiki
(Created page with "{{lowercase}} {{Function |name=printer.getPaperLevel |args=none |returns=Value(Number) |api=printer |addon=ComputerCraft |desc=Returns the total amount of paper in the printer...") |
MKlegoman357 (Talk | contribs) |
||
(7 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
{{Function | {{Function | ||
− | |name=printer.getPaperLevel | + | |name=''printer''.getPaperLevel |
− | | | + | |returns={{type|number}} the amount of paper in the printer |
− | | | + | |
|api=printer | |api=printer | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Returns the | + | |desc=Returns the amount of paper in the printer. |
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc= | + | |desc=Prints how much paper there is in the printer (assuming there are 5 sheets of paper in the printer). |
− | |code=printer.getPaperLevel() | + | |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. | ||
}} | }} | ||
}} | }} | ||
+ | |||
+ | [[Category:Lua_Core_Functions]] |
Latest revision as of 17:48, 10 April 2014
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
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. |