Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function user()
- local user = read()
- return user
- end
- local function drawBox()
- if term.isColor() then
- paintutils.drawBox(2,10,49,12,colors.red)
- paintutils.drawLine(3,11,48,11,colors.white)
- else
- basic.drawBox(2,10,49,12)
- end
- term.setCursorPos(3,11)
- end
- local function pass(key)
- while true do
- drawBox()
- local pass = read(key)
- if term.isColor() then
- term.setBackgroundColor(colors.orange)
- term.setTextColor(colors.black)
- end
- term.clear()
- ks.center("Please confirm your password",9)
- drawBox()
- local CPass = read(key)
- if CPass == pass then
- break
- else
- term.setBackgroundColor(colors.orange)
- term.clear()
- ks.center("Those don't match! Let's try again!",true)
- end
- end
- end
- local function main()
- if term.isColor() then
- term.setBackgroundColor(colors.orange)
- term.setTextColor(colors.black)
- end
- term.clear()
- ks.center("Hello!",true)
- sleep(0.7)
- term.clear()
- ks.center("You don't have an account, it seems!",true)
- sleep(0.8)
- term.clear()
- ks.center("Shall we fix that?",true)
- sleep(0.7)
- term.clear()
- ks.center("That was a rhetorical question. I'm gonna do it",true)
- ks.center("anyway",10,true)
- sleep(1)
- term.clear()
- ks.center("Firstly, let's get your username!",true)
- drawBox()
- local userst = user()
- local user = userst
- local passKey = "\7"
- if userst == "Hydrotronics" then
- user = "Hydro"
- elseif userst == "Momboggins" then
- user = "Momo"
- passKey = "\3"
- end
- if term.isColor() then
- term.setBackgroundColor(colors.orange)
- end
- term.clear()
- ks.center("Cool name, "..user.."!",true)
- sleep(0.6)
- term.clear()
- ks.center("Now, for your password!",true)
- drawBox()
- local pass = pass(passKey)
- if term.isColor() then
- term.setBackgroundColor(colors.orange)
- end
- term.clear()
- ks.center("Brilliant! You now have an account!",true)
- sleep(0.8)
- term.clear()
- ks.center("I shall now generate your account!",true)
- term.setCursorPos(1,11)
- print("Loading file..")
- local file = fs.open("FireOS/32/User","w")
- print("Injecting data..")
- file.writeLine(user)
- file.writeLine(pass)
- print("Closing file..")
- file.close()
- print("Rebooting..")
- sleep(0.2)
- os.reboot()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement