Difference between revisions of "Printer (API)"
From ComputerCraft Wiki
Smiley43210 (Talk | contribs) m (Add Method Name and Description row to table) |
|||
Line 6: | Line 6: | ||
Printer (API) | Printer (API) | ||
</td></tr> | </td></tr> | ||
+ | |||
+ | <tr><td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr> | ||
+ | |||
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.getPaperLevel]]()</td> | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.getPaperLevel]]()</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of paper available in the paper tray.</td></tr> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of paper available in the paper tray.</td></tr> |
Revision as of 16:06, 3 May 2013
The Printer API allows you to interact with printers.
Method Name | Description |
printer.getPaperLevel() | Returns the amount of paper available in the paper tray. |
printer.newPage() | Starts a new page. Returns true if page got started, false if not. |
printer.endPage() | Ends the page and prints the page to the output tray. Returns true if page was ended, false if not. |
printer.write(string text) | Writes text to the paper, works the same way as term.write() |
printer.setPageTitle(string title) | Sets the title of the page. |
printer.getInkLevel() | Returns the amount of ink in the ink slot. |
printer.getCursorPos() | Returns the coordinates of the cursor on the paper, works the same way as term.getCursorPos() |
printer.setCursorPos(int x, int y) | Sets the cursor pos, works the same way as term.setCursorPos() |
printer.getPageSize() | Returns the size of the paper, works the same way as term.getSize() |
Note
All printer functions are to be used after wrapping the printer in a peripheral. example: printer = peripheral.wrap("left")