Posted 11 April 2013 - 11:46 AM
I have this bit of code but when it gets to the choice part it ignores the rest of the code and doesn't let me input a choice
y = colors.combine( colors.yellow )
r = colors.combine( colors.red )
rr = colors.subtract( colors.red )
yy = colors.subtract( colors.yellow )
term.clear()
–local pullEvent = os.pullEvent
–os.pullEvent = os.pullEventRaw
sfile = io.open("/startup", "w")
sfile:write('shell.run("door")')
sfile:close()
term.setCursorPos(1,1)
print(" ———–Giuseppe's Burgeria———–")
print("")
print("")
print("")
print(" Please Enter Your Password")
print(" Password:")
term.setCursorPos(20,6)
local input = read("*")
if input == "potato" then
term.clear()
term.setCursorPos(1,1)
sleep(1)
print(" ———–Giuseppe's Burgeria———–")
print("")
print("")
print("")
print(" 1.Open Main Doors")
print(" 2.Close Main Doors")
print("")
print(" 3.Open Farm Doors")
print(" 4.Close Farm Doors")
print("")
print(" 5.Logout")
print("")
term.setCursorPos(15,13)
if input == "1" then
rs.setBundledOutput( "down", y )
print("Open")
elseif input == "2" then
rs.setBundledOutput( "down", yy )
print("Closed")
elseif input == "3" then
rs.setBundledOutput( "down", r )
print("Open")
elseif input == "4" then
rs.setBundledOutput( "down", rr )
print("Closed")
elseif input == "5" then
os.reboot()
elseif input =="admin1" then
fs.delete("startup")
print(" auto start disabled")
sleep(1)
else
end
else
print(" Wrong Password")
sleep(1)
os.reboot()
end
y = colors.combine( colors.yellow )
r = colors.combine( colors.red )
rr = colors.subtract( colors.red )
yy = colors.subtract( colors.yellow )
term.clear()
–local pullEvent = os.pullEvent
–os.pullEvent = os.pullEventRaw
sfile = io.open("/startup", "w")
sfile:write('shell.run("door")')
sfile:close()
term.setCursorPos(1,1)
print(" ———–Giuseppe's Burgeria———–")
print("")
print("")
print("")
print(" Please Enter Your Password")
print(" Password:")
term.setCursorPos(20,6)
local input = read("*")
if input == "potato" then
term.clear()
term.setCursorPos(1,1)
sleep(1)
print(" ———–Giuseppe's Burgeria———–")
print("")
print("")
print("")
print(" 1.Open Main Doors")
print(" 2.Close Main Doors")
print("")
print(" 3.Open Farm Doors")
print(" 4.Close Farm Doors")
print("")
print(" 5.Logout")
print("")
term.setCursorPos(15,13)
if input == "1" then
rs.setBundledOutput( "down", y )
print("Open")
elseif input == "2" then
rs.setBundledOutput( "down", yy )
print("Closed")
elseif input == "3" then
rs.setBundledOutput( "down", r )
print("Open")
elseif input == "4" then
rs.setBundledOutput( "down", rr )
print("Closed")
elseif input == "5" then
os.reboot()
elseif input =="admin1" then
fs.delete("startup")
print(" auto start disabled")
sleep(1)
else
end
else
print(" Wrong Password")
sleep(1)
os.reboot()
end