This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
mustbuildhouse's profile picture

Help with Custom Program!

Started by mustbuildhouse, 12 January 2013 - 12:45 PM
mustbuildhouse #1
Posted 12 January 2013 - 01:45 PM
I am having trouble with this program i'm trying to make. It will control the opening and closing of my dam. I keep getting an error though. Heres the error: bios:206: [string "Password]:38: 'end' expected (to close 'if' at line 8)
Here's 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 ("")
command1 = io.read


if command1 == "Open" then

rs.setBundledOutput("right", colors.white)
sleep(8.0)


if command1 == "Close" then

rs.setBundledOutput("right", colors.black)
sleep(8.0)


else
term.clear()
textutils.slowPrint ("Incorrect. Please exit and try again!")


end

os.shutdown()

end



All correct spacing. PLease help!
theoriginalbit #2
Posted 12 January 2013 - 01:47 PM
change this line

if command1 == "Close" then

to this

elseif command1 == "Close" then


EDIT:

Also this

command1 = io.read

should be this

command1 = io.read()

its a function, you need to call it :)/>
Edited on 12 January 2013 - 12:48 PM
mustbuildhouse #3
Posted 12 January 2013 - 01:48 PM
Thanks…that did it!
theoriginalbit #4
Posted 12 January 2013 - 01:51 PM
your welcome :)/>