Difference between revisions of "Printer (API)"

From ComputerCraft Wiki
Jump to: navigation, search
(Remaking this page?)
 
(This page got lost or missed? Moved to CAT:APIs, upgraded to API rundown v2.)
Line 1: Line 1:
 
The Printer API allows you to interact with printers.
 
The Printer API allows you to interact with printers.
  
==Methods==
+
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;">
{| border="1" cellpadding="2" cellspacing="0"
+
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;">
!style="background:#EEE" width="200px"|Method name
+
[[File:Grid_disk.png|24px]]&nbsp;&nbsp;
!style="background:#EEE" width="*"|Description
+
Printer (API))
|-
+
</td></tr>
| [[printer.getPaperLevel]]()
+
<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>
|-
+
 
| [[printer.newPage]]()
+
<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>
|-
+
 
| [[printer.endPage]]()
+
<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>
|-
+
 
| [[printer.write]]([[string]] text)
+
<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>
|-
+
 
| [[printer.setPageTitle]]([[string]] title)
+
<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>
 +
 
 +
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;"></td>
 +
<td style="border-top: solid #C9C9C9 1px; padding: .4em;"></td></tr>
 +
</table>
 +
 
 +
[[Category:APIs]]

Revision as of 10:53, 1 December 2012

The Printer API allows you to interact with printers.

Grid disk.png   Printer (API))

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