Difference between revisions of "Printer"

From ComputerCraft Wiki
Jump to: navigation, search
m (Add Method Name and Description row to table)
(Re-applied previous changes which were accidentally deleted (added recipes).)
Line 1: Line 1:
{{NeedsWork|Printer methods are not documented on this page.}}
 
 
{{Block
 
{{Block
 
|name=Printer
 
|name=Printer
Line 9: Line 8:
 
}}
 
}}
 
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.
 
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 ==
 
== 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).
 
{{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}}{{Crafting grid
+
  |Output=printer
  |A1=Page |B1=Page |C1=Page
+
}}
 +
{{Crafting grid
 +
|B1=printed_page
 +
|A2=String      |B2=printed_page
 +
|B3=printed_page
 +
|Output=printed_pages
 +
}}
 +
{{Crafting grid
 +
|A1=printed_pages  |B1=printed_pages  |C1=printed_pages
 +
|A2=printed_page  |B2=printed_page  |C2=printed_page
 +
|B3=String
 +
|Output=printed_pages
 +
}}
 +
{{Crafting grid
 +
  |A1=printed_page |B1=printed_page |C1=printed_page
 
  |A2=String |B2=Leather
 
  |A2=String |B2=Leather
 +
|Output=printed_book_
 +
}}
 +
{{Crafting grid
 +
|A1=printed_pages |B1=printed_pages |C1=printed_pages
 +
|A2=printed_page  |B2=printed_page |C2=printed_page
 +
|A3=String        |B3=Leather
 
  |Output=printed_book_
 
  |Output=printed_book_
 
}}
 
}}
Line 26: Line 45:
 
If you are using blocks to pull/insert items from the printer the different slots are available from these sides:
 
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.
 
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.
 
[[File:PrinterGUI.png|thumb|256px|GUI of the Printer]]
 
  
 
== Printer API ==
 
== Printer API ==
Line 66: Line 83:
 
<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>
 
<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>
 
</table>
 +
 +
[[File:PrinterGUI.png|thumb|256px|GUI of the Printer]]
  
 
[[Category:Blocks]]
 
[[Category:Blocks]]

Revision as of 15:23, 3 May 2013

Grid workbench.png   Printer
Iso Printer.png
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).

stone

stone

stone

stone

Redstone

Ink_Sac

stone

stone

stone

printer




String


printed_page

printed_page

printed_page



printed_pages



printed_pages

printed_page


printed_pages

printed_page

String

printed_pages

printed_page


printed_pages



printed_page

String


printed_page

Leather


printed_page


printed_book_



printed_pages

printed_page

String

printed_pages

printed_page

Leather

printed_pages

printed_page


printed_book_



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().

Grid disk.png   Printer API

Method NameDescription
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()
GUI of the Printer