Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if disk.isPresent("bottom") == false then
- term.clear()
- term.setCursorPos(1,1)
- print("No writable medium found.")
- sleep(1)
- textutils.slowPrint("Rebooting...")
- os.reboot()
- end
- local function userGen()
- -- get username & make directory
- print("Enter Username: ")
- print(" ")
- user = read()
- usedir ="/users/"..user
- fs.makeDir(usedir)
- term.clear()
- term.setCursorPos(1,1)
- -- Set a 2 factor lock on account
- print("Enter a password")
- print(" ")
- password = read()
- -- hash verifies correct card
- hash = math.random(10000,99999)
- userfile = fs.open(usedir.."/"..hash, "w")
- -- password verifies correct user
- userfile.write(password)
- term.clear()
- term.setCursorPos(1,1)
- -- print data to disk
- print("Generating Disk Credentials.")
- sleep(1)
- diskfile = fs.open("/disk/data/user/"..hash, "w")
- diskfile.write(hash)
- disk.setLabel("bottom",user)
- disk.eject("bottom")
- end
- userGen()
Add Comment
Please, Sign In to add comment