Difference between revisions of "Computer (API)"
From ComputerCraft Wiki
MKlegoman357 (Talk | contribs) m (Forgot 'odd' parameter) |
(Add isOn function) |
||
| Line 27: | Line 27: | ||
|[[computer.getID|''computer''.getID]]() | |[[computer.getID|''computer''.getID]]() | ||
|{{type|number}} computerID | |{{type|number}} computerID | ||
| − | | | + | |Returns the ID of the [[Computer]] or [[Turtle]].}} |
| + | {{API table/row | ||
| + | |[[computer.isOn|''computer''.isOn]]() | ||
| + | |{{type|boolean}} power status | ||
| + | |Returns the ON/OFF state of the [[Computer]] or [[Turtle]]. | ||
| + | |odd}} | ||
}} | }} | ||
| − | |||
[[Category: Peripheral APIs]] | [[Category: Peripheral APIs]] | ||
Revision as of 05:00, 18 June 2015
| 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.
|
The Computer API is a peripheral API that allows computers and turtles to interact with other computers and turtles.
computer stands for the variable you wrapped the computer to.
|
| ||
|---|---|---|
| Function | Return values | Description |
| computer.turnOn() | nil | Turns on the Computer or Turtle. |
| computer.shutdown() | nil | Shuts off the Computer or Turtle. |
| computer.reboot() | nil | Reboots the Computer or Turtle. |
| computer.getID() | number computerID | Returns the ID of the Computer or Turtle. |
| computer.isOn() | boolean power status | Returns the ON/OFF state of the Computer or Turtle. |