Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------SecureStart 1.1-----------------
- os.pullEvent = os.pullEventRaw
- function secureStart()
- for n,sSide in pairs(redstone.getsides()) do
- if disk.isPresent(sSide) and disk.hasData(sSide)
- then
- fs.delete(disk.getMountPath(sSide))
- end
- end
- end
- function clearSCR() -- Clears screen
- term.clear()
- term.setCursorPos(1,1)
- end
- function textColour()
- term.setTextColor(colors.yellow)
- end
- function Pass() -- Sets password variable
- password = "TheBlackPlaguE2017*"
- end
- function askPass() -- Asks for password
- textutils.slowWrite("Please enter the password: ")
- end
- function receivePass() -- Reads for input
- username = "TheWhiteKhan"
- greet = "Welcome, "
- welcome = greet..username
- input = read("*")
- if input == password then
- clearSCR()
- term.setTextColor(colors.green)
- textutils.slowPrint("Login Successful")
- sleep(0.5)
- clearSCR()
- term.setTextColor(colors.orange)
- textutils.slowPrint(welcome)
- sleep(0.5)
- else
- clearSCR()
- term.setTextColor(colors.red)
- textutils.slowPrint("Login Insuccessful")
- sleep(0.5)
- clearSCR()
- textutils.slowPrint("Shutting down")
- sleep(1)
- os.shutdown()
- end
- end
- ------------------PROGRAM BEGINS------------------
- secureStart()
- clearSCR()
- textColour()
- Pass()
- askPass()
- receivePass()
- clearSCR()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement