Disk (event)

From ComputerCraft Wiki
Revision as of 10:33, 23 April 2013 by Cranium (Talk | contribs) (Made an event specific code snippet.)

Jump to: navigation, search
This page needs some serious TLC, stat!
Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: A demonstration on the use and handling of this event would be beneficial. AfterLifeLochie 16:13, 30 November 2012 (MSK))

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.
while true do
  event, side = os.pullEvent("disk")
  if event == "disk" then
    print("Disk has been inserted")
Output The title of any music disk put into a connected disk drive.