Posted 04 April 2015 - 06:18 PM
So I am trying to run this code and it is doing the last if even if the code is right. Any ideas how to fix it.
Here is a picture of the error.
http://www.upimg.me/...377330ac089dfa6
while true do
term.clear()
term.setCursorPos(1, 1)
print("This is the Liquid Storage Room\nIf you want to gain access,\nPlease Enter the Password:")
input = read("*")
if input == "abcd1234" then
redstone.setOutput("right", true)
term.setTextColor(colors.green)
print("Password Accepted")
sleep(3)
term.setTextColor(colors.white)
redstone.setOutput("right", false)
end
if input == "masterOpen" then
redstone.setOutput("right", true)
term.setTextColor(colors.green)
print("masterOpen Activated")
term.setTextColor(colors.white)
sleep(3)
end
if input == "masterClose" then
redstone.setOutput("right", false)
term.setTextColor(colors.green)
print("masterClose Activated")
term.setTextColor(colors.white)
sleep(3)
end
if input ~= "masterClose" or input~= "masterOpen" or input ~= "abcd1234" then
term.setTextColor(colors.red)
print("Password Incorrect. Please try again.")
term.setTextColor(colors.white)
sleep(3)
end
sleep(2)
end
Here is a picture of the error.
http://www.upimg.me/...377330ac089dfa6