Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --this is a Login Script
- version = "1.0.3"
- local Account = 0
- local Password = 0
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function LoginMenu()
- Clear()
- print("Enter Username, then press Enter")
- repeat
- local event, key = os.pullEvent("key")
- local input = read()
- until key == keys.enter
- Account = Input
- print("Enter Password, then press enter")
- repeat
- local event, key = os.pullEvent("key")
- local input = read()
- until key == keys.enter
- local Password = input
- print("Searching for Account")
- if fs.exists(Account) == true then
- local File = fs.open(Account,"r")
- if File.readLine() == Password then
- File.close()
- Signin()
- else
- File.close()
- os.sleep(3)
- os.reboot()
- end
- else
- print("Account does not exist")
- os.sleep(3)
- os.reboot()
- end
- end
- local function Signin()
- shell.run("AccountManager",Account)
- end
- local function CreateAccount()
- Clear()
- print("Create Account")
- print("Enter Username")
- repeat
- local event,key = os.pullEvent("key")
- local input = read()
- until key == keys.enter
- Account = input
- print("Enter Password")
- repeat
- local event, key = os.pullEvent("key")
- local input = read()
- until key == keys.enter
- Password = input
- print("Creating Account")
- local File = fs.open(Account,"w")
- File.writeLine(Password)
- File.writeLine(0)
- File.close()
- print("Account Created, Logging in")
- shell.run("AccountManager",Account)
- end
- Clear()
- print("BANKING TERMINAL-- Version = "..version)
- print("Options")
- print("1 - Login")
- print("2 - Create Account")
- repeat
- local event, key = os.pullEvent("key")
- until key == keys.one or key == keys.two
- if key == keys.one then
- LoginMenu()
- elseif key == keys.two then
- CreateAccount()
- end
- Clear()
Advertisement
Add Comment
Please, Sign In to add comment