Posted 14 July 2012 - 01:33 PM
Hey guys. I'm all new here, so sorry if this thread is posted the wrong place!
Now, I have a problem. Obviously.
I recently made some password protected doors, with a code to unlock them. Nothing special!
However, I also added an alarm feature which would set off an alarm. I then thought, "It could be awesome if the computer would notify another computer that security had been attempted breached.
So I added some lines of code, and then stuff went wrong.
Here is the code for the two computers.
1. (The lock-computer)
password = "rootbeer"
print ("Ocelot Industries lock terminal")
write ("Password:")
input = read ("*")
if input == password then
redstone.setOutput ("left", true)
rednet.open ("top")
rednet.send ("4", "Acces granted to main hall")
sleep(5)
os.shutdown()
else
print ("Wrong password!")
redstone.setOutput ("bottom", true)
rednet.open ("top", "Security breach attempted!")
sleep(10)
os.shutdown
Ok that's the code for computer 1. The reciever have a super simple code:
rednet.recieve()
print (message)
However, then the reciever makes this error: startup:1: attempt to call nil,
and suddenly the door won't close again!
Please help me, I'm utterly confused! :P/>/>
Now, I have a problem. Obviously.
I recently made some password protected doors, with a code to unlock them. Nothing special!
However, I also added an alarm feature which would set off an alarm. I then thought, "It could be awesome if the computer would notify another computer that security had been attempted breached.
So I added some lines of code, and then stuff went wrong.
Here is the code for the two computers.
1. (The lock-computer)
password = "rootbeer"
print ("Ocelot Industries lock terminal")
write ("Password:")
input = read ("*")
if input == password then
redstone.setOutput ("left", true)
rednet.open ("top")
rednet.send ("4", "Acces granted to main hall")
sleep(5)
os.shutdown()
else
print ("Wrong password!")
redstone.setOutput ("bottom", true)
rednet.open ("top", "Security breach attempted!")
sleep(10)
os.shutdown
Ok that's the code for computer 1. The reciever have a super simple code:
rednet.recieve()
print (message)
However, then the reciever makes this error: startup:1: attempt to call nil,
and suddenly the door won't close again!
Please help me, I'm utterly confused! :P/>/>