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

Floppy Disk Door

Started by BlankTitle, 04 May 2013 - 05:11 PM
BlankTitle #1
Posted 04 May 2013 - 07:11 PM
Hello everyone! I am in need of a script that allows a floppy disk to open a door. The floppy disk should have a certain code on it that when inserted to a disk drive will tell a computer to open the door. if possible make it so multiple keycards with different codes can be used and if you enter the wrong card it will lock the system up for around a minute. Thanks -Blank
theoriginalbit #2
Posted 05 May 2013 - 12:05 AM
Ok so normally people in this section would reply to you with something like "we are not code monkeys" or "here are some resources to learn how to make it" …

Luckily for you, even though that would be my normal response (to help you to do it, not actually do it for you), someone at some stage has already made this program. After I saw it i helped him for a bit to make the code more efficient and only run when it was needed. To suit your needs I only needed to add one line of code (the lockout). So here it is… http://pastebin.com/Ktv7048b
BlankTitle #3
Posted 05 May 2013 - 06:58 AM
Thanks!
cake2 #4
Posted 17 April 2014 - 07:42 PM
Ok so normally people in this section would reply to you with something like "we are not code monkeys" or "here are some resources to learn how to make it" …

Luckily for you, even though that would be my normal response (to help you to do it, not actually do it for you), someone at some stage has already made this program. After I saw it i helped him for a bit to make the code more efficient and only run when it was needed. To suit your needs I only needed to add one line of code (the lockout). So here it is… http://pastebin.com/Ktv7048b
Well i got the thing on my Advanced Computer and it wont let me start it due to this error:
bios:339: [string "Startup"]:4: '} expected (to close '{' at line 3)
Lyqyd #5
Posted 17 April 2014 - 07:46 PM
In the table declaration at the beginning of the script, change this:


1 = true,

to this:


[1] = true,

Repeat that for the other two entries there.
metron80 #6
Posted 06 June 2014 - 05:16 PM
It returns an error saying:

peripheral :34: expected string

But line 34 is a comment:

-- the main text while it is waiting for a disk
CometWolf #7
Posted 06 June 2014 - 06:57 PM
note the first part of your error reads "peripheral", this means the error is occuring in the peripheral API. The culprit is probably line 17, where no side is specified

  local diskId = disk.getDiskID and disk.getDiskID() or disk.getID()
theoriginalbit #8
Posted 07 June 2014 - 01:31 AM
It returns an error saying:

peripheral :34: expected string

But line 34 is a comment:

-- the main text while it is waiting for a disk
note the first part of your error reads "peripheral", this means the error is occuring in the peripheral API. The culprit is probably line 17, where no side is specified

  local diskId = disk.getDiskID and disk.getDiskID() or disk.getID()
yep sorry that was my fault. fixed the pastebin :)/>