Difference between revisions of "Disk (event)"

From ComputerCraft Wiki
Jump to: navigation, search
m (removed request for TLC)
m (Changed output.)
Line 13: Line 13:
 
   end
 
   end
 
  end
 
  end
|output=The title of any music disk put into a connected disk drive.
+
|output=Notification once the disk has been inserted.
 
}}
 
}}

Revision as of 10:43, 23 April 2013



Grid Modem.png  Event disk
Fired when a disk is inserted into any connected (directly adjacent to) disk drive.
Returned Object 1 The String value of the side of the disk drive.


Grid paper.png  Example
Play any music disk put into a connected disk drive, and print the title.
Code
while true do
  event, side = os.pullEvent("disk")
  if event == "disk" then
    print("Disk has been inserted")
  end
end
Output Notification once the disk has been inserted.