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

Stuck, Please Help.

Started by Weddedspartan22, 03 April 2012 - 08:27 PM
Weddedspartan22 #1
Posted 03 April 2012 - 10:27 PM
I have been trying for a while now to creat a program so that when a disk is inserted into a disk drive and the computer is turned on, it opens a door, ejects the disk, closes the door, then shuts it's self off. I have gotten the computer to open and close the door, just not eject the disk and turn it's self off. Any suggestions? I have this running as the startup program since thats the only thing this computer will be doing.
Here's what I got so far:
rs.setOutput("back", true)
eject
sleep(5)
rs.setOutput("back", false)
os.shutdown
end

I am pretty sure that eject and os.shutdown are the wrong things but thats all I could find.
I would really appreciate any help here on this.
Liraal #2
Posted 03 April 2012 - 10:29 PM

rs.setOutput("back", true)
disk.eject(<side>)
sleep(5)
rs.setOutput("back", false)
os.shutdown()
where <side> is the side with disk drive.
Tusillody #3
Posted 03 April 2012 - 10:30 PM
I honestly have no clue if you can make the disk actually eject, but the shutdown line should be

os.shutdown()

Hope I helped ;)/>/>

Edit: Seems like im too slow x) And i learned something new; how to eject a disk :D/>/> ive never worked with the disks or even turtles yet. :)/>/>
Weddedspartan22 #4
Posted 03 April 2012 - 10:55 PM
Thanks for the help :)/>/>