This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Cruor's profile picture

Disk drive events

Started by Cruor, 11 July 2014 - 09:06 PM
Cruor #1
Posted 11 July 2014 - 11:06 PM
When using CC you often use os.pullEvent(), and while there is nothing wrong with a event based system, disk drives does not "support" this properly.

I would like to see two events added regarding disk drives.

The first is a event for when a item is inserted into the drive. The event would return something like this:
"driveInsert", side, itemType
The itemType is simple, it is either "floppy", "pocketComputer", "musicDisk" or "unknown"/nil.

The second event is when the item is removed.
"driveEject", side

While this is completely doable in CC itself, it would be nice to add to "vanilla" CC and in my opinion would be a nice additon.
Cranium #2
Posted 11 July 2014 - 11:20 PM
This is a fairly good idea, much like when turtle_inventory events were added. It makes sense, when you insert something in the drive, that the drive tells the computer, "Hey, someone shoved an item in here!"
Saldor010 #3
Posted 11 July 2014 - 11:34 PM
+1

I know this is an enhancement, and that the staff team doesn't like them, but if they added the window API, they have to add this.
Edited on 11 July 2014 - 09:34 PM
Lyqyd #4
Posted 12 July 2014 - 12:58 AM
What's wrong with disk and disk_eject?
oeed #5
Posted 12 July 2014 - 05:32 AM
Actually Lyqyd's got a good point, this does appear to already exist. The main difference being what type of item it is, although you can just use the disk API for that.