Difference between revisions of "Computer.shutdown"

From ComputerCraft Wiki
Jump to: navigation, search
m (Tidied up source, made code multi-line)
Line 1: Line 1:
{{lowercase}}
 
 
{{Function
 
{{Function
|name=computer.shutdown
+
|name=computer.shutdown
|api=peripheral
+
|api=peripheral
|addon=ComputerCraft
+
|addon=ComputerCraft
|desc=Shuts down a computer wrapped to the "computer" variable
+
|desc=Shuts down a computer or turtle wrapped to the "computer" variable
|examples=
+
|examples={{Example
{{Example
+
|desc=Shuts down the computer or turtle on the right side of the calling machine.
|desc=Shuts down the computer or turtle on the right side of the calling machine.
+
|code=
|code=local handle = peripheral.wrap("right") handle.shutdown()
+
  local handle = peripheral.wrap("right")  
|output=Shuts down any computer to the right of the computer/turtle.
+
handle.shutdown()
 +
|output=Shuts down any computer to the right of the computer/turtle.
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Revision as of 02:44, 12 May 2013

Grid Redstone.png  Function computer.shutdown
Shuts down a computer or turtle wrapped to the "computer" variable
Syntax computer.shutdown()
Returns nil
Part of ComputerCraft
API peripheral

Examples

Grid paper.png  Example
Shuts down the computer or turtle on the right side of the calling machine.
Code
local handle = peripheral.wrap("right") 
handle.shutdown()
Output Shuts down any computer to the right of the computer/turtle.