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

Condition for a door system

Started by Galactix, 11 August 2017 - 08:17 PM
Galactix #1
Posted 11 August 2017 - 10:17 PM
Hello,
I need to know how to make a condition like "if diskIsIn = true then…" which would be true if a floppy disk is inside the disk drive of the computer or false if there is none.

Thanks
Bomb Bloke #2
Posted 12 August 2017 - 12:41 AM
if disk.isPresent("sideDriveIsOn") then

http://www.computercraft.info/wiki/Disk_%28API%29
The Crazy Phoenix #3
Posted 12 August 2017 - 04:48 PM
Bomb Bloke's suggestion will return true if the inserted disk is a floppy disk or a music disk.
If you want to tell them apart, use disk.hasData("sideDriveIsOn") (returns true if a floppy disk is inserted).