Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --LockOS v0.1--
- --Startup of the Computer--
- function lock()
- os.pullEvent = os.pullEventRaw --Prevents from people using CTRL + T that is shutting down the program, you can only turn off and reboot the computer but still you need to type in the password--
- term.clear()
- term.setCursorPos(1,1)
- sleep(1)
- print("LockOS 0.1")
- sleep(1)
- write("Password: ")
- pass = io.read()
- if pass == "password here" then -- "password here" is the password that you gonna use--
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Access granted. You may enter") -- textutils.slowPrint means it will slowly print the line. You can also use .slowWrite--
- rs.setOutput("string side", true) --You put here side you choose for redstone it can be "left","right","front","back","bottom", and "top".--
- sleep(?) --You put here the period of time when the object (door) is opened before it's closed. --
- rs.setOutput("string side", false) --Let's close the door--
- lock() -- restarts to its initial position (ln 3) if the password is correct--
- else
- textutils.slowWrite("Incorrect Password! Restarting")--I added these sleeps and dots to give a feeling that's loading and restarting :) --
- sleep(1)
- write(".")
- sleep(1)
- write(".")
- sleep(1)
- write(".")
- sleep(2)
- lock() --Restarting the proccess. Blip blop blup. --
- end
- end --Now let's close the ifs and whiles! --
- lock() --I don't know why I need this one here but I tested it without this line and it didn't work. --
- --Optional--
- --Hacking Floppy--
- --Note that I added these dots and sleeps to pretend that it's a real hacking program.--
- function logo() -- The logo function --
- term.clear()
- term.setCursorPos(1,1)
- print("AccessAll 0.5") --I named the program like that--
- end
- function dots()
- sleep(1)
- write(".")
- sleep(1)
- write(".")
- sleep(1)
- write(".")
- sleep(1)
- end
- --The program starts here:--
- logo() --Isn't it a lot easier when using function? You don't have to repeat--
- write("Hacking")
- dots()
- logo()
- write("Cracking")
- dots()
- logo()
- write("Loading preferences")
- dots()
- print("Done hacking! Enjoy!")
- sleep(2)
- logo()
Add Comment
Please, Sign In to add comment