- local password = "Password" -- Password
-
local side = "left" -- Side to send the redstone signal -
local time = 5 -- Activation time for the signal -
local totalTry = 5 -- Total tries before self-locking -
while true do -
term.clear() -
local try = try -
print("Password : ") -
local input = read("*") -
if input == password then -
term.clear() -
print("Password correct !") -
rs.setOutput(side, true) -
local try = 0 -
os.sleep(time) -
rs.setOutput(side, false) -
else -
term.clear() -
print("Wrong password !") -
local try = try+1 -
if try == totalTry then -
print("Computer locked for 60 seconds !") -
os.sleep(60) -
else -
term.write("Essaie restante : ") -
term.write(totalTry-try) -- The error says to be here ! -
term.write(" !") -
end -
os.sleep(2) -
end -
end
Edited by firelumet, 21 June 2014 - 05:42 PM.











