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

Startup:8: Expected String, Boolean Error

Started by ryanjr, 15 September 2013 - 11:09 AM
ryanjr #1
Posted 15 September 2013 - 01:09 PM
Im making a program for a password protected door. For the first part it does everything fine but when it gets to the redstone output boolean variable, it says: startup:8: Expected string, boolean.

Heres the code:

term.clear()
term.setCursorPos(1,1)

write("Enter password: ")
local P = read("*")
if P == "junior" then
print("correct")
sleep(1)
redstone.setOutput(left, 1)
sleep(1)
redstone.setOutput(left, 0)
else
print("Incorrect")
sleep(1)
os.reboot()
end

os.reboot()


Please help.
Vilsol #2
Posted 15 September 2013 - 01:11 PM
Wrong section!

Instead of 1 and 0 you have to use true or false!

Next time put your code in code tags!
Lyqyd #3
Posted 15 September 2013 - 01:19 PM
You've been around these forums long enough that you really should know where questions go. Moved to Ask a Pro.
Kingdaro #4
Posted 15 September 2013 - 01:27 PM
redstone.setOutput(left, 1)

Should be:

redstone.setOutput("left", true)
ryanjr #5
Posted 15 September 2013 - 08:48 PM
Ahhhhhhh. I was missing the quotes. Thank you.