peripheral event

From ComputerCraft
Jump to: navigation, search
peripheral
Event
Returns

Source CC:Tweaked

Occurs every time a peripheral is attached.

ExampleExampleAlert on peripheral attachment
Waits for a peripheral to be attached and alerts the user what type of peripheral was attached.
Code
local event, peripheral_name = os.pullEvent("peripheral")
local peripheral_type = peripheral.getType(peripheral_name)
print("A", peripheral_type, "has been attached.")