Posted 30 October 2013 - 03:16 PM
Hey guys,
I got this script going, right now when it starts up it starts with the redstone output deactivated, now I want it when it starts up to start with redstone output activated.
Here's the code:
Any suggestions?
Thanks.
I got this script going, right now when it starts up it starts with the redstone output deactivated, now I want it when it starts up to start with redstone output activated.
Here's the code:
function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
print ("====== Reboot disabled, please enter password:")
sleep(2)
end
return event, p1, p2, p3, p4, p5
end
function write()
term.clear()
term.setCursorPos(1, 1)
end
local pass = "123"
local side = "bottom"
while true do
write()
print("====== Security System 1.1 ======")
print("====== Please enter Password: ")
local input = read("*")
if input == pass then
print("====== Security Enabled")
rs.setOutput(side, true)
sleep(2)
local i = 9
while i ~= 0 do
write()
print("====== Security Enabled")
print("====== Enter Password:")
local input = read("*")
if input == pass then
i = i - 9
print("====== Security Disabled")
redstone.setOutput(side, false)
sleep(2)
else
print("====== Incorrect Password")
sleep(2)
end
end
else
print("====== Incorrect Password")
sleep(2)
end
end
Any suggestions?
Thanks.