Disk

Eventdisk
Occurs every time a disk is inserted into a connected Disk Drive.
Returns
  • name : string The side or network name of the Disk Drive the disk got inserted into
Part of CC:Tweaked
ExampleAlerts on disk insertion
Waits for a disk to be inserted and alerts the user when it occured.
Code
<nowiki>
local event, peripheral_name = os.pullEvent("disk")
print("A disk has been inserted into disk drive", peripheral_name)
    </nowiki>
Eventdisk_eject
Occurs every time a disk is ejected from a connected Disk Drive.
Returns
  • name : string The side or network name of the Disk Drive the disk got ejected from
Part of CC:Tweaked
ExampleAlerts on disk ejection
Waits for a disk to be ejected and alerts the user when it occured.
Code
<nowiki>
local event, peripheral_name = os.pullEvent("disk_eject")
print("A disk has been ejected from disk drive", peripheral_name)
    </nowiki>
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.