Disk (event)

From ComputerCraft Wiki
Jump to: navigation, search



Grid Modem.png  Event disk
Fired when a Floppy Disk is inserted 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
Print a message when a disk is inserted into a connected disk drive.
Code
while true do
  local event, side = os.pullEvent()
  if event == "disk" then
    print("Disk was inserted: "..side)
  end
end