1
This Doesnt Seem To Run
Started by libraryaddict, Feb 18 2012 02:06 AM
3 replies to this topic
#1
Posted 18 February 2012 - 02:06 AM
Its a form of http://www.computerc.../100-door-lock/
Im new to computer craft.
I get a error "[string "lock"]:7: ')' expected"
Thanks
#2
Posted 18 February 2012 - 02:27 AM
libraryaddict, on 18 February 2012 - 02:06 AM, said:
Its a form of http://www.computerc.../100-door-lock/
Im new to computer craft.
I get a error "[string "lock"]:7: ')' expected"
Thanks
You need to call read, not assign it:
input = read("*")
You also need to use commas (,) to seperate arguments to functions:
rs.setOutput("left", true)
I'd recommend you read this: http://www.lua.org/pil/index.html
It's a great resource for getting started with Lua.
#3
Posted 18 February 2012 - 08:18 AM
And it should be
input == pass
#4
Posted 28 June 2013 - 02:29 PM
The whole code should look like
pass = "password" write "password: " input = read("*") if input == pass then -- if you didnt assign open to anything so you can't use it print "welcome!" redstone.setOutput("left", true)--dont forget the comma sleep(3.5) redstone.setOutput("left", false) else print "Awww :(/>" sleep(1) os.reboot() end
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users