Jump to content




10 out put


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

#1 cmurtheepic

  • Members
  • 158 posts
  • Locationthe vast cosmos of my mind; binary!

Posted 10 July 2012 - 07:17 AM

hey when ever i use [while true do] in my code when ever i run it i get 10 in stead of the program like soo
>door
10
>
and that is how i get it
plz help meAttached File  door.txt   641bytes   20 downloads

#2 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 10 July 2012 - 08:59 AM

I've fixed it for you. Hope that's the way you want it to act

while true do
  term.clear()
  term.setCursorPos(1,1)
  print ("open or close-")
  x = io.read()
  if x == "open" then
    redstone.setOutput("right", true )
    sleep(1)
    redstone.setOutput("right", false )
    sleep(1)
    redstone.setOutput("right", true )
    sleep(1)
    redstone.setOutput("right", false )
    sleep(1)
    redstone.setOutput("right", true )
    sleep(1)
    redstone.setOutput("right", false )
  elseif x == "close" then
    redstone.setOutput("left", true )
    sleep(1)
    redstone.setOutput("left", false )
    sleep(1)
    redstone.setOutput("left", true )
    sleep(1)
    redstone.setOutput("left", false )
    sleep(1)
    redstone.setOutput("left", true )
    sleep(1)
    redstone.setOutput("left", false )
  end
  sleep(0.1)
end


#3 cmurtheepic

  • Members
  • 158 posts
  • Locationthe vast cosmos of my mind; binary!

Posted 10 July 2012 - 05:24 PM

thanks i appereaciate your help





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users