Difference between revisions of "Computer.shutdown"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=peripheral.wrap |args= (string) side |returns=A handle to the peripheral on ''side''. |api=peripheral |addon=ComputerCraft |de...")
 
(Fixed/Expanded)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{lowercase}}
+
{{Lowercase}}
 
{{Function
 
{{Function
|name=peripheral.wrap
+
|name=''computer''.shutdown
|args= [[string (type)|(string)]] side
+
|returns={{type|nil}}
|returns=A handle to the peripheral on ''side''.
+
 
|api=peripheral
 
|api=peripheral
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Returns a handle to a peripheral that can then be used to call methods, as if using peripheral.call(side, method)
+
|desc=Shuts down a [[Computer]] or [[Turtle]] wrapped to the <var>computer</var> 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=local handle = peripheral.wrap("right")
+
|code=
|handle.shutdown()
+
local computer = [[peripheral.wrap]]("right")
 +
 +
'''computer.shutdown()'''
 
|output=Shuts down any computer to the right of the computer/turtle.
 
|output=Shuts down any computer to the right of the computer/turtle.
 
}}
 
}}

Latest revision as of 10:57, 1 June 2014


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 computer = peripheral.wrap("right")

computer.shutdown()
Output Shuts down any computer to the right of the computer/turtle.