Difference between revisions of "Printer"
m (Added automatic categorization to Category:Peripheral if {{is-peripheral}} is set in template-data.) |
TheCoryKid (Talk | contribs) |
||
Line 11: | Line 11: | ||
− | == | + | == Recipes == |
{{Crafting grid | {{Crafting grid | ||
|A1=stone |B1=stone |C1=stone | |A1=stone |B1=stone |C1=stone | ||
|A2=stone |B2=Redstone |C2=stone | |A2=stone |B2=Redstone |C2=stone | ||
|A3=stone |B3=Ink_Sac |C3=stone | |A3=stone |B3=Ink_Sac |C3=stone | ||
− | |Output=printer | + | |Output=printer}}{{Crafting grid |
− | }} | + | |A1=Page |B1=Page |C1=Page |
+ | |A2=String |B2=Leather | ||
+ | |Output=printed_book_ | ||
+ | }} | ||
== Usage == | == 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. | 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. | ||
Line 25: | Line 28: | ||
[[File:PrinterGUI.png|thumb|256px|GUI of the Printer]] | [[File:PrinterGUI.png|thumb|256px|GUI of the Printer]] | ||
+ | |||
+ | == 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]](). | ||
+ | <table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | ||
+ | <tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;"> | ||
+ | [[File:Grid_disk.png|24px]] | ||
+ | Printer API | ||
+ | </td></tr> | ||
+ | <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> | ||
+ | |||
+ | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.newPage]]()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Starts a new page. Returns true if page got started, false if not.</td></tr> | ||
+ | |||
+ | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.endPage]]()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Ends the page and prints the page to the output tray. Returns true if page was ended, false if not.</td></tr> | ||
+ | |||
+ | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.write]]([[string]] text)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Writes text to the paper, works the same way as [[term.write|term.write()]]</td></tr> | ||
+ | |||
+ | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.setPageTitle]]([[string]] title)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the title of the page.</td></tr> | ||
+ | |||
+ | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.getInkLevel]]()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of ink in the ink slot.</td></tr> | ||
+ | |||
+ | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.getCursorPos]]()</td> | ||
+ | <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]]([[int (type)|int]] x, [[int (type)|int]] 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> | ||
+ | |||
+ | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[printer.getPageSize]]()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the size of the paper, works the same way as [[term.getSize|term.getSize()]]</td></tr> | ||
+ | </table> | ||
[[Category:Blocks]] | [[Category:Blocks]] |
Revision as of 14:06, 3 May 2013
This page needs some serious TLC, stat! Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: Printer methods are not documented on this page.) |
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
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().
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() |