Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- old_pullEvent = os.pullEvent
- os.pullEvent = os.pullEventRaw
- term.setBackgroundColor(colors.black)
- settings.load()
- local firststart = settings.get("firststart")
- if firststart == 1 then
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to CC setup!")
- print("Please chose a username")
- username = read()
- settings.define("username", {
- description = "The users username",
- })
- settings.set("username", username)
- print("Please chose a password")
- password = read()
- settings.define("password", {
- description = "the users password",
- })
- settings.set("password", password)
- print("Thank you for setting up CC!")
- settings.set("firststart", 0)
- settings.save()
- sleep(3)
- os.reboot()
- else
- settings.load()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- local logo = paintutils.loadImage("os/.logo")
- paintutils.drawImage(logo , 1, 1)
- term.setBackgroundColor(colors.black)
- sleep(3)
- term.setCursorPos(1,7)
- print("Welcome to CC. Please login")
- sleep(2)
- io.write("Username: ")
- username = read()
- if username == settings.get("username") then
- term.setCursorPos(1,9)
- io.write("Password: ")
- local password = read("*")
- if password == settings.get("password") then
- term.clear()
- term.setCursorPos(1,1)
- print("Login successful!")
- sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- speaker = peripheral.find("speaker")
- sleep(0.25)
- io.write("-----------")
- speaker.playNote("pling", 1, 12)
- sleep(0.25)
- io.write("-----------")
- speaker.playNote("pling", 1, 13)
- sleep(0.25)
- io.write("-----------")
- speaker.playNote("pling", 1, 17)
- sleep(0.25)
- io.write("-----------")
- speaker.playNote("pling", 1, 18)
- sleep(0.25)
- io.write("-------")
- speaker.playSound("minecraft:block.portal.travel")
- sleep(0.25)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.green)
- textutils.slowPrint("Welcome!", 5)
- sleep(0.25)
- term.setTextColor(colors.blue)
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome!")
- sleep(0.25)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.green)
- print("Welcome!")
- sleep(0.25)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("Welcome!")
- sleep(0.25)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.green)
- print("Welcome!")
- print("Loading CC Interface")
- sleep(1)
- term.setTextColor(colors.white)
- paintutils.drawLine(1, 2, 100, 2, colors.green)
- os.pullEvent = old_pullEvent
- term.setBackgroundColor(colors.blue)
- shell.run("os/.functions")
- else
- print("Login failed, please try again!")
- sleep(2)
- os.reboot()
- end
- else
- print("Username not found, please try again!")
- sleep(2)
- os.reboot()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement