Posted 12 January 2013 - 02:09 PM
I have another problem with my program, when i enter the password, the computer instantly shutsdown. The password being "hiitsme123". What do I add so it doesn't end and lets me type in the next word being Close/Open? Heres the program:
os.pullEvent = os.pullEventRaw
print ("Welcome To Dam Management. Please enter control center password:")
write ("")
password = io.read()
if password == "hiitsme123" then
print ("Correct. Welcome mustbuildhouse!")
term.clear()
print ("What would you like to do?")
print ("Close Flood Gates")
print ("or")
print ("Open Flood Gates")
write ("")
random = io.read
if random == "Open" then
rs.setBundledOutput("right", colors.white)
sleep(8.0)
elseif command1 == "Close" then
rs.setBundledOutput("right", colors.black)
sleep(8.0)
else
print ("Incorrect. Please exit and try again!")
end
os.shutdown()
end
os.pullEvent = os.pullEventRaw
print ("Welcome To Dam Management. Please enter control center password:")
write ("")
password = io.read()
if password == "hiitsme123" then
print ("Correct. Welcome mustbuildhouse!")
term.clear()
print ("What would you like to do?")
print ("Close Flood Gates")
print ("or")
print ("Open Flood Gates")
write ("")
random = io.read
if random == "Open" then
rs.setBundledOutput("right", colors.white)
sleep(8.0)
elseif command1 == "Close" then
rs.setBundledOutput("right", colors.black)
sleep(8.0)
else
print ("Incorrect. Please exit and try again!")
end
os.shutdown()
end