Posted 18 August 2012 - 02:03 PM
I'm quite new to the scripting scene so it would be greatly appreciated if someone could help me with mistake checking, I know I haven't formatted this at all so it would be nice if someone could tell me when you put the spaces and such and also if someone could tell me how I could add a password to debug?
The code is here:
Vault Lock
function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
end
return event, p1, p2, p3, p4, p5
end
term.clear()
term.setCursorPos(1,1)
print "Vault Security System v1"
print " "
write ("Insert Password To Continue: ")
correctpass = "password"
pass = read("*")
if pass == (correctpass) then
print " "
write("Password Accepted. Opening…")
redstone.setOutput ("back" true)
sleep (3)
redstone.setOutput ("back" false)
os.reboot()
else
print " "
write("Password Incorrect. Laser System Active…")
redstone.setOutput ("bottom" true)
sleep(1)
redstone.setOutput ("bottom" true)
os.reboot()
end
The code is here:
Vault Lock
function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
end
return event, p1, p2, p3, p4, p5
end
term.clear()
term.setCursorPos(1,1)
print "Vault Security System v1"
print " "
write ("Insert Password To Continue: ")
correctpass = "password"
pass = read("*")
if pass == (correctpass) then
print " "
write("Password Accepted. Opening…")
redstone.setOutput ("back" true)
sleep (3)
redstone.setOutput ("back" false)
os.reboot()
else
print " "
write("Password Incorrect. Laser System Active…")
redstone.setOutput ("bottom" true)
sleep(1)
redstone.setOutput ("bottom" true)
os.reboot()
end