Difference between revisions of "Peripheral detach (event)"
From ComputerCraft Wiki
(updated to match peripheral event page) |
|||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
{{Event | {{Event | ||
|name=peripheral_detach | |name=peripheral_detach | ||
| − | |desc=Fired when a peripheral is disconnected | + | |desc=Fired when a peripheral is disconnected from the computer locally or remotely (over Network Cables). |
| − | |return1=The [[String_(type)| | + | |return1=The [[String_(type)|string]] of the side/name of the now disconnected peripheral. |
}} | }} | ||
| − | + | {{Example | |
| − | + | |desc=Prints the side/name of a peripheral when it's disconnected | |
| − | + | |code= | |
| − | event, side =os.pullEvent("peripheral_detach") | + | while true do |
| − | + | local event, side = os.pullEvent("peripheral_detach") | |
| − | + | print("The peripheral ", side, " has been disconnected") | |
| + | end | ||
| + | }} | ||
Latest revision as of 11:18, 25 March 2014
| Fired when a peripheral is disconnected from the computer locally or remotely (over Network Cables). | |
| Returned Object 1 | The string of the side/name of the now disconnected peripheral. |