Posted 07 August 2012 - 04:26 PM
I *think* I read somewhere about a program that can detect a disk drive, but I cannot, for the life of me, remember what the code is. Can anyone help?
side = "right"
if peripheral.getType(side) == "drive" then
print ("Yup, Disk Drive on the starboard side.")
end
Okay, so I'm pretty sure the disk drive is called "drive" in the code for getType, so you can use this. Otherwise, just put one on a side, and use getType.
Oh, and for disks themselves, you can use an event pull. Just look for disk or disk_eject. There's probably a simpler way, but . . .side = "right" if peripheral.getType(side) == "drive" then print ("Yup, Disk Drive on the starboard side.") end
Okay, so I'm pretty sure the disk drive is called "drive" in the code for getType, so you can use this. Otherwise, just put one on a side, and use getType.
Oh, and for disks themselves, you can use an event pull. Just look for disk or disk_eject. There's probably a simpler way, but . . .side = "right" if peripheral.getType(side) == "drive" then print ("Yup, Disk Drive on the starboard side.") end
Thanks
I like to write all LUA in Notepad++ before adding them to CC, dunno why, but I think it has something to do with the highlighting
Okay, so I'm pretty sure the disk drive is called "drive" in the code for getType, so you can use this. Otherwise, just put one on a side, and use getType.
Oh, and for disks themselves, you can use an event pull. Just look for disk or disk_eject. There's probably a simpler way, but . . .side = "right" if peripheral.getType(side) == "drive" then print ("Yup, Disk Drive on the starboard side.") end
Thanks
I like to write all LUA in Notepad++ before adding them to CC, dunno why, but I think it has something to do with the highlighting
It's probably because you can flick around with the mouse instead of having to go through the code with your cursor.