Jump to content




Piston door code help


  • You cannot reply to this topic
3 replies to this topic

#1 Robbe2811

  • New Members
  • 2 posts

Posted 01 July 2013 - 01: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!

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 01 July 2013 - 01: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.

#3 Apfeldstrudel

  • Members
  • 161 posts

Posted 01 July 2013 - 04: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

#4 Robbe2811

  • New Members
  • 2 posts

Posted 02 July 2013 - 11:44 AM

Ok Thanks ;)





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users