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

bios:14: [string ".temp]:6: 'then' expected

Started by braydenq6, 23 January 2016 - 02:38 AM
braydenq6 #1
Posted 23 January 2016 - 03:38 AM
Im making a computer craft and projectred
elevator program thats password protected the code is

While true do
term.clear()
term.setCursorPos(1, 1)
print("Enter Password To Start Elevator")
input = read("x")
if input = "666" then
term.clear()
term.setTextColor(colors.lime)
term.setCursorPos(1, 1)
print("Elevator Started, Every Thing Running Properly")
side = "back"
if redstone.testBundledInput(side, colors.lime) == true
then
redstone.setBundledOutput(side, colors.green)
sleep(2)
end
if redstone.testBundledInput(side, colors.red) == true
then
redstone.setBundledOutput(side, colors.pink)
sleep(2)
end
if redstone.testBundledInput(side, colors.black) == true
then
redstone.setBundledOutput(side, 0)
end
sleep(1)
if redstone.testBundledInput(side, colors.grey)
then
print("Restarting System Now")
sleep(5)
end
sleep(1)
end
Bomb Bloke #2
Posted 23 January 2016 - 04:50 AM
Line 6:

if input = "666" then

Use = to assign variables, and == to compare them.
braydenq6 #3
Posted 24 January 2016 - 05:56 AM
Thanks