Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --By zopther
- function passPrompt()
- while true do
- graphics.prepareScreen(colors.green, colors.black)
- print("Please enter your username and password.")
- write("Username: ")
- local username = string.lower(read())
- write("Password: ")
- local password = string.lower(read("*"))
- if security.accValid(username, password) then
- if username == "zopther" then
- write("Break?: ")
- sleep(0.2)
- if string.lower(read()) == "y" then
- break
- else
- shell.run("/programs/osMain")
- end
- else
- shell.run("/programs/osMain")
- end
- else
- print("Password incorrect!\nPress enter to try again!")
- sleep(0.5)
- read()
- end
- end
- end
- local function ejectDisk()
- while true do
- event,side = os.pullEventRaw()
- if(event == "disk" and side) then
- disk.eject(side)
- end
- end
- end
- local function detectCtrl()
- while true do
- event,keypress = os.pullEventRaw()
- if(event == "key" and (keypress==29 or keypress==157)) then
- os.reboot()
- end
- end
- end
- parallel.waitForAny(detectCtrl, ejectDisk, passPrompt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement