Posted 25 November 2012 - 08:34 AM
i have been making a elevator controller in my computer train station but when i use the code i wrote i put in Up and it disappears i don't know why just wanted to know if you guys knew why? I coded it so that you put in Up and it sleeps for 3 seconds for you to get on then set the Redstone on for 12 seconds so it reaches the top and turns off after. but it doesn't do that.
term.clear()
term.setCursorPos(16,1)
print "Elevator Control"
while true do
term.setCursorPos(1,3)
term.clearLine()
write "Up or Down:"
local input = string.lower( read() )
if input == "Up" then
print("Elevating in 3 seconds")
sleep(3)
rs.setOutput("right", true)
sleep(12)
rs.setOutput("right", false)
end
if input == "Down" then
print("Elevating in 3 Seconds")
sleep(3)
rs.setOutput("left", true)
sleep(12)
rs.setOutput("left", false)
end
end
Sorry for not putting it in properly im coping from a server
term.clear()
term.setCursorPos(16,1)
print "Elevator Control"
while true do
term.setCursorPos(1,3)
term.clearLine()
write "Up or Down:"
local input = string.lower( read() )
if input == "Up" then
print("Elevating in 3 seconds")
sleep(3)
rs.setOutput("right", true)
sleep(12)
rs.setOutput("right", false)
end
if input == "Down" then
print("Elevating in 3 Seconds")
sleep(3)
rs.setOutput("left", true)
sleep(12)
rs.setOutput("left", false)
end
end
Sorry for not putting it in properly im coping from a server