Difference between revisions of "Peripheral.wrap"

From ComputerCraft Wiki
Jump to: navigation, search
m (Moved to CAT:LuaCoreFunctions)
m (My definition of "prints the name of the device" isn't "handle.shutdown()". :P)
Line 9: Line 9:
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Prints what has been attached to the computer or turtle's right side.
+
|desc=Shuts down the computer or turtle on the right side of the calling machine.
 
|code=local handle = peripheral.wrap("right") handle.shutdown()
 
|code=local handle = peripheral.wrap("right") handle.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.
 
}}
 
}}
 
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Revision as of 00:19, 29 November 2012


Grid Redstone.png  Function peripheral.wrap
Returns a handle to a peripheral that can then be used to call methods, as if using peripheral.call(side, method)
Syntax peripheral.wrap((string) side)
Returns A handle to the peripheral on side.
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.