Posted 19 October 2012 - 08:55 PM
Hey there,
I'm trying to learn CC and I've run into a pickle.
I've modified the tutorial code on the wiki but I get this error.
When I enter the password wrong, the code works fine and provides the bottom redstone pulse, but when it's correct the redstone signal remains and this error appears:
bios:25: bad argument: double expected, got nill
Here's the code I've used
Any help would be appreciated, thank you!
I'm trying to learn CC and I've run into a pickle.
I've modified the tutorial code on the wiki but I get this error.
When I enter the password wrong, the code works fine and provides the bottom redstone pulse, but when it's correct the redstone signal remains and this error appears:
bios:25: bad argument: double expected, got nill
Here's the code I've used
local side = "back"
local password = "hello"
local opentime = 5
local bottom = "bottom"
while true do
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local input = read("*")
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
sleep(1)
rs.setOutput(side,true)
sleep(opentime)
rs.setOutput(side,false)
else
print("Password incorrect!")
sleep(1)
rs.setOutput(bottom,true)
sleep(1)
rs.setOutput(bottom,false)
sleep(1)
end
end
Any help would be appreciated, thank you!