Disk eject (event)

From ComputerCraft Wiki
Revision as of 10:06, 28 October 2013 by TheOriginalBIT (Talk | contribs) (links, cleanup and better coding habits)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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