Disk (event)

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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.
while true do
  local event, side = os.pullEvent()
  if event == "disk" then
    print("Disk was inserted: "..side)