Difference between revisions of "Printer"
m (Implement {{BlocksItemsList}}) |
(→Printer API: Changing int to number) |
||
Line 77: | Line 77: | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the coordinates of the cursor on the paper, works the same way as [[term.getCursorPos|term.getCursorPos()]]</td></tr> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the coordinates of the cursor on the paper, works the same way as [[term.getCursorPos|term.getCursorPos()]]</td></tr> | ||
− | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.setCursorPos]]( | + | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.setCursorPos]]({{type|number}} x, {{type|number}} y)</td> |
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the cursor pos, works the same way as [[term.setCursorPos|term.setCursorPos()]]</td></tr> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the cursor pos, works the same way as [[term.setCursorPos|term.setCursorPos()]]</td></tr> | ||
Revision as of 14:29, 18 July 2013
Printer | |
Item ID | 4094 |
Damage Value | Un-used. |
Peripheral? | Yes- Printer (API) |
The printer was added in the ComputerCraft 1.42 update. The printer is placed next to a computer, and allows for printing text onto paper with any color of ink.
Recipes
Using the printer will produce Printed Page. These pages can be used in two different shapeless recipes: Printed Pages and Printed Book. Using any of these when on your hotbar will allow you to view their contents (much like with signed books in vanilla).
Usage
To use a printer, place it adjacently but not diagonally next to a computer (left, right, top, bottom, front, or back side). Place any color ink in the single left slot, and paper in any of the top slots.
If you are using blocks to pull/insert items from the printer the different slots are available from these sides: Paper tray is accessible from the top, output paper tray is accessible from the front or bottom, and the ink slot is accessible from the back or sides.
Printer API
The printer API allows programs to interact in various ways with the printer. In order for these functions to become available, you must first wrap the printer as a peripheral using peripheral.wrap().
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(number x, number 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() |