Posted 28 March 2018 - 01:36 AM
I'm writing a password program and i would like to have an infinite loop in the background checking for a disk that has a 'backdoor' password on it just in-case i forget the password i set it to (It happens a lot) anyways i have no idea about how to do since the program halts when given the read() prompt. All help is appreciated thanks~
code:
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
print("Please login!\n")
term.write("Password: ")
input = read("*")
if input == "lolfun!" then
print("\nPassword Correct!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print("YourOS")
else
print("\nPassword Incorrect!")
sleep(2)
os.reboot()
end
code:
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
print("Please login!\n")
term.write("Password: ")
input = read("*")
if input == "lolfun!" then
print("\nPassword Correct!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print("YourOS")
else
print("\nPassword Incorrect!")
sleep(2)
os.reboot()
end