When entering the correct password(s) it does work.
Quote
wr = peripheral.wrap("back")
local pass
local found
local attempts
function waitPass()
term.clear()
term.setCursorPos(1,1)
print("Please enter a valid password.")
print("------------------------------")
status, pass = pcall(read)
end
function checkPass()
file = io.open("passwords")
for line in file:lines() do
if pass == OverrideProgram then
exit()
elseif pass == line then
found = true
else
attempts = attempts+1
end
end
end
function reset()
name = ""
found = false
attempts = 0
end
function run()
if found == true then
wrfreq(1001)
pulseWR(10)
elseif found == false and attempts == 2 then
wrfreq(1011)
for i = 1, 3 do
pulseWR(1)
end
wrfreq(1017)
for i = 1, 3 do
pulseWR(1)
end
else
waitPass()
end
end
function pulseWR(time)
rs.setOutput("back", true)
pcall(sleep, time/2)
rs.setOutput("back", false)
pcall(sleep, time/2)
end
function wrfreq(freq)
wr.setFreq(freq)
end
while true do
reset()
waitPass()
checkPass()
run()
end












