145 posts
Location
the vast cosmos of my mind; binary!
Posted 10 July 2012 - 08: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 me[attachment=305:door.txt]
286 posts
Location
Bonn Germany
Posted 10 July 2012 - 09: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
145 posts
Location
the vast cosmos of my mind; binary!
Posted 10 July 2012 - 06:24 PM
thanks i appereaciate your help