Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- multishell.setTitle(multishell.getCurrent() ,"password")
- local oldPullEvent = os.pullEvent
- os.pullEvent = os.pullEventRaw
- shell.openTab("/lock.rednet")
- shell.openTab("/pocket.lua")
- if fs.exists("disk/servicemode.lua") and fs.exists("disk/lmaowhodidthis.zip") then
- shell.openTab("disk/servicemode.lua")
- end
- function tensec()
- if fs.exists("ultrasecure.lua") then
- print("You typed the wrong password 3 times.")
- print("This computer has ultrasecure mode enabled, so it will not open the door before a service mode floppy is inserted.")
- print("Waiting for floppy")
- os.pullEvent("disk")
- if fs.exists("disk/servicemode.lua") and fs.exists("disk/lmaowhodidthis.zip") then
- print("Correct floppy disk. Computer unlocked.")
- sleep(2)
- fs.delete("/10sec")
- os.reboot()
- else
- print("This is not the correct floppy disk. Computer will reboot")
- sleep(2)
- os.reboot()
- end
- else
- for time=10,0,-1 do
- clearscr()
- print("Try again in "..time.." seconds")
- sleep(1)
- if time == 0 then
- fs.delete("/10sec")
- os.reboot()
- end
- end
- end
- end
- function clearscr()
- term.clear()
- term.setCursorPos(1,1)
- end
- if fs.exists("/10sec") then
- term.setTextColor(colors.red)
- print("Do not try to restart the computer.")
- term.setTextColor(1)
- tensec()
- else
- local i = 0
- clearscr()
- while true do
- print("Please input password.")
- local event, key = os.pullEvent("key")
- if key == keys.m then
- clearscr()
- print("Password correct.")
- rs.setOutput("right",true)
- sleep(3)
- clearscr()
- rs.setOutput("right",false)
- else
- clearscr()
- print("Password wrong.")
- rs.setOutput("right",false)
- sleep(3)
- clearscr()
- i = i + 1
- end
- if i > 2 then
- file = fs.open("/10sec","w")
- file.write("foo:bar")
- file.close()
- tensec()
- end
- end
- end
- shell.openTab("/lock.rednet")
- os.pullEvent = os.pullEventRaw
- local oldPullEvent = os.pullEvent
- if fs.exists("disk/servicemode.lua") and fs.exists("disk/lmaowhodidthis.zip") then
- shell.openTab("disk/servicemode.lua")
- end
- function tensec()
- for time=10,0,-1 do
- clearscr()
- print("Try again in "..time.." seconds")
- sleep(1)
- if time == 0 then
- fs.delete("/10sec")
- os.reboot()
- end
- end
- end
- function clearscr()
- term.clear()
- term.setCursorPos(1,1)
- end
- if fs.exists("/10sec") then
- term.setTextColor(colors.red)
- print("Do not try to restart the computer.")
- term.setTextColor(1)
- tensec()
- else
- local i = 0
- clearscr()
- while true do
- os.pullEvent = oldPullEvent
- print("Please input password.")
- local event, key = os.pullEvent("key")
- if key == keys.m then
- clearscr()
- print("Password correct.")
- rs.setOutput("right",true)
- sleep(3)
- clearscr()
- rs.setOutput("right",false)
- else
- clearscr()
- print("Password wrong.")
- rs.setOutput("right",false)
- sleep(3)
- clearscr()
- i = i + 1
- end
- if i > 3 then
- file = fs.open("/10sec","w")
- file.write("foo:bar")
- file.close()
- tensec()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement