Disk (event)

From ComputerCraft Wiki
Revision as of 09:59, 28 October 2013 by TheOriginalBIT (Talk | contribs) (Slightly better description updated for network cables, also better coding habits)

Jump to: navigation, search



Grid Modem.png  Event disk
Fired when a disk is inserted into any disk drive connected to the computer locally or remotely (over peripheral 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("disk")
  if event == "disk" then
    print("Disk has been inserted")
  end
end
Output Notification once the disk has been inserted.