Disk eject (event)

From ComputerCraft Wiki
Jump to: navigation, search



Grid Modem.png  Event disk_eject
Fired when a Floppy Disk is removed into any Disk Drive connected to the computer locally or remotely (over Network Cables).
Returned Object 1 The String value of the side/name of the Disk Drive.


Grid paper.png  Example
Notifies the user when a disk is removed from a connected disk drive
Code
while true do
  local event, side = os.pullEvent()
  if event == "disk_eject" then
    print("Disk was removed from: "..side)
  end
end