Posted 03 June 2013 - 09:15 AM
I wanted to create a simple programm that takes in a password to then loop redstone signals on and off for a period of time to prevent engines from overheating.
I having problems with my repeat part though
(i have used a big part from the wiki because this is my first try)
local side = "back"
local password = "bacon"
local opentime = 5
while true do
term.clear()
term.setCursorPos(1,1)
write("Password:")
local input = read("*")
if input == password then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
repeat
term.clear()
term.setCursorPos(1,1)
print("Currently running")
rs.setOutput(side,true)
sleep(opentime)
rs.setOutput(side,false)
until read("stop")
else
print("password incorrect!")
sleep(2)
end
end
during the repeat i can only type the letter "s" (also multiple times) and the engines will only turn on
for one tick after i have pressed return :s
help please im a nooby
I having problems with my repeat part though
(i have used a big part from the wiki because this is my first try)
local side = "back"
local password = "bacon"
local opentime = 5
while true do
term.clear()
term.setCursorPos(1,1)
write("Password:")
local input = read("*")
if input == password then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
repeat
term.clear()
term.setCursorPos(1,1)
print("Currently running")
rs.setOutput(side,true)
sleep(opentime)
rs.setOutput(side,false)
until read("stop")
else
print("password incorrect!")
sleep(2)
end
end
during the repeat i can only type the letter "s" (also multiple times) and the engines will only turn on
for one tick after i have pressed return :s
help please im a nooby