Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- Variables
- --
- function handleError (errorMsg)
- term.clear()
- term.setCursorPos(1,1)
- errorMsg = errorMsg or "Unknown error occurred, rebooting..."
- print(errorMsg)
- sleep(5)
- os.reboot()
- end
- --
- -- Interface
- --
- -- Interface Init.
- term.clear()
- term.setCursor(1,1)
- -- Check Name
- print("Account Name:")
- local user = read()
- print("Account Password:")
- local userPassword = read()
- --
- -- Password Check
- --
- if fs.exists("accounts/"..user) == true then
- local file = fs.open("accounts/"..user.."accountInfo","r") -- open in read mode
- local accountPassword = file:read "*a" -- assign account's password to content
- file.close() -- always close or corruption can happen!
- if accountPassword == userPassword then
- print("Account Open!") -- test code
- sleep(5)
- os.reboot()
- -- Shell.openTab(WHATEVER UR ACCOUNT PROGRAM IS AND ITS ARGUMENTS)
- elseif accountPassword ~= userPassword then
- handleError("Error: Password Incorrect")
- end
- elseif fs.exists("accounts/"..user) == false then
- handleError("Error: Account doesn't exist")
- end
- handleError()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement