Posted 06 November 2015 - 02:15 PM
hello i'm making a doorlock which opens for 3 minutes and then closes which and during this 3 minutes i would like to print the remaining time counting down, it mostly works but instead of replacing the previous number it prints it on a line below it. how can i get it to count down on one line? and possibly port it to a screen next to the computer?
code:
code:
os.pullEvent = os.pullEventRaw
print("Enter password")
password = io.read()
if password == "nuked" then
rs.setOutput("bottom", true)
rs.setOutput("back", true)
print("Accepted")
for i = 0, 180, 1 do
print(i-1," seconds remaining")
sleep(1)
term.clear()
rs.setOutput("bottom", false)
rs.setOutput("back", false)
end
else
print("try again")
end