computer.isOn
From ComputerCraft Wiki
| Returns the ON/OFF state of the Computer or Turtle wrapped to the computer variable. | |
| Syntax | computer.isOn() |
| Returns | boolean power state |
| Part of | ComputerCraft |
| API | peripheral |
Examples
| Prints the power state of a computer or turtle on the right side of the calling machine. | |
| Code |
local computer = peripheral.wrap("right") print(computer.isOn()) |
| Output | The power state of any computer or turtle to the right of the calling machine. |