Difference between revisions of "Printer (API)"
From ComputerCraft Wiki
(Changing int to number) |
m (Added peripheral API message and fixed colspan issue) |
||
Line 1: | Line 1: | ||
+ | {{PeripheralAPI}} | ||
+ | |||
+ | {{NeedsWork|A short description and examples would be useful. - [[User:Oeed|Oeed]] 07:18, 26 March 2014 (GMT)}} | ||
+ | |||
The Printer API allows you to interact with printers. | The Printer API allows you to interact with printers. | ||
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | <table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | ||
− | <tr><td | + | <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]] | [[File:Grid_disk.png|24px]] | ||
Printer (API) | Printer (API) |
Revision as of 07:18, 26 March 2014
This API requires the use of a wrapped peripheral! This API does not behave like a regular API, to use it you must first wrap the peripheral and call the methods on the wrapped object. For more information see this page.
|
This page needs some serious TLC, stat! Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: A short description and examples would be useful. - Oeed 07:18, 26 March 2014 (GMT)) |
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(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() |
Note
All printer functions are to be used after wrapping the printer in a peripheral. example: printer = peripheral.wrap("left")