Posted 23 October 2012 - 03:11 AM
Can someone please help me find the error in my coding?
I get this error when I try to run my program:
CraftOS 1.3
> doorlock
bios:206: [string "doorlock"]:25: 'end' expected
(to close 'while' at line 2)
————————————————————————–
Here is my coding:
os.pullEvent = os.pullEventRaw
while true do
term.clear()
term.setCursorPos(1, 1)
print("Door Terminal//Please Enter Password:")
input = read("*")
if input == "pass" then
print("Access Granted! Unlocking Door…")
redstone.setOutput("back", true)
sleep(8)
print("Locking Door…")
sleep(2)
redstone.setOutput("back", false)
end
if input == "pass:terminate" then
print("Program Terminated by Admin")
sleep(0.5)
print("To lock the door, run 'doorlock'")
redstone.setOutput("back", true)
os.pullEvent(terminate)
sleep(5)
end
else
print("Incorrect Password!")
sleep(2)
end
end
I get this error when I try to run my program:
CraftOS 1.3
> doorlock
bios:206: [string "doorlock"]:25: 'end' expected
(to close 'while' at line 2)
————————————————————————–
Here is my coding:
os.pullEvent = os.pullEventRaw
while true do
term.clear()
term.setCursorPos(1, 1)
print("Door Terminal//Please Enter Password:")
input = read("*")
if input == "pass" then
print("Access Granted! Unlocking Door…")
redstone.setOutput("back", true)
sleep(8)
print("Locking Door…")
sleep(2)
redstone.setOutput("back", false)
end
if input == "pass:terminate" then
print("Program Terminated by Admin")
sleep(0.5)
print("To lock the door, run 'doorlock'")
redstone.setOutput("back", true)
os.pullEvent(terminate)
sleep(5)
end
else
print("Incorrect Password!")
sleep(2)
end
end