Disk

From ComputerCraft
Jump to: navigation, search
EventEventdisk
Occurs every time a disk is inserted into a connected Disk Drive.
Returns
Part of CC:Tweaked
ExampleExampleAlerts on disk insertion
Waits for a disk to be inserted and alerts the user when it occured.
Code
local event, peripheral_name = os.pullEvent("disk")
print("A disk has been inserted into disk drive", peripheral_name)
EventEventdisk_eject
Occurs every time a disk is ejected from a connected Disk Drive.
Returns
Part of CC:Tweaked
ExampleExampleAlerts on disk ejection
Waits for a disk to be ejected and alerts the user when it occured.
Code
local event, peripheral_name = os.pullEvent("disk_eject")
print("A disk has been ejected from disk drive", peripheral_name)