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

Piston door code help

Started by Robbe2811, 01 July 2013 - 12:06 PM
Robbe2811 #1
Posted 01 July 2013 - 02:06 PM
I have a Problem with my program for an disk-protected piston-door(has an and-gate)
The program should give out a redstone signal if the disc is in the drive
Code:
————————————
repeat
print("Insert Disk")
shell.run("clear")
until disk.getLabel("front") == "Password"
print("Disk is inserted!!!")
rs.setOutput("bottom", true)
sleep(2)
rs.setOutput("bottom", false)
sleep(0.2)
shell.run("clear")
end
shell.run("Pistons")
—————————–

Error:
Every time I type startup in the Console it jumps to a new line and says 204
If I repeat that "command" it says 204204 and so on…

Please help me… :(/>

Sorry if I'm posting on the wrong page!
Lyqyd #2
Posted 01 July 2013 - 02:40 PM
Split into new topic.

There is a sticky post in this section specifically for New Members to post in. The Forum Guidelines sticky links to it. Please use the resources available to you and look around a little before diving right in and posting in the wrong places.
Apfeldstrudel #3
Posted 01 July 2013 - 05:36 PM
Use an infinite loop for this-

while true do
Do stuff
End

why clear after print?

Also, put a sleep in the until loop, or use os.pullEvent
Robbe2811 #4
Posted 02 July 2013 - 12:44 PM
Ok Thanks ;)/>